Skip to content

Commit edb975f

Browse files
authored
Merge pull request #676 from deivid-rodriguez/followup_to_ruby_1_support_drop
Followup to ruby 1 support drop
2 parents 96b52ea + 0431572 commit edb975f

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

Gemfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
gem "rake", "< 11"
3+
gem "rake"
44

55
group :development do
66
gem "pry"
@@ -16,8 +16,6 @@ end
1616
group :test do
1717
gem "childlabor"
1818
gem "coveralls", ">= 0.8.19"
19-
gem "mime-types", "~> 1.25", :platforms => [:jruby]
20-
gem "rest-client", "~> 1.6.0", :platforms => [:jruby]
2119
gem "rspec", ">= 3"
2220
gem "rspec-mocks", ">= 3"
2321
gem "rubocop", ">= 0.19"

lib/thor/actions/directory.rb

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,12 @@ def execute!
9696
end
9797
end
9898

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
111102

112-
def files(lookup)
113-
Dir.glob(lookup, File::FNM_DOTMATCH)
114-
end
103+
def files(lookup)
104+
Dir.glob(lookup, File::FNM_DOTMATCH)
115105
end
116106
end
117107
end

spec/register_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ClassOptionGroupPlugin < Thor::Group
4747
:default => "zebra"
4848
end
4949

50-
class CompatibleWith19Plugin < ClassOptionGroupPlugin
50+
class PluginInheritingFromClassOptionsGroup < ClassOptionGroupPlugin
5151
desc "animal"
5252
def animal
5353
p options[:who]
@@ -119,7 +119,7 @@ def with_args(*args)
119119
)
120120

121121
BoringVendorProvidedCLI.register(
122-
CompatibleWith19Plugin,
122+
PluginInheritingFromClassOptionsGroup,
123123
"zoo",
124124
"zoo [-w animal]",
125125
"Shows a provided animal or just zebra"
@@ -221,13 +221,13 @@ def with_args(*args)
221221
end
222222
end
223223

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
226226
group_output = capture(:stdout) { BoringVendorProvidedCLI.start(%w(zoo)) }
227227
expect(group_output).to match(/zebra/)
228228
end
229229

230-
it "is compatible with both 1.8 and 1.9 syntax w/command options" do
230+
it "works w/command options" do
231231
group_output = capture(:stdout) { BoringVendorProvidedCLI.start(%w(zoo -w lion)) }
232232
expect(group_output).to match(/lion/)
233233
end

0 commit comments

Comments
 (0)