|
1 | 1 | module GoGem
|
2 |
| - # Provides rake tasks for `go test` with CRuby |
3 | 2 | class RakeTask < ::Rake::TaskLib
|
4 |
| - @gem_name: untyped |
| 3 | + @gem_name: String |
5 | 4 |
|
6 |
| - @task_namespace: untyped |
| 5 | + @task_namespace: Symbol |
7 | 6 |
|
8 |
| - @go_bin_path: untyped |
| 7 | + @go_bin_path: String |
9 | 8 |
|
10 |
| - @go_test_args: untyped |
| 9 | + @go_test_args: String |
11 | 10 |
|
12 |
| - DEFAULT_TASK_NAMESPACE: :go |
| 11 | + DEFAULT_TASK_NAMESPACE: Symbol |
13 | 12 |
|
14 |
| - DEFAULT_GO_BIN_PATH: "go" |
| 13 | + DEFAULT_GO_BIN_PATH: String |
15 | 14 |
|
16 |
| - DEFAULT_GO_TEST_ARGS: "-mod=readonly -count=1" |
| 15 | + DEFAULT_GO_TEST_ARGS: String |
17 | 16 |
|
18 |
| - # @!attribute [r] gem_name |
19 |
| - # @return [String] |
20 |
| - attr_reader gem_name: untyped |
| 17 | + attr_reader gem_name: String |
21 | 18 |
|
22 |
| - # @!attribute task_namespace |
23 |
| - # @return [Symbol] task namespace (default: `:go`) |
24 |
| - attr_accessor task_namespace: untyped |
| 19 | + attr_accessor task_namespace: Symbol |
25 | 20 |
|
26 |
| - # @!attribute go_bin_path |
27 |
| - # @return [String] path to go binary (default: `"go"`) |
28 |
| - attr_accessor go_bin_path: untyped |
| 21 | + attr_accessor go_bin_path: String |
29 | 22 |
|
30 |
| - # @!attribute go_test_args |
31 |
| - # @return [String] argument passed to `go test` (default: `"-mod=readonly -count=1"`) |
32 |
| - attr_accessor go_test_args: untyped |
| 23 | + attr_accessor go_test_args: String |
33 | 24 |
|
34 |
| - # @param gem_name [String] |
35 |
| - # @yield configuration of {RakeTask} |
36 |
| - # @yieldparam config [RakeTask] |
37 |
| - def initialize: (untyped gem_name) ?{ (untyped) -> untyped } -> void |
| 25 | + def initialize: (String gem_name) ?{ (RakeTask) -> void } -> void |
38 | 26 |
|
39 |
| - # Generate environment variables for go build with CRuby |
40 |
| - # |
41 |
| - # @return [Hash<String, String>] |
42 |
| - def self.build_env_vars: () -> { "CGO_CFLAGS" => untyped, "CGO_LDFLAGS" => untyped, "LD_LIBRARY_PATH" => untyped } |
| 27 | + def self.build_env_vars: () -> { "CGO_CFLAGS" => String, "CGO_LDFLAGS" => String, "LD_LIBRARY_PATH" => String } |
43 | 28 |
|
44 | 29 | private
|
45 | 30 |
|
46 |
| - # @yield |
47 |
| - def within_ext_dir: () { () -> untyped } -> untyped |
| 31 | + def within_ext_dir: () { () -> void } -> void |
48 | 32 |
|
49 |
| - # @return [String] |
50 |
| - def ext_dir: () -> untyped |
| 33 | + def ext_dir: () -> String |
51 | 34 | end
|
52 | 35 | end
|
0 commit comments