File tree Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Original file line number Diff line number Diff line change 1
1
source "https://rubygems.org"
2
2
3
- gem "rake" , "< 11"
3
+ gem "rake"
4
4
5
5
group :development do
6
6
gem "pry"
16
16
group :test do
17
17
gem "childlabor"
18
18
gem "coveralls" , ">= 0.8.19"
19
- gem "mime-types" , "~> 1.25" , :platforms => [ :jruby ]
20
- gem "rest-client" , "~> 1.6.0" , :platforms => [ :jruby ]
21
19
gem "rspec" , ">= 3"
22
20
gem "rspec-mocks" , ">= 3"
23
21
gem "rubocop" , ">= 0.19"
Original file line number Diff line number Diff line change @@ -96,22 +96,12 @@ def execute!
96
96
end
97
97
end
98
98
99
- if RUBY_VERSION < "2.0"
100
- def file_level_lookup ( previous_lookup )
101
- File . join ( previous_lookup , "{*,.[a-z]*}" )
102
- end
103
-
104
- def files ( lookup )
105
- Dir [ lookup ]
106
- end
107
- else
108
- def file_level_lookup ( previous_lookup )
109
- File . join ( previous_lookup , "*" )
110
- end
99
+ def file_level_lookup ( previous_lookup )
100
+ File . join ( previous_lookup , "*" )
101
+ end
111
102
112
- def files ( lookup )
113
- Dir . glob ( lookup , File ::FNM_DOTMATCH )
114
- end
103
+ def files ( lookup )
104
+ Dir . glob ( lookup , File ::FNM_DOTMATCH )
115
105
end
116
106
end
117
107
end
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class ClassOptionGroupPlugin < Thor::Group
47
47
:default => "zebra"
48
48
end
49
49
50
- class CompatibleWith19Plugin < ClassOptionGroupPlugin
50
+ class PluginInheritingFromClassOptionsGroup < ClassOptionGroupPlugin
51
51
desc "animal"
52
52
def animal
53
53
p options [ :who ]
@@ -119,7 +119,7 @@ def with_args(*args)
119
119
)
120
120
121
121
BoringVendorProvidedCLI . register (
122
- CompatibleWith19Plugin ,
122
+ PluginInheritingFromClassOptionsGroup ,
123
123
"zoo" ,
124
124
"zoo [-w animal]" ,
125
125
"Shows a provided animal or just zebra"
@@ -221,13 +221,13 @@ def with_args(*args)
221
221
end
222
222
end
223
223
224
- describe "1.8 and 1.9 syntax compatibility " do
225
- it "is compatible with both 1.8 and 1.9 syntax w/o command options" do
224
+ describe ".register-ing a Thor::Group subclass with class options " do
225
+ it "works w/o command options" do
226
226
group_output = capture ( :stdout ) { BoringVendorProvidedCLI . start ( %w( zoo ) ) }
227
227
expect ( group_output ) . to match ( /zebra/ )
228
228
end
229
229
230
- it "is compatible with both 1.8 and 1.9 syntax w/command options" do
230
+ it "works w/command options" do
231
231
group_output = capture ( :stdout ) { BoringVendorProvidedCLI . start ( %w( zoo -w lion ) ) }
232
232
expect ( group_output ) . to match ( /lion/ )
233
233
end
You can’t perform that action at this time.
0 commit comments