Skip to content

Commit ae4a3d5

Browse files
Drop ruby 1.x support
1 parent 04d7560 commit ae4a3d5

File tree

14 files changed

+29
-384
lines changed

14 files changed

+29
-384
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ before_install:
77
bundler_args: --without development
88
language: ruby
99
rvm:
10-
- 1.8.7
11-
- 1.9.3
1210
- 2.0.0
1311
- 2.1.10
1412
- 2.2.10

Gemfile

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,30 @@
11
source "https://rubygems.org"
22

33
gem "rake", "< 11"
4-
gem "rdoc", "~> 4.2.2" # This is to support Ruby 1.8 and 1.9
54

65
group :development do
76
gem "pry"
87
platforms :ruby_21 do
98
gem "pry-byebug"
109
end
11-
platforms :ruby_19, :ruby_20 do
10+
platforms :ruby_20 do
1211
gem "pry-debugger"
1312
gem "pry-stack_explorer"
1413
end
1514
end
1615

1716
group :test do
18-
gem "addressable", "~> 2.3.6", :platforms => [:ruby_18]
1917
gem "childlabor"
2018
gem "coveralls", ">= 0.8.19"
21-
gem "json", "< 2" # This is to support Ruby 1.8 and 1.9
22-
gem "mime-types", "~> 1.25", :platforms => [:jruby, :ruby_18]
23-
gem "rest-client", "~> 1.6.0", :platforms => [:jruby, :ruby_18]
19+
gem "mime-types", "~> 1.25", :platforms => [:jruby]
20+
gem "rest-client", "~> 1.6.0", :platforms => [:jruby]
2421
gem "rspec", ">= 3"
2522
gem "rspec-mocks", ">= 3"
26-
gem "rubocop", ">= 0.19", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
23+
gem "rubocop", ">= 0.19"
2724
gem "simplecov", ">= 0.13"
28-
gem "term-ansicolor", "~> 1.3.2" # This is to support Ruby 1.8 and 1.9
29-
gem "tins", "< 1.7" # This is to support Ruby 1.8 and 1.9
30-
if RUBY_VERSION < "1.9.3"
31-
gem "webmock", ">= 1.20", "< 2" # This is to support Ruby 1.8 and 1.9.2
32-
gem "hashdiff", "< 0.3.6" # Hashdiff 0.3.6 no longer supports Ruby 1.8
33-
else
34-
gem "webmock"
35-
end
36-
if RUBY_VERSION >= '1.9'
37-
# `did_you_mean` can't build with Ruby 1.8.
38-
gem 'did_you_mean'
39-
end
25+
gem "webmock"
4026
end
4127

28+
gem 'did_you_mean'
29+
4230
gemspec

lib/thor/base.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require "thor/command"
22
require "thor/core_ext/hash_with_indifferent_access"
3-
require "thor/core_ext/ordered_hash"
43
require "thor/error"
54
require "thor/invocation"
65
require "thor/parser"
@@ -353,22 +352,22 @@ def group(name = nil)
353352
# Returns the commands for this Thor class.
354353
#
355354
# ==== Returns
356-
# OrderedHash:: An ordered hash with commands names as keys and Thor::Command
357-
# objects as values.
355+
# Hash:: An ordered hash with commands names as keys and Thor::Command
356+
# objects as values.
358357
#
359358
def commands
360-
@commands ||= Thor::CoreExt::OrderedHash.new
359+
@commands ||= Hash.new
361360
end
362361
alias_method :tasks, :commands
363362

364363
# Returns the commands for this Thor class and all subclasses.
365364
#
366365
# ==== Returns
367-
# OrderedHash:: An ordered hash with commands names as keys and Thor::Command
368-
# objects as values.
366+
# Hash:: An ordered hash with commands names as keys and Thor::Command
367+
# objects as values.
369368
#
370369
def all_commands
371-
@all_commands ||= from_superclass(:all_commands, Thor::CoreExt::OrderedHash.new)
370+
@all_commands ||= from_superclass(:all_commands, Hash.new)
372371
@all_commands.merge!(commands)
373372
end
374373
alias_method :all_tasks, :all_commands

lib/thor/command.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def sans_backtrace(backtrace, caller) #:nodoc:
9797
def handle_argument_error?(instance, error, caller)
9898
not_debugging?(instance) && (error.message =~ /wrong number of arguments/ || error.message =~ /given \d*, expected \d*/) && begin
9999
saned = sans_backtrace(error.backtrace, caller)
100-
# Ruby 1.9 always include the called method in the backtrace
101-
saned.empty? || (saned.size == 1 && RUBY_VERSION >= "1.9")
100+
saned.empty? || saned.size == 1
102101
end
103102
end
104103

lib/thor/core_ext/ordered_hash.rb

Lines changed: 0 additions & 129 deletions
This file was deleted.

lib/thor/line_editor/basic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_input
2424
$stdin.gets
2525
else
2626
# Lazy-load io/console since it is gem-ified as of 2.3
27-
require "io/console" if RUBY_VERSION > "1.9.2"
27+
require "io/console"
2828
$stdin.noecho(&:gets)
2929
end
3030
end

lib/thor/line_editor/readline.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ def self.available?
1313
def readline
1414
if echo?
1515
::Readline.completion_append_character = nil
16-
# Ruby 1.8.7 does not allow Readline.completion_proc= to receive nil.
17-
if complete = completion_proc
18-
::Readline.completion_proc = complete
19-
end
16+
::Readline.completion_proc = completion_proc
2017
::Readline.readline(prompt, add_to_history?)
2118
else
2219
super

0 commit comments

Comments
 (0)