Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ env:
- "CC_TEST_REPORTER_ID=faa393209ff0a104cf37511a9a03510bcee37951971b1ca4ffc2af217851d47e"
language: ruby
rvm:
- 1.8.7
- ree
- 1.9.3
- 2.0
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
Expand All @@ -19,7 +12,6 @@ rvm:
- jruby
matrix:
allow_failures:
- rvm: 1.8.7
- rvm: ruby-head
- rvm: jruby
branches:
Expand Down
15 changes: 7 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ gemspec
# Include everything needed to run rake, tests, features, etc.
group :development do
gem 'bundler'
gem 'json', '~> 1.8' if RUBY_VERSION < '2.0'
gem 'rake', RUBY_VERSION < '1.9' ? '~> 10.5' : '>= 10.5'
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'
gem 'rake', '>= 10.5'
gem 'rdoc', '>= 6'
gem 'RedCloth', RUBY_PLATFORM == 'java' ? '= 4.2.9' : '>= 4.0.3'
gem 'rspec', '~> 3.9.0'
gem 'shoulda-context', RUBY_VERSION < '1.9' ? '= 1.2.1' : '>= 1.2.1'
gem 'simplecov', RUBY_VERSION < '2.7' ? '~> 0.17.1' : '>= 0.18.5'
gem 'term-ansicolor', RUBY_VERSION < '2.0' ? '~> 1.3.2' : '>= 1.3.2'
gem 'test-unit', RUBY_VERSION < '1.9' ? '~> 2.0' : '>= 3.0'
gem 'tins', RUBY_VERSION < '2.0' ? '~> 1.6.0' : '>= 1.6.0'
gem 'shoulda-context', '>= 1.2.1'
gem 'simplecov', RUBY_VERSION < '2.7' ? '~> 0.17.1' : '>= 0.18.5'
gem 'term-ansicolor', '>= 1.3.2'
gem 'test-unit', '>= 3.0'
gem 'tins', '>= 1.6.0'
end
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You put your code in, and you get it back colored; Keywords, strings, floats, co

### Dependencies

CodeRay needs Ruby 1.8.7, 1.9.3 or 2.0+. It also runs on JRuby.
CodeRay needs Ruby 2.4+. It also runs on JRuby.

## Example Usage

Expand Down
2 changes: 1 addition & 1 deletion README_INDEX.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ floats, comments - all in different colors. And with line numbers.

=== Dependencies

CodeRay needs Ruby 1.8.7+ or 1.9.2+. It also runs on Rubinius and JRuby.
CodeRay needs Ruby 2.4+. It also runs on Rubinius and JRuby.


== Example Usage
Expand Down
2 changes: 1 addition & 1 deletion coderay.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.license = 'MIT'

s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 1.8.6'
s.required_ruby_version = '>= 2.4.0'

readme_file = 'README_INDEX.rdoc'

Expand Down
2 changes: 1 addition & 1 deletion lib/coderay/duo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def encode code, options = {}
#
# CodeRay::Duo[:python => :yaml].call(code)
#
# or, in Ruby 1.9 and later:
# or:
#
# CodeRay::Duo[:python => :yaml].(code)
alias call encode
Expand Down
2 changes: 1 addition & 1 deletion lib/coderay/encoders/html/numbering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.number! output, mode = :table, options = {}
raise ArgumentError, 'Invalid value %p for :bolding; false or Integer expected.' % bold_every
end

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

Expand Down
2 changes: 1 addition & 1 deletion lib/coderay/scanners/java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Java < Scanner
'"' => /[^\\"]+/,
'/' => /[^\\\/]+/,
} # :nodoc:
IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : Regexp.new('[[[:alpha:]]_][[[:alnum:]]_]*') # :nodoc:
IDENT = Regexp.new('[[[:alpha:]]_][[[:alnum:]]_]*') # :nodoc:

protected

Expand Down
8 changes: 2 additions & 6 deletions rake_tasks/documentation.rake
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
begin
if RUBY_VERSION >= '1.8.7'
gem 'rdoc' if defined? gem
require 'rdoc/task'
else
require 'rake/rdoctask'
end
gem 'rdoc' if defined? gem
require 'rdoc/task'
rescue LoadError
warn 'Please gem install rdoc.'
end
Expand Down
14 changes: 3 additions & 11 deletions rake_tasks/test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,11 @@ Please rename or remove it and run again to use the GitHub repository:

desc 'test the CodeRay executable'
task :exe do
if RUBY_VERSION >= '1.8.7'
ruby './test/executable/suite.rb'
else
puts
puts "Can't run executable tests because shoulda-context requires Ruby 1.8.7+."
puts "Skipping."
end
ruby './test/executable/suite.rb'
end
end

if RUBY_VERSION >= '1.9'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

task :test => %w(test:functional test:units test:exe spec)
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# ...rather than:
# # => "be bigger than 2"
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end if RUBY_VERSION >= '1.9'
end

# rspec-mocks config goes here. You can use an alternate test double
# library (such as bogus or mocha) by changing the `mock_with` option here.
Expand Down
2 changes: 1 addition & 1 deletion test/executable/suite.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'simplecov' if RUBY_VERSION >= '1.9'
require 'simplecov'
require 'test/unit'
require 'rubygems' unless defined? Gem
require 'shoulda-context'
Expand Down
4 changes: 2 additions & 2 deletions test/functional/for_redcloth.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'simplecov' if RUBY_VERSION >= '1.9'
require 'simplecov'
require 'test/unit'

$:.unshift File.expand_path('../../../lib', __FILE__)
Expand Down Expand Up @@ -76,4 +76,4 @@ def test_for_redcloth_false_positive
BLOCKCODE
end

end if defined? RedCloth
end if defined? RedCloth
2 changes: 1 addition & 1 deletion test/functional/suite.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'simplecov' if RUBY_VERSION >= '1.9'
require 'simplecov'
require 'test/unit'

$VERBOSE = $CODERAY_DEBUG = true
Expand Down
2 changes: 0 additions & 2 deletions test/lib/README

This file was deleted.

Loading