Skip to content

Commit 9a7d600

Browse files
committed
Tweak doc [ci skip]
1 parent 3eb3d8e commit 9a7d600

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

_gem/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ See below for details.
1515
[/_tools/patch_for_go_gem/](/_tools/patch_for_go_gem/)
1616

1717
## Usage
18-
### `create_go_makefile`
18+
### [`create_go_makefile`](https://ruby-go-gem.github.io/go-gem-wrapper/GoGem/Mkmf.html#create_go_makefile-instance_method)
1919
`create_go_makefile` is an extension of `create_makefile`.
2020

2121
Add a task and hacks to build Go against the `Makefile` generated by `create_makefile`.
@@ -31,9 +31,12 @@ require "go_gem/mkmf" # Append this
3131
# Use create_go_makefile instead of create_makefile
3232
# create_makefile("example/example")
3333
create_go_makefile("example/example")
34+
35+
# Pass debug flags to `go build`
36+
create_go_makefile("example/example", go_build_args: "-gcflags='all=-N -l'")
3437
```
3538

36-
### `GoGem::RakeTask`
39+
### [`GoGem::RakeTask`](https://ruby-go-gem.github.io/go-gem-wrapper/GoGem/RakeTask.html)
3740
Provides rake tasks for `go test` with CRuby
3841

3942
#### Example (Without config)

_gem/lib/go_gem/rake_task.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module GoGem
4040
# end
4141
#
4242
# build_tag = GoGem::Util.ruby_minor_version_build_tag
43-
# sh GoGem::RakeTask.build_env_vars, "golangci-lint run --build-tags #{build_tag}"
43+
# sh GoGem::RakeTask.build_env_vars, "golangci-lint run --build-tags #{build_tag} --modules-download-mode=readonly"
4444
# end
4545
# end
4646
# end
@@ -112,14 +112,16 @@ def self.build_env_vars
112112
}
113113
end
114114

115+
# Change current working dir inside `ext/<GEM_NAME>/`
116+
#
115117
# @yield
116118
def within_target_dir
117119
Dir.chdir(target_dir) do # rubocop:disable Style/ExplicitBlockArgument
118120
yield
119121
end
120122
end
121123

122-
# @return [String]
124+
# @return [String] ext dir name (e.g.`ext/<GEM_NAME>/`)
123125
def ext_dir
124126
File.join("ext", gem_name)
125127
end

0 commit comments

Comments
 (0)