Skip to content

Commit c2b881a

Browse files
committed
Write doc
1 parent 1d6d46f commit c2b881a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

_gem/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,42 @@ require "go_gem/mkmf" # Append this
3333
create_go_makefile("example/example")
3434
```
3535

36+
### `GoGem::RakeTask`
37+
Provides rake tasks for `go test` with CRuby
38+
39+
#### Example (Without config)
40+
```ruby
41+
# Rakefile
42+
require "go_gem/rake_task"
43+
44+
GoGem::RakeTask.new("gem_name")
45+
```
46+
47+
Following tasks are generated
48+
49+
* `rake go:test`
50+
51+
#### Example (With config)
52+
```ruby
53+
# Rakefile
54+
require "go_gem/rake_task"
55+
56+
GoGem::RakeTask.new("gem_name") do |config|
57+
config.task_namespace = "go5"
58+
config.go_bin_path = "/path/to/go"
59+
config.go_test_args = "#{GoGem::RakeTask::DEFAULT_GO_TEST_ARGS} -race"
60+
end
61+
```
62+
63+
Following tasks are generated
64+
65+
* `rake go5:test`
66+
67+
#### Available configurations
68+
* `task_namespace` : task namespace (default: `:go`)
69+
* `go_bin_path` : path to go binary (default: `"go"`)
70+
* `go_test_args` : argument passed to `go test` (default: `"-mod=readonly -count=1"`)
71+
3672
## Development
3773

3874
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

0 commit comments

Comments
 (0)