File tree 4 files changed +7
-2
lines changed
4 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11
11
- 2.3
12
12
- 2.4.2
13
13
- 2.5
14
+ - 2.6
14
15
- ruby-head
15
16
- jruby
16
17
branches :
@@ -20,7 +21,6 @@ before_script:
20
21
- if (ruby -e "exit RUBY_VERSION.to_f >= 2.3"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT
21
22
matrix :
22
23
allow_failures :
23
- - rvm : 2.5
24
24
- rvm : ruby-head
25
25
- rvm : jruby
26
26
script : " rake test" # test:scanners"
Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ group :development do
14
14
gem 'shoulda-context' , RUBY_VERSION < '1.9' ? '= 1.2.1' : '>= 1.2.1'
15
15
gem 'test-unit' , RUBY_VERSION < '1.9' ? '~> 2.0' : '>= 3.0'
16
16
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 '
18
18
end
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ module CodeRay
39
39
# You can serialize it to a JSON string and store it in a database, pass it
40
40
# around to encode it more than once, send it to other algorithms...
41
41
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 )
42
45
43
46
# The Scanner instance that created the tokens.
44
47
attr_accessor :scanner
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ def test_filtering_text_tokens
18
18
tokens . text_token i . to_s , :index
19
19
end
20
20
assert_equal tokens , CodeRay ::Encoders ::Filter . new . encode_tokens ( tokens )
21
+ assert_equal CodeRay ::Tokens , tokens . filter . class
21
22
assert_equal tokens , tokens . filter
22
23
end
23
24
@@ -32,6 +33,7 @@ def test_filtering_block_tokens
32
33
tokens . end_line :index
33
34
end
34
35
assert_equal tokens , CodeRay ::Encoders ::Filter . new . encode_tokens ( tokens )
36
+ assert_equal CodeRay ::Tokens , tokens . filter . class
35
37
assert_equal tokens , tokens . filter
36
38
end
37
39
You can’t perform that action at this time.
0 commit comments