From 443911f134b2485f2d0b101b78342e0c0e1548fe Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 10 Jan 2017 18:38:57 +0100 Subject: Add Ruby 2.4.0 test to Travis CI. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a8080ce..4c00547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ rvm: - 2.1 - 2.2 - 2.3.0 + - 2.4.0 - ruby-head - jruby-18mode - jruby-19mode -- cgit v1.2.1 From b22fc36299faf1348f2168773b10fb1eeacfcb26 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 10 Jan 2017 19:01:40 +0100 Subject: Change license file name correctly. --- MIT-LICENSE | 22 ++++++++++++++++++++++ MIT-LICENSE.txt | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 MIT-LICENSE delete mode 100644 MIT-LICENSE.txt diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..d8d009d --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,22 @@ +Copyright (C) 2005-2012 Kornelius Kalnbach (@murphy_karasu) + +http://coderay.rubychan.de/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt deleted file mode 100644 index d8d009d..0000000 --- a/MIT-LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (C) 2005-2012 Kornelius Kalnbach (@murphy_karasu) - -http://coderay.rubychan.de/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file -- cgit v1.2.1 From 8afe8aa1ea8b6c7bcf46144977bcb45a72c997f6 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 11 Jan 2017 14:45:19 +0100 Subject: Remove executable bit for the script files with shebang. --- lib/coderay/token_kinds.rb | 0 test/functional/basic.rb | 0 test/functional/examples.rb | 0 test/functional/suite.rb | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 lib/coderay/token_kinds.rb mode change 100755 => 100644 test/functional/basic.rb mode change 100755 => 100644 test/functional/examples.rb mode change 100755 => 100644 test/functional/suite.rb diff --git a/lib/coderay/token_kinds.rb b/lib/coderay/token_kinds.rb old mode 100755 new mode 100644 diff --git a/test/functional/basic.rb b/test/functional/basic.rb old mode 100755 new mode 100644 diff --git a/test/functional/examples.rb b/test/functional/examples.rb old mode 100755 new mode 100644 diff --git a/test/functional/suite.rb b/test/functional/suite.rb old mode 100755 new mode 100644 -- cgit v1.2.1 From f38438f31319cf87fc87db71768b5902671a99f5 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:30:04 +1300 Subject: fixing tests --- .travis.yml | 4 ++-- Gemfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c00547..3a803e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ rvm: - 2.0 - 2.1 - 2.2 - - 2.3.0 - - 2.4.0 + - 2.3 + - 2.4 - ruby-head - jruby-18mode - jruby-19mode diff --git a/Gemfile b/Gemfile index 592b79f..d849d68 100644 --- a/Gemfile +++ b/Gemfile @@ -9,10 +9,10 @@ group :development do gem "bundler" gem "rake", "~> 10.5" gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3" - gem "term-ansicolor" + gem "term-ansicolor", "~> 1.3.2" gem 'tins', '~> 1.6.0' gem "shoulda-context" gem "test-unit" - gem "json" if RUBY_VERSION < '1.9' + gem "json", "~> 1.8" if RUBY_VERSION < '1.9' gem "rdoc" end -- cgit v1.2.1 From 294183efae11e1a002cd455480e4dde8301f6b1e Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:35:33 +1300 Subject: fixing tests... --- .travis.yml | 4 ++-- Gemfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a803e3..dc228fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ rvm: - 2.0 - 2.1 - 2.2 - - 2.3 - - 2.4 + - 2.3.3 + - 2.4.0 - ruby-head - jruby-18mode - jruby-19mode diff --git a/Gemfile b/Gemfile index d849d68..c4463a9 100644 --- a/Gemfile +++ b/Gemfile @@ -14,5 +14,5 @@ group :development do gem "shoulda-context" gem "test-unit" gem "json", "~> 1.8" if RUBY_VERSION < '1.9' - gem "rdoc" + gem "rdoc", "~> 4.2.2" end -- cgit v1.2.1 From 6f9b2b8eb356327fa73e3e1d6c4ce18420f9db2a Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:38:46 +1300 Subject: downgrade shoulda-context --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index c4463a9..8710555 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ group :development do gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3" gem "term-ansicolor", "~> 1.3.2" gem 'tins', '~> 1.6.0' - gem "shoulda-context" + gem "shoulda-context", "= 1.2.1" gem "test-unit" gem "json", "~> 1.8" if RUBY_VERSION < '1.9' gem "rdoc", "~> 4.2.2" -- cgit v1.2.1 From 6734fffd1c7fd951ecae0bb7a2b228a0b24c833a Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:42:07 +1300 Subject: only test with latest JRuby and Rubinius --- .travis.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc228fc..75a57bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,19 +11,15 @@ rvm: - 2.3.3 - 2.4.0 - ruby-head - - jruby-18mode - - jruby-19mode - - jruby-head - - rbx-2 + - jruby + - rbx branches: only: - master matrix: allow_failures: - rvm: ruby-head - - rvm: jruby-18mode - - rvm: jruby-19mode - - rvm: jruby-head - - rvm: rbx-2 + - rvm: jruby + - rvm: rbx script: "rake test" # test:scanners" sudo: false -- cgit v1.2.1 From 6b3df316a81e94ca7336f75d82bb1da6c10de9f7 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:46:11 +1300 Subject: does this version work with JRuby? --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 8710555..f631cbe 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gemspec group :development do gem "bundler" gem "rake", "~> 10.5" - gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3" + gem "RedCloth", RUBY_PLATFORM == 'java' ? "= 4.2.9" : ">= 4.0.3" gem "term-ansicolor", "~> 1.3.2" gem 'tins', '~> 1.6.0' gem "shoulda-context", "= 1.2.1" -- cgit v1.2.1 From 06f6ec4702c47fb5b7d654c477461a532062d742 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Sun, 15 Jan 2017 14:24:49 +0100 Subject: Remote test files and Rakefile from gem distribution. This fixes #205. --- coderay.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/coderay.gemspec b/coderay.gemspec index 328b94c..50c195b 100644 --- a/coderay.gemspec +++ b/coderay.gemspec @@ -24,8 +24,7 @@ Gem::Specification.new do |s| readme_file = 'README_INDEX.rdoc' - s.files = `git ls-files -- lib/* test/functional/* Rakefile #{readme_file} MIT-LICENSE`.split("\n") - s.test_files = `git ls-files -- test/functional/*`.split("\n") + s.files = `git ls-files -- lib/* #{readme_file} MIT-LICENSE`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } s.require_paths = ['lib'] -- cgit v1.2.1 From 457ffbf3ee02b1b6f57eacb33df44c80f4bf9d71 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 9 Apr 2017 18:40:31 +0200 Subject: allow "-" in Haml tags --- Changes.textile | 1 + lib/coderay/scanners/haml.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes.textile b/Changes.textile index d77cff2..6b44854 100644 --- a/Changes.textile +++ b/Changes.textile @@ -5,6 +5,7 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release h2. Changes in 1.1.2 * C++ scanner: Added C++11 keywords. [#195, thanks to Johnny Willemsen] +* Haml scanner: Allow @-@ in tags. h2. Changes in 1.1.1 diff --git a/lib/coderay/scanners/haml.rb b/lib/coderay/scanners/haml.rb index 5433790..d516ba9 100644 --- a/lib/coderay/scanners/haml.rb +++ b/lib/coderay/scanners/haml.rb @@ -75,7 +75,7 @@ module Scanners tag = false - if match = scan(/%[\w:]+\/?/) + if match = scan(/%[-\w:]+\/?/) encoder.text_token match, :tag # if match = scan(/( +)(.+)/) # encoder.text_token self[1], :space -- cgit v1.2.1 From 761234f380b3e42c283e82d784826bae280f9075 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Wed, 28 Jun 2017 10:36:18 +1000 Subject: Get tests running with frozen string literals. --- lib/coderay/encoders/encoder.rb | 2 +- lib/coderay/encoders/html.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/coderay/encoders/encoder.rb b/lib/coderay/encoders/encoder.rb index fa5695d..2baeedb 100644 --- a/lib/coderay/encoders/encoder.rb +++ b/lib/coderay/encoders/encoder.rb @@ -146,7 +146,7 @@ module CodeRay end def get_output options - options[:out] || '' + options[:out] || ''.dup end # Append data.to_s to the output. Returns the argument. diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb index 942b9c8..1b33e92 100644 --- a/lib/coderay/encoders/html.rb +++ b/lib/coderay/encoders/html.rb @@ -176,7 +176,7 @@ module Encoders if options[:wrap] || options[:line_numbers] @real_out = @out - @out = '' + @out = ''.dup end @break_lines = (options[:break_lines] == true) @@ -314,7 +314,7 @@ module Encoders end def break_lines text, style - reopen = '' + reopen = ''.dup @opened.each_with_index do |kind, index| reopen << (@span_for_kinds[index > 0 ? [kind, *@opened[0...index]] : kind] || '') end -- cgit v1.2.1 From eccb20a661eaed79cbd987a524579da92edcbf9c Mon Sep 17 00:00:00 2001 From: t-gergely Date: Tue, 4 Jul 2017 17:01:52 +0200 Subject: allow for non-ASCII identifiers --- 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 962154e..b40d4a6 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ module Scanners '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :nodoc: - IDENT = /[a-zA-Z_][A-Za-z_0-9]*/ # :nodoc: + IDENT = /[\p{L}_][\p{L}_0-9]*/ # :nodoc: protected -- cgit v1.2.1 From e94b1a91ce85306622f03996792d3665a675d69d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 7 Jul 2017 08:39:43 +0200 Subject: ensure that all string literals can be frozen (thanks, @pat) --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 75a57bb..a486c23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ rvm: branches: only: - master +before_script: +- if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT matrix: allow_failures: - rvm: ruby-head -- cgit v1.2.1 From ef5e2611d6a937fab885eb18a0c6ac5906e65ee8 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 7 Jul 2017 08:41:07 +0200 Subject: update Ruby minor versions --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a486c23..96233c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ rvm: - 2.0 - 2.1 - 2.2 - - 2.3.3 - - 2.4.0 + - 2.3 + - 2.4 - ruby-head - jruby - rbx -- cgit v1.2.1 From eb3f281428d59760271c757287066d39430449ae Mon Sep 17 00:00:00 2001 From: t-gergely Date: Fri, 7 Jul 2017 10:45:30 +0200 Subject: compatibility with Ruby < 2 As requested by korny. Thanks. --- 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 b40d4a6..5fde433 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ module Scanners '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :nodoc: - IDENT = /[\p{L}_][\p{L}_0-9]*/ # :nodoc: + IDENT = /[[[:alpha:]]_][[[:alnum:]]_]*/ # :nodoc: protected -- cgit v1.2.1 From 0bea645c30a10b0e0c2949d629ec0d1932861c90 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:05:27 +0200 Subject: don't test on rubinius anymore --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 96233c6..2c90b18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ rvm: - 2.4 - ruby-head - jruby - - rbx branches: only: - master -- cgit v1.2.1 From 931ee0a74ba13049e452fb6c6d594750768cb908 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:32:22 +0200 Subject: don't try to run RedCloth tests with frozen string literals (they fail) --- rake_tasks/test.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rake_tasks/test.rake b/rake_tasks/test.rake index b15b999..1a23a5b 100644 --- a/rake_tasks/test.rake +++ b/rake_tasks/test.rake @@ -2,7 +2,7 @@ namespace :test do desc 'run functional tests' task :functional do ruby './test/functional/suite.rb' - ruby './test/functional/for_redcloth.rb' + ruby './test/functional/for_redcloth.rb' unless (''.chop! rescue true) end desc 'run unit tests' -- cgit v1.2.1 From c3473412188de4349a5cae4d4a4dc73ceac9e36f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:32:34 +0200 Subject: update changelog --- Changes.textile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes.textile b/Changes.textile index 6b44854..f984610 100644 --- a/Changes.textile +++ b/Changes.textile @@ -4,7 +4,8 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release h2. Changes in 1.1.2 -* C++ scanner: Added C++11 keywords. [#195, thanks to Johnny Willemsen] +* Ruby future: Add support for frozen string literals. [#211, thanks to Pat Allan] +* C++ scanner: Add C++11 keywords. [#195, thanks to Johnny Willemsen] * Haml scanner: Allow @-@ in tags. h2. Changes in 1.1.1 -- cgit v1.2.1 From 860c2e132d2eed2b10285276fb6d1ca509f56cdc Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:34:33 +0200 Subject: flag is available since Ruby 2.3 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2c90b18..b99c95e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ branches: only: - master before_script: -- if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT +- if (ruby -e "exit RUBY_VERSION.to_f >= 2.3"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT matrix: allow_failures: - rvm: ruby-head -- cgit v1.2.1 From d4d27b2f9b090291f0e85b82f94b6e3bf266256d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:47:15 +0200 Subject: update changelog --- Changes.textile | 1 + 1 file changed, 1 insertion(+) diff --git a/Changes.textile b/Changes.textile index f984610..37de4ac 100644 --- a/Changes.textile +++ b/Changes.textile @@ -7,6 +7,7 @@ h2. Changes in 1.1.2 * Ruby future: Add support for frozen string literals. [#211, thanks to Pat Allan] * C++ scanner: Add C++11 keywords. [#195, thanks to Johnny Willemsen] * Haml scanner: Allow @-@ in tags. +* Java scanner: Allow Unicode characters in identifiers. [#212, thanks to t-gergely] h2. Changes in 1.1.1 -- cgit v1.2.1 From f16a659e503171024924d64feb1d478dd2527e39 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:47:23 +0200 Subject: update development gems --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index f631cbe..89cd72b 100644 --- a/Gemfile +++ b/Gemfile @@ -7,10 +7,10 @@ gemspec # Include everything needed to run rake, tests, features, etc. group :development do gem "bundler" - gem "rake", "~> 10.5" + gem "rake", ">= 10.5" gem "RedCloth", RUBY_PLATFORM == 'java' ? "= 4.2.9" : ">= 4.0.3" gem "term-ansicolor", "~> 1.3.2" - gem 'tins', '~> 1.6.0' + gem 'tins', '>= 1.6.0' gem "shoulda-context", "= 1.2.1" gem "test-unit" gem "json", "~> 1.8" if RUBY_VERSION < '1.9' -- cgit v1.2.1 From 436c1a48074d786a542bf59ea2ea2da69cb121b9 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:49:32 +0200 Subject: update more gems --- Gemfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 89cd72b..f07e274 100644 --- a/Gemfile +++ b/Gemfile @@ -9,10 +9,10 @@ group :development do gem "bundler" gem "rake", ">= 10.5" gem "RedCloth", RUBY_PLATFORM == 'java' ? "= 4.2.9" : ">= 4.0.3" - gem "term-ansicolor", "~> 1.3.2" + gem "term-ansicolor", ">= 1.3.2" gem 'tins', '>= 1.6.0' - gem "shoulda-context", "= 1.2.1" + gem "shoulda-context", ">= 1.2.1" gem "test-unit" - gem "json", "~> 1.8" if RUBY_VERSION < '1.9' - gem "rdoc", "~> 4.2.2" + gem "json", ">= 1.8" if RUBY_VERSION < '1.9' + gem "rdoc", ">= 4.2.2" end -- cgit v1.2.1 From 6f95c964d94a35b306e8086018917d16d7adc9ca Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:01:37 +0200 Subject: restore support for Ruby 1.8.7 --- Gemfile | 18 +++++++++--------- lib/coderay/scanners/java.rb | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index f07e274..951e3d1 100644 --- a/Gemfile +++ b/Gemfile @@ -6,13 +6,13 @@ gemspec # Add dependencies to develop your gem here. # Include everything needed to run rake, tests, features, etc. group :development do - gem "bundler" - gem "rake", ">= 10.5" - gem "RedCloth", RUBY_PLATFORM == 'java' ? "= 4.2.9" : ">= 4.0.3" - gem "term-ansicolor", ">= 1.3.2" - gem 'tins', '>= 1.6.0' - gem "shoulda-context", ">= 1.2.1" - gem "test-unit" - gem "json", ">= 1.8" if RUBY_VERSION < '1.9' - gem "rdoc", ">= 4.2.2" + gem 'bundler' + gem 'rake', RUBY_VERSION < '1.9' ? '~> 10.5' : '>= 10.5' + gem 'RedCloth', RUBY_PLATFORM == 'java' ? '= 4.2.9' : '>= 4.0.3' + gem 'term-ansicolor', '>= 1.3.2' + gem 'tins', RUBY_VERSION < '2.0' ? '~> 1.6.0' : '>= 1.6.0' + 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' end diff --git a/lib/coderay/scanners/java.rb b/lib/coderay/scanners/java.rb index 5fde433..3ac7efe 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ module Scanners '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :nodoc: - IDENT = /[[[:alpha:]]_][[[:alnum:]]_]*/ # :nodoc: + IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : /[[[:alpha:]]_][[[:alnum:]]_]*/ # :nodoc: protected -- cgit v1.2.1 From 51ee233e72d5165f480ccad94487d995b3b2280f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:07:04 +0200 Subject: don't change benchmark rules --- bench/bench.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/bench.rb b/bench/bench.rb index 34ea9f9..a47721e 100644 --- a/bench/bench.rb +++ b/bench/bench.rb @@ -15,7 +15,7 @@ raise 'Example file is empty.' if data.empty? format = ARGV.fetch(1, 'html').downcase encoder = CodeRay.encoder(format) -size = ARGV.fetch(2, 2000).to_i * 1000 +size = ARGV.fetch(2, 3000).to_i * 1000 unless size.zero? data += data until data.size >= size data = data[0, size] -- cgit v1.2.1 From 44a4f08fb3a5ee07a85557ff0d7f38fa54105d2b Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:12:52 +0200 Subject: fixing gems for Ruby 1.9 --- Gemfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 951e3d1..530c0e8 100644 --- a/Gemfile +++ b/Gemfile @@ -7,12 +7,12 @@ gemspec # Include everything needed to run rake, tests, features, etc. group :development do gem 'bundler' - gem 'rake', RUBY_VERSION < '1.9' ? '~> 10.5' : '>= 10.5' - gem 'RedCloth', RUBY_PLATFORM == 'java' ? '= 4.2.9' : '>= 4.0.3' - gem 'term-ansicolor', '>= 1.3.2' - gem 'tins', RUBY_VERSION < '2.0' ? '~> 1.6.0' : '>= 1.6.0' - 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 'rake', RUBY_VERSION < '1.9' ? '~> 10.5' : '>= 10.5' + gem 'RedCloth', RUBY_PLATFORM == 'java' ? '= 4.2.9' : '>= 4.0.3' + gem 'term-ansicolor', RUBY_VERSION < '2.0' ? '~> 1.3.2' : '>= 1.3.2' + gem 'tins', RUBY_VERSION < '2.0' ? '~> 1.6.0' : '>= 1.6.0' + 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', RUBY_VERSION < '1.9' ? '~> 4.2.2' : '>= 4.2.2' end -- cgit v1.2.1 From 1632c66c81b9fde52df23bbbe0bbeea077a9c5dc Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:18:11 +0200 Subject: avoid regexp syntax warnings on Ruby 1.8 --- 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 3ac7efe..982a796 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ module Scanners '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :nodoc: - IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : /[[[:alpha:]]_][[[:alnum:]]_]*/ # :nodoc: + IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : Regexp.new('[[[:alpha:]]_][[[:alnum:]]_]*') # :nodoc: protected -- cgit v1.2.1 From e15cf96405177153e1418496a7a8e85beaa679fb Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:18:21 +0200 Subject: bump version to 1.1.2 --- lib/coderay/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/coderay/version.rb b/lib/coderay/version.rb index 7ea3f70..f5e7a39 100644 --- a/lib/coderay/version.rb +++ b/lib/coderay/version.rb @@ -1,3 +1,3 @@ module CodeRay - VERSION = '1.1.1' + VERSION = '1.1.2' end -- cgit v1.2.1