Skip to content

Commit 9d0e8d9

Browse files
Drop ruby 1.8 and ruby 1.9 support
1 parent a135917 commit 9d0e8d9

33 files changed

Lines changed: 23 additions & 2169 deletions

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ env:
44
- "CC_TEST_REPORTER_ID=faa393209ff0a104cf37511a9a03510bcee37951971b1ca4ffc2af217851d47e"
55
language: ruby
66
rvm:
7-
- 1.8.7
8-
- ree
9-
- 1.9.3
107
- 2.0
118
- 2.1
129
- 2.2
@@ -19,7 +16,6 @@ rvm:
1916
- jruby
2017
matrix:
2118
allow_failures:
22-
- rvm: 1.8.7
2319
- rvm: ruby-head
2420
- rvm: jruby
2521
branches:

Gemfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ gemspec
77
# Include everything needed to run rake, tests, features, etc.
88
group :development do
99
gem 'bundler'
10-
gem 'json', '~> 1.8' if RUBY_VERSION < '2.0'
11-
gem 'rake', RUBY_VERSION < '1.9' ? '~> 10.5' : '>= 10.5'
12-
gem 'rdoc', Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.9.3') ? '~> 4.2.2' : Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2') ? '< 6' : '>= 6'
10+
gem 'rake', '>= 10.5'
11+
gem 'rdoc', Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2') ? '< 6' : '>= 6'
1312
gem 'RedCloth', RUBY_PLATFORM == 'java' ? '= 4.2.9' : '>= 4.0.3'
1413
gem 'rspec', '~> 3.9.0'
15-
gem 'shoulda-context', RUBY_VERSION < '1.9' ? '= 1.2.1' : '>= 1.2.1'
14+
gem 'shoulda-context', '>= 1.2.1'
1615
gem 'simplecov', RUBY_VERSION < '2.7' ? '~> 0.17.1' : '>= 0.18.5'
17-
gem 'term-ansicolor', RUBY_VERSION < '2.0' ? '~> 1.3.2' : '>= 1.3.2'
18-
gem 'test-unit', RUBY_VERSION < '1.9' ? '~> 2.0' : '>= 3.0'
19-
gem 'tins', RUBY_VERSION < '2.0' ? '~> 1.6.0' : '>= 1.6.0'
16+
gem 'term-ansicolor', '>= 1.3.2'
17+
gem 'test-unit', '>= 3.0'
18+
gem 'tins', '>= 1.6.0'
2019
end

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You put your code in, and you get it back colored; Keywords, strings, floats, co
1515

1616
### Dependencies
1717

18-
CodeRay needs Ruby 1.8.7, 1.9.3 or 2.0+. It also runs on JRuby.
18+
CodeRay needs Ruby 2.0+. It also runs on JRuby.
1919

2020
## Example Usage
2121

README_INDEX.rdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ floats, comments - all in different colors. And with line numbers.
2626

2727
=== Dependencies
2828

29-
CodeRay needs Ruby 1.8.7+ or 1.9.2+. It also runs on Rubinius and JRuby.
29+
CodeRay needs Ruby 2.0+. It also runs on Rubinius and JRuby.
3030

3131

3232
== Example Usage

coderay.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
2020
s.license = 'MIT'
2121

2222
s.platform = Gem::Platform::RUBY
23-
s.required_ruby_version = '>= 1.8.6'
23+
s.required_ruby_version = '>= 2.0.0'
2424

2525
readme_file = 'README_INDEX.rdoc'
2626

lib/coderay/duo.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def encode code, options = {}
7171
#
7272
# CodeRay::Duo[:python => :yaml].call(code)
7373
#
74-
# or, in Ruby 1.9 and later:
74+
# or:
7575
#
7676
# CodeRay::Duo[:python => :yaml].(code)
7777
alias call encode

lib/coderay/encoders/html/numbering.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def self.number! output, mode = :table, options = {}
5656
raise ArgumentError, 'Invalid value %p for :bolding; false or Integer expected.' % bold_every
5757
end
5858

59-
if position_of_last_newline = output.rindex(RUBY_VERSION >= '1.9' ? /\n/ : ?\n)
59+
if position_of_last_newline = output.rindex(/\n/)
6060
after_last_newline = output[position_of_last_newline + 1 .. -1]
6161
ends_with_newline = after_last_newline[/\A(?:<\/span>)*\z/]
6262

lib/coderay/scanners/java.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Java < Scanner
4444
'"' => /[^\\"]+/,
4545
'/' => /[^\\\/]+/,
4646
} # :nodoc:
47-
IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : Regexp.new('[[[:alpha:]]_][[[:alnum:]]_]*') # :nodoc:
47+
IDENT = Regexp.new('[[[:alpha:]]_][[[:alnum:]]_]*') # :nodoc:
4848

4949
protected
5050

rake_tasks/documentation.rake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
begin
2-
if RUBY_VERSION >= '1.8.7'
3-
gem 'rdoc' if defined? gem
4-
require 'rdoc/task'
5-
else
6-
require 'rake/rdoctask'
7-
end
2+
gem 'rdoc' if defined? gem
3+
require 'rdoc/task'
84
rescue LoadError
95
warn 'Please gem install rdoc.'
106
end

rake_tasks/test.rake

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,11 @@ Please rename or remove it and run again to use the GitHub repository:
6969

7070
desc 'test the CodeRay executable'
7171
task :exe do
72-
if RUBY_VERSION >= '1.8.7'
73-
ruby './test/executable/suite.rb'
74-
else
75-
puts
76-
puts "Can't run executable tests because shoulda-context requires Ruby 1.8.7+."
77-
puts "Skipping."
78-
end
72+
ruby './test/executable/suite.rb'
7973
end
8074
end
8175

82-
if RUBY_VERSION >= '1.9'
83-
require 'rspec/core/rake_task'
84-
RSpec::Core::RakeTask.new(:spec)
85-
end
76+
require 'rspec/core/rake_task'
77+
RSpec::Core::RakeTask.new(:spec)
8678

8779
task :test => %w(test:functional test:units test:exe spec)

0 commit comments

Comments
 (0)