diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2019-11-24 01:29:32 +0100 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2019-11-24 01:29:32 +0100 |
commit | c7e3b31f405b3669d823bda2f0f0ec3df64fdf2d (patch) | |
tree | 5ce13ad45a912d52514015f65f10b59dd7f6ba2b | |
parent | 62f69934f2508a25df988157925667d5efd8549e (diff) | |
parent | 9907f88568691916e4a869bc44126de8040a274d (diff) | |
download | coderay-c7e3b31f405b3669d823bda2f0f0ec3df64fdf2d.tar.gz |
Merge branch 'master' into fix-javascript-regexp
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Changes.textile | 6 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | README.markdown | 1 | ||||
-rw-r--r-- | lib/coderay/encoders/html/output.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/java.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/sql.rb | 2 | ||||
-rw-r--r-- | lib/coderay/tokens.rb | 3 | ||||
-rw-r--r-- | test/unit/filter.rb | 2 |
9 files changed, 15 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml index 49829cd..c1fa23a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ rvm: - 2.3 - 2.4.2 - 2.5 + - 2.6 - ruby-head - jruby branches: @@ -20,7 +21,6 @@ before_script: - if (ruby -e "exit RUBY_VERSION.to_f >= 2.3"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT matrix: allow_failures: - - rvm: 2.5 - rvm: ruby-head - rvm: jruby script: "rake test" # test:scanners" diff --git a/Changes.textile b/Changes.textile index 37de4ac..99b79c8 100644 --- a/Changes.textile +++ b/Changes.textile @@ -2,6 +2,12 @@ h1=. CodeRay Version History p=. _This files lists all changes in the CodeRay library since the 0.9.8 release._ +h2. Changes in 1.1.3 + +* Tokens: Ensure Ruby 2.6 compatibility. [#233, thanks to Jun Aruga] +* SQL scanner: Add @numeric@ data type. [#223, thanks to m16a1] +* Java scanner: Add @var@ as type. [#229, thanks to Davide Angelocola] + h2. Changes in 1.1.2 * Ruby future: Add support for frozen string literals. [#211, thanks to Pat Allan] @@ -14,5 +14,5 @@ group :development do gem 'shoulda-context', RUBY_VERSION < '1.9' ? '= 1.2.1' : '>= 1.2.1' gem 'test-unit', RUBY_VERSION < '1.9' ? '~> 2.0' : '>= 3.0' gem 'json', '>= 1.8' if RUBY_VERSION < '1.9' - gem 'rdoc', RUBY_VERSION < '1.9' ? '~> 4.2.2' : '>= 4.2.2' + 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' end diff --git a/README.markdown b/README.markdown index c3f7106..1402fe1 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,6 @@ [](https://travis-ci.org/rubychan/coderay) [](https://badge.fury.io/rb/coderay) -[](https://gemnasium.com/rubychan/coderay) ## About diff --git a/lib/coderay/encoders/html/output.rb b/lib/coderay/encoders/html/output.rb index de6f6ea..ee87fea 100644 --- a/lib/coderay/encoders/html/output.rb +++ b/lib/coderay/encoders/html/output.rb @@ -76,8 +76,6 @@ module Encoders apply_title! title end self - when nil - return self else raise "Unknown value %p for :wrap" % element end diff --git a/lib/coderay/scanners/java.rb b/lib/coderay/scanners/java.rb index 982a796..a490ec6 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -20,7 +20,7 @@ module Scanners MAGIC_VARIABLES = %w[ this super ] # :nodoc: TYPES = %w[ boolean byte char class double enum float int interface long - short void + short void var ] << '[]' # :nodoc: because int[] should be highlighted as a type DIRECTIVES = %w[ abstract extends final implements native private protected public diff --git a/lib/coderay/scanners/sql.rb b/lib/coderay/scanners/sql.rb index 7d57f77..c8725a8 100644 --- a/lib/coderay/scanners/sql.rb +++ b/lib/coderay/scanners/sql.rb @@ -29,7 +29,7 @@ module Scanners char varchar varchar2 enum binary text tinytext mediumtext longtext blob tinyblob mediumblob longblob timestamp date time datetime year double decimal float int - integer tinyint mediumint bigint smallint unsigned bit + integer tinyint mediumint bigint smallint unsigned bit numeric bool boolean hex bin oct ) diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb index e7bffce..b5f78e7 100644 --- a/lib/coderay/tokens.rb +++ b/lib/coderay/tokens.rb @@ -39,6 +39,9 @@ module CodeRay # You can serialize it to a JSON string and store it in a database, pass it # around to encode it more than once, send it to other algorithms... class Tokens < Array + # Remove Array#filter that is a new alias for Array#select on Ruby 2.6, + # for method_missing called with filter method. + undef_method :filter if instance_methods.include?(:filter) # The Scanner instance that created the tokens. attr_accessor :scanner diff --git a/test/unit/filter.rb b/test/unit/filter.rb index 25dff77..6e939f3 100644 --- a/test/unit/filter.rb +++ b/test/unit/filter.rb @@ -18,6 +18,7 @@ class FilterTest < Test::Unit::TestCase tokens.text_token i.to_s, :index end assert_equal tokens, CodeRay::Encoders::Filter.new.encode_tokens(tokens) + assert_equal CodeRay::Tokens, tokens.filter.class assert_equal tokens, tokens.filter end @@ -32,6 +33,7 @@ class FilterTest < Test::Unit::TestCase tokens.end_line :index end assert_equal tokens, CodeRay::Encoders::Filter.new.encode_tokens(tokens) + assert_equal CodeRay::Tokens, tokens.filter.class assert_equal tokens, tokens.filter end |