File tree Expand file tree Collapse file tree 2 files changed +36
-20
lines changed Expand file tree Collapse file tree 2 files changed +36
-20
lines changed Original file line number Diff line number Diff line change @@ -65,26 +65,9 @@ def initialize(gem_name)
65
65
yield ( self ) if block_given?
66
66
67
67
namespace ( task_namespace ) do
68
- desc "Run #{ go_bin_path } test"
69
- task ( :test ) do
70
- within_target_dir do
71
- sh RakeTask . build_env_vars , "#{ go_bin_path } test #{ go_test_args } ./..."
72
- end
73
- end
74
-
75
- desc "Run #{ go_bin_path } test -race"
76
- task ( :testrace ) do
77
- within_target_dir do
78
- sh RakeTask . build_env_vars , "#{ go_bin_path } test #{ go_test_args } -race ./..."
79
- end
80
- end
81
-
82
- desc "Run #{ go_bin_path } fmt"
83
- task ( :fmt ) do
84
- within_target_dir do
85
- sh "#{ go_bin_path } fmt ./..."
86
- end
87
- end
68
+ define_go_test_task
69
+ define_go_testrace_task
70
+ define_go_fmt_task
88
71
end
89
72
end
90
73
@@ -129,6 +112,33 @@ def self.build_env_vars
129
112
130
113
private
131
114
115
+ def define_go_test_task
116
+ desc "Run #{ go_bin_path } test"
117
+ task ( :test ) do
118
+ within_target_dir do
119
+ sh RakeTask . build_env_vars , "#{ go_bin_path } test #{ go_test_args } ./..."
120
+ end
121
+ end
122
+ end
123
+
124
+ def define_go_testrace_task
125
+ desc "Run #{ go_bin_path } test -race"
126
+ task ( :testrace ) do
127
+ within_target_dir do
128
+ sh RakeTask . build_env_vars , "#{ go_bin_path } test #{ go_test_args } -race ./..."
129
+ end
130
+ end
131
+ end
132
+
133
+ def define_go_fmt_task
134
+ desc "Run #{ go_bin_path } fmt"
135
+ task ( :fmt ) do
136
+ within_target_dir do
137
+ sh "#{ go_bin_path } fmt ./..."
138
+ end
139
+ end
140
+ end
141
+
132
142
# @yield
133
143
def within_target_dir
134
144
Dir . chdir ( target_dir ) do # rubocop:disable Style/ExplicitBlockArgument
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module GoGem
32
32
33
33
private
34
34
35
+ def define_go_test_task : () -> void
36
+
37
+ def define_go_testrace_task : () -> void
38
+
39
+ def define_go_fmt_task : () -> void
40
+
35
41
def within_target_dir : () { () -> void } -> void
36
42
37
43
def ext_dir : () -> String
You can’t perform that action at this time.
0 commit comments