Skip to content

Commit 2b5cdac

Browse files
authored
Merge pull request #180 from sue445/feature/go_gem_doc
Add go_gem doc
2 parents 31de0f5 + f0cc0c8 commit 2b5cdac

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

gem/README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
# GoGem
2+
Helpers for compiling Go extensions for ruby
23

3-
TODO: Delete this and the text below, and describe your gem
4+
## Installation
5+
Add below.
46

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/go_gem`. To experiment with that code, run `bin/console` for an interactive prompt.
7+
```ruby
8+
spec.add_dependency "go_gem"
9+
```
610

7-
## Installation
11+
See below for details.
812

9-
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.
13+
[/_tools/patch_for_go_gem/](/_tools/patch_for_go_gem/)
1014

11-
Install the gem and add to the application's Gemfile by executing:
15+
## Usage
16+
### `create_go_makefile`
17+
`create_go_makefile` is an extension of `create_makefile`.
1218

13-
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
19+
Add a task and hacks to build Go against the `Makefile` generated by `create_makefile`.
1420

15-
If bundler is not being used to manage dependencies, install the gem by executing:
21+
e.g.
1622

17-
$ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
23+
```ruby
24+
# ext/GEM_NAME/extconf.rb
1825

19-
## Usage
26+
require "mkmf"
27+
require "go_gem/mkmf" # Append this
2028

21-
TODO: Write usage instructions here
29+
# Use create_go_makefile instead of create_makefile
30+
# create_makefile("example/example")
31+
create_go_makefile("example/example")
32+
```
2233

2334
## Development
2435

@@ -28,7 +39,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
2839

2940
## Contributing
3041

31-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/go_gem.
42+
Bug reports and pull requests are welcome on GitHub at https://github.com/sue445/go-gem-wrapper.
3243

3344
## License
3445

0 commit comments

Comments
 (0)