From 913c1665970ffa4e1da79470fa732aa924569ec0 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Mon, 27 Aug 2018 15:02:30 +0200 Subject: Remove the statement that is not always reached. --- lib/coderay/encoders/html/output.rb | 2 -- 1 file changed, 2 deletions(-) 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 -- cgit v1.2.1 From acf422a444813a84a952b39a569bc0f26c77c5a5 Mon Sep 17 00:00:00 2001 From: Davide Angelocola Date: Sun, 30 Sep 2018 10:13:54 +0200 Subject: support for special type 'var' --- lib/coderay/scanners/java.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1 From dc767fca8ae78cf5760d3bf1d7e7150fde6c5951 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Thu, 14 Feb 2019 15:17:56 +0100 Subject: Add Ruby 2.6 fixing issues * Remove existing Tokens#filter (Array#filter) for Ruby 2.6 compatibility. * Install proper version's rdoc considering installed Ruby version. --- .travis.yml | 2 +- Gemfile | 2 +- lib/coderay/tokens.rb | 3 +++ test/unit/filter.rb | 2 ++ 4 files changed, 7 insertions(+), 2 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/Gemfile b/Gemfile index 530c0e8..c19ac08 100644 --- a/Gemfile +++ b/Gemfile @@ -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/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 -- cgit v1.2.1 From 80a33fcfcf3a46afb1541c464742edf4bf1da4e8 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sat, 23 Feb 2019 15:30:07 +0100 Subject: add numeric to SQL types --- lib/coderay/scanners/sql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) -- cgit v1.2.1 From cd7f90f4f7360c231b24e06193ea3138de5a7b84 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sat, 23 Feb 2019 15:30:35 +0100 Subject: remove defunct Gemnasium badge --- README.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/README.markdown b/README.markdown index c3f7106..1402fe1 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,6 @@ [![Build Status](https://travis-ci.org/rubychan/coderay.svg?branch=master)](https://travis-ci.org/rubychan/coderay) [![Gem Version](https://badge.fury.io/rb/coderay.svg)](https://badge.fury.io/rb/coderay) -[![Dependency Status](https://gemnasium.com/rubychan/coderay.svg)](https://gemnasium.com/rubychan/coderay) ## About -- cgit v1.2.1 From 9907f88568691916e4a869bc44126de8040a274d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 24 Nov 2019 01:28:31 +0100 Subject: update changelog --- Changes.textile | 6 ++++++ 1 file changed, 6 insertions(+) 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] -- cgit v1.2.1