Skip to content

Commit c7e3b31

Browse files
committed
Merge branch 'master' into fix-javascript-regexp
2 parents 62f6993 + 9907f88 commit c7e3b31

File tree

9 files changed

+15
-7
lines changed

9 files changed

+15
-7
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ rvm:
1111
- 2.3
1212
- 2.4.2
1313
- 2.5
14+
- 2.6
1415
- ruby-head
1516
- jruby
1617
branches:
@@ -20,7 +21,6 @@ before_script:
2021
- if (ruby -e "exit RUBY_VERSION.to_f >= 2.3"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT
2122
matrix:
2223
allow_failures:
23-
- rvm: 2.5
2424
- rvm: ruby-head
2525
- rvm: jruby
2626
script: "rake test" # test:scanners"

Changes.textile

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ h1=. CodeRay Version History
22

33
p=. _This files lists all changes in the CodeRay library since the 0.9.8 release._
44

5+
h2. Changes in 1.1.3
6+
7+
* Tokens: Ensure Ruby 2.6 compatibility. [#233, thanks to Jun Aruga]
8+
* SQL scanner: Add @numeric@ data type. [#223, thanks to m16a1]
9+
* Java scanner: Add @var@ as type. [#229, thanks to Davide Angelocola]
10+
511
h2. Changes in 1.1.2
612

713
* Ruby future: Add support for frozen string literals. [#211, thanks to Pat Allan]

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ group :development do
1414
gem 'shoulda-context', RUBY_VERSION < '1.9' ? '= 1.2.1' : '>= 1.2.1'
1515
gem 'test-unit', RUBY_VERSION < '1.9' ? '~> 2.0' : '>= 3.0'
1616
gem 'json', '>= 1.8' if RUBY_VERSION < '1.9'
17-
gem 'rdoc', RUBY_VERSION < '1.9' ? '~> 4.2.2' : '>= 4.2.2'
17+
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'
1818
end

README.markdown

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![Build Status](https://travis-ci.org/rubychan/coderay.svg?branch=master)](https://travis-ci.org/rubychan/coderay)
44
[![Gem Version](https://badge.fury.io/rb/coderay.svg)](https://badge.fury.io/rb/coderay)
5-
[![Dependency Status](https://gemnasium.com/rubychan/coderay.svg)](https://gemnasium.com/rubychan/coderay)
65

76
## About
87

lib/coderay/encoders/html/output.rb

-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ def wrap! element, *args
7676
apply_title! title
7777
end
7878
self
79-
when nil
80-
return self
8179
else
8280
raise "Unknown value %p for :wrap" % element
8381
end

lib/coderay/scanners/java.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Java < Scanner
2020
MAGIC_VARIABLES = %w[ this super ] # :nodoc:
2121
TYPES = %w[
2222
boolean byte char class double enum float int interface long
23-
short void
23+
short void var
2424
] << '[]' # :nodoc: because int[] should be highlighted as a type
2525
DIRECTIVES = %w[
2626
abstract extends final implements native private protected public

lib/coderay/scanners/sql.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SQL < Scanner
2929
char varchar varchar2 enum binary text tinytext mediumtext
3030
longtext blob tinyblob mediumblob longblob timestamp
3131
date time datetime year double decimal float int
32-
integer tinyint mediumint bigint smallint unsigned bit
32+
integer tinyint mediumint bigint smallint unsigned bit numeric
3333
bool boolean hex bin oct
3434
)
3535

lib/coderay/tokens.rb

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ module CodeRay
3939
# You can serialize it to a JSON string and store it in a database, pass it
4040
# around to encode it more than once, send it to other algorithms...
4141
class Tokens < Array
42+
# Remove Array#filter that is a new alias for Array#select on Ruby 2.6,
43+
# for method_missing called with filter method.
44+
undef_method :filter if instance_methods.include?(:filter)
4245

4346
# The Scanner instance that created the tokens.
4447
attr_accessor :scanner

test/unit/filter.rb

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def test_filtering_text_tokens
1818
tokens.text_token i.to_s, :index
1919
end
2020
assert_equal tokens, CodeRay::Encoders::Filter.new.encode_tokens(tokens)
21+
assert_equal CodeRay::Tokens, tokens.filter.class
2122
assert_equal tokens, tokens.filter
2223
end
2324

@@ -32,6 +33,7 @@ def test_filtering_block_tokens
3233
tokens.end_line :index
3334
end
3435
assert_equal tokens, CodeRay::Encoders::Filter.new.encode_tokens(tokens)
36+
assert_equal CodeRay::Tokens, tokens.filter.class
3537
assert_equal tokens, tokens.filter
3638
end
3739

0 commit comments

Comments
 (0)