Skip to content

Commit 448015a

Browse files
authored
Merge pull request #11 from sue445/doc
Write doc
2 parents 01d9b41 + 8d966bc commit 448015a

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,54 @@
11
# RubyHeaderParser
2-
3-
TODO: Delete this and the text below, and describe your gem
4-
5-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ruby_header_parser`. To experiment with that code, run `bin/console` for an interactive prompt.
2+
Parser for `ruby.h`
63

74
[![test](https://github.com/sue445/ruby_header_parser/actions/workflows/test.yml/badge.svg)](https://github.com/sue445/ruby_header_parser/actions/workflows/test.yml)
85

96
## Installation
107

11-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
12-
138
Install the gem and add to the application's Gemfile by executing:
149

1510
```bash
16-
bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
11+
bundle add ruby_header_parser
1712
```
1813

1914
If bundler is not being used to manage dependencies, install the gem by executing:
2015

2116
```bash
22-
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
17+
gem install ruby_header_parser
18+
```
19+
20+
## Requirements
21+
Following is required in addition to Ruby.
22+
23+
### ctags
24+
macOS
25+
26+
```bash
27+
brew install universal-ctags
28+
```
29+
30+
Ubuntu
31+
32+
```bash
33+
apt-get install -y universal-ctags
2334
```
2435

2536
## Usage
37+
```ruby
38+
require "ruby_header_parser"
39+
40+
parser = RubyHeaderParser::Parser.new
41+
42+
function_definitions = parser.extract_function_definitions
43+
static_inline_function_definitions = parser.extract_static_inline_function_definitions
44+
struct_definitions = parser.extract_struct_definitions
45+
type_definitions = parser.extract_type_definitions
46+
enum_definitions = parser.extract_enum_definitions
47+
```
48+
49+
See below for details.
2650

27-
TODO: Write usage instructions here
51+
https://sue445.github.io/ruby_header_parser/RubyHeaderParser/Parser.html
2852

2953
## Development
3054

@@ -34,7 +58,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
3458

3559
## Contributing
3660

37-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ruby_header_parser.
61+
Bug reports and pull requests are welcome on GitHub at https://github.com/sue445/ruby_header_parser.
3862

3963
## License
4064

0 commit comments

Comments
 (0)