From f06e0e319e13e0e4f1f90a7bdf634bc1ca66b182 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 10 Mar 2016 14:06:48 +0100 Subject: [PATCH 01/42] Add C++11 keywords * lib/coderay/scanners/cpp.rb: --- lib/coderay/scanners/cpp.rb | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/coderay/scanners/cpp.rb b/lib/coderay/scanners/cpp.rb index e61f56f4..b0ffc068 100644 --- a/lib/coderay/scanners/cpp.rb +++ b/lib/coderay/scanners/cpp.rb @@ -2,14 +2,14 @@ module CodeRay module Scanners # Scanner for C++. - # + # # Aliases: +cplusplus+, c++ class CPlusPlus < Scanner register_for :cpp file_extension 'cpp' title 'C++' - + #-- http://www.cppreference.com/wiki/keywords/start KEYWORDS = [ 'and', 'and_eq', 'asm', 'bitand', 'bitor', 'break', @@ -17,14 +17,15 @@ class CPlusPlus < Scanner 'continue', 'default', 'delete', 'do', 'dynamic_cast', 'else', 'enum', 'export', 'for', 'goto', 'if', 'namespace', 'new', 'not', 'not_eq', 'or', 'or_eq', 'reinterpret_cast', 'return', - 'sizeof', 'static_cast', 'struct', 'switch', 'template', - 'throw', 'try', 'typedef', 'typeid', 'typename', 'union', + 'sizeof', 'static_assert', 'static_cast', 'struct', 'switch', + 'template', 'throw', 'try', 'typedef', 'typeid', 'typename', 'union', 'while', 'xor', 'xor_eq', ] # :nodoc: - + PREDEFINED_TYPES = [ - 'bool', 'char', 'double', 'float', 'int', 'long', - 'short', 'signed', 'unsigned', 'wchar_t', 'string', + 'bool', 'char', 'char16_t', 'char32_t', 'double', 'float', + 'int', 'long', 'nullptr' 'short', 'signed', 'unsigned', + 'wchar_t', 'string', ] # :nodoc: PREDEFINED_CONSTANTS = [ 'false', 'true', @@ -34,11 +35,12 @@ class CPlusPlus < Scanner 'this', ] # :nodoc: DIRECTIVES = [ - 'auto', 'const', 'explicit', 'extern', 'friend', 'inline', 'mutable', 'operator', - 'private', 'protected', 'public', 'register', 'static', 'using', 'virtual', 'void', - 'volatile', + 'alignas', 'alignof', 'auto', 'const', 'constexpr', 'decltype', 'explicit', + 'extern', 'final', 'friend', 'inline', 'mutable', 'noexcept', 'operator', + 'override', 'private', 'protected', 'public', 'register', 'static', + 'thread_local', 'using', 'virtual', 'void', 'volatile', ] # :nodoc: - + IDENT_KIND = WordList.new(:ident). add(KEYWORDS, :keyword). add(PREDEFINED_TYPES, :predefined_type). @@ -48,9 +50,9 @@ class CPlusPlus < Scanner ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc: UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc: - + protected - + def scan_tokens encoder, options state = :initial @@ -107,7 +109,7 @@ def scan_tokens encoder, options elsif match = scan(/\$/) encoder.text_token match, :ident - + elsif match = scan(/L?"/) encoder.begin_group :string if match[0] == ?L @@ -180,7 +182,7 @@ def scan_tokens encoder, options state = :initial end - + when :class_name_expected if match = scan(/ [A-Za-z_][A-Za-z_0-9]* /x) encoder.text_token match, :class @@ -194,7 +196,7 @@ def scan_tokens encoder, options state = :initial end - + else raise_inspect 'Unknown state', encoder From 26127899acf888a1888195c8b50c4603167e2808 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 11 Mar 2016 08:04:21 +0100 Subject: [PATCH 02/42] Fixed typo * FOLDERS: --- FOLDERS | 96 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/FOLDERS b/FOLDERS index f29255ae..1709d08a 100644 --- a/FOLDERS +++ b/FOLDERS @@ -1,48 +1,48 @@ -= CodeRay - folder structure - -== bench - Benchmarking system - -All benchmarking stuff goes here. - -Test inputs are stored in files named example.. -Test outputs go to bench/test.. - -Run bench/bench.rb to get a usage description. - -Run rake bench to perform an example benchmark. - - -== bin - Scripts - -Executional files for CodeRay. - -coderay:: The CodeRay executable. - -== demo - Demos and functional tests - -Demonstrational scripts to show of CodeRay's features. - -Run them as functional tests with rake test:demos. - - -== etc - Lots of stuff - -Some addidtional files for CodeRay, mainly graphics and Vim scripts. - - -== lib - CodeRay library code - -This is the base directory for the CodeRay library. - - -== rake_helpers - Rake helper libraries - -Some files to enhance Rake, including the Autumnal Rdoc template and some scripts. - - -== test - Tests - -In the subfolder scanners/ are the scanners tests. -Each language has its own subfolder and sub-suite. - -Run with rake test. += CodeRay - folder structure + +== bench - Benchmarking system + +All benchmarking stuff goes here. + +Test inputs are stored in files named example.. +Test outputs go to bench/test.. + +Run bench/bench.rb to get a usage description. + +Run rake bench to perform an example benchmark. + + +== bin - Scripts + +Executional files for CodeRay. + +coderay:: The CodeRay executable. + +== demo - Demos and functional tests + +Demonstrational scripts to show of CodeRay's features. + +Run them as functional tests with rake test:demos. + + +== etc - Lots of stuff + +Some additional files for CodeRay, mainly graphics and Vim scripts. + + +== lib - CodeRay library code + +This is the base directory for the CodeRay library. + + +== rake_helpers - Rake helper libraries + +Some files to enhance Rake, including the Autumnal Rdoc template and some scripts. + + +== test - Tests + +In the subfolder scanners/ are the scanners tests. +Each language has its own subfolder and sub-suite. + +Run with rake test. From 92a8e56ccd8d3aee05db9c7a821b24382528c674 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Sun, 13 Mar 2016 11:47:46 +0100 Subject: [PATCH 03/42] Small changes to grouping of new C++11 keywords * lib/coderay/scanners/cpp.rb: --- lib/coderay/scanners/cpp.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/coderay/scanners/cpp.rb b/lib/coderay/scanners/cpp.rb index b0ffc068..50a25b7a 100644 --- a/lib/coderay/scanners/cpp.rb +++ b/lib/coderay/scanners/cpp.rb @@ -15,7 +15,7 @@ class CPlusPlus < Scanner 'and', 'and_eq', 'asm', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'compl', 'const_cast', 'continue', 'default', 'delete', 'do', 'dynamic_cast', 'else', - 'enum', 'export', 'for', 'goto', 'if', 'namespace', 'new', + 'enum', 'export', 'final', 'for', 'goto', 'if', 'namespace', 'new', 'not', 'not_eq', 'or', 'or_eq', 'reinterpret_cast', 'return', 'sizeof', 'static_assert', 'static_cast', 'struct', 'switch', 'template', 'throw', 'try', 'typedef', 'typeid', 'typename', 'union', @@ -24,19 +24,19 @@ class CPlusPlus < Scanner PREDEFINED_TYPES = [ 'bool', 'char', 'char16_t', 'char32_t', 'double', 'float', - 'int', 'long', 'nullptr' 'short', 'signed', 'unsigned', + 'int', 'long', 'short', 'signed', 'unsigned', 'wchar_t', 'string', ] # :nodoc: PREDEFINED_CONSTANTS = [ 'false', 'true', - 'EOF', 'NULL', + 'EOF', 'NULL', 'nullptr' ] # :nodoc: PREDEFINED_VARIABLES = [ 'this', ] # :nodoc: DIRECTIVES = [ 'alignas', 'alignof', 'auto', 'const', 'constexpr', 'decltype', 'explicit', - 'extern', 'final', 'friend', 'inline', 'mutable', 'noexcept', 'operator', + 'extern', 'friend', 'inline', 'mutable', 'noexcept', 'operator', 'override', 'private', 'protected', 'public', 'register', 'static', 'thread_local', 'using', 'virtual', 'void', 'volatile', ] # :nodoc: From cee12238d0ca5ea0d9d1ae9ef0e4dbf80fdfc0dc Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Apr 2016 09:26:02 +0200 Subject: [PATCH 04/42] fix tests for Ruby 1.8 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6d3a176f..592b79fb 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gemspec # Include everything needed to run rake, tests, features, etc. group :development do gem "bundler" - gem "rake" + gem "rake", "~> 10.5" gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3" gem "term-ansicolor" gem 'tins', '~> 1.6.0' From e94cf8ea0e342f41837c4685a45c4d2af488fe6e Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Apr 2016 11:07:02 +0200 Subject: [PATCH 05/42] fix Windows line breaks in FOLDERS file --- FOLDERS | 96 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/FOLDERS b/FOLDERS index f29255ae..81784299 100644 --- a/FOLDERS +++ b/FOLDERS @@ -1,48 +1,48 @@ -= CodeRay - folder structure - -== bench - Benchmarking system - -All benchmarking stuff goes here. - -Test inputs are stored in files named example.. -Test outputs go to bench/test.. - -Run bench/bench.rb to get a usage description. - -Run rake bench to perform an example benchmark. - - -== bin - Scripts - -Executional files for CodeRay. - -coderay:: The CodeRay executable. - -== demo - Demos and functional tests - -Demonstrational scripts to show of CodeRay's features. - -Run them as functional tests with rake test:demos. - - -== etc - Lots of stuff - -Some addidtional files for CodeRay, mainly graphics and Vim scripts. - - -== lib - CodeRay library code - -This is the base directory for the CodeRay library. - - -== rake_helpers - Rake helper libraries - -Some files to enhance Rake, including the Autumnal Rdoc template and some scripts. - - -== test - Tests - -In the subfolder scanners/ are the scanners tests. -Each language has its own subfolder and sub-suite. - -Run with rake test. += CodeRay - folder structure + +== bench - Benchmarking system + +All benchmarking stuff goes here. + +Test inputs are stored in files named example.. +Test outputs go to bench/test.. + +Run bench/bench.rb to get a usage description. + +Run rake bench to perform an example benchmark. + + +== bin - Scripts + +Executional files for CodeRay. + +coderay:: The CodeRay executable. + +== demo - Demos and functional tests + +Demonstrational scripts to show of CodeRay's features. + +Run them as functional tests with rake test:demos. + + +== etc - Lots of stuff + +Some addidtional files for CodeRay, mainly graphics and Vim scripts. + + +== lib - CodeRay library code + +This is the base directory for the CodeRay library. + + +== rake_helpers - Rake helper libraries + +Some files to enhance Rake, including the Autumnal Rdoc template and some scripts. + + +== test - Tests + +In the subfolder scanners/ are the scanners tests. +Each language has its own subfolder and sub-suite. + +Run with rake test. From 54c94b78f18939ef8517dd2818fbb699c0fa1391 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 27 May 2016 20:40:53 +0200 Subject: [PATCH 06/42] Add env setting to allow C extensions which are not allowed by default anymore by travis-ci, see https://docs.travis-ci.com/user/languages/ruby * .travis.yml: --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index f8156982..b638af12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +env: + global: + - "JRUBY_OPTS=-Xcext.enabled=true" rvm: - 1.8.7 - ree From 2bce2ac91ad7994f9ead130387c8b24905853064 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 27 May 2016 21:06:00 +0200 Subject: [PATCH 07/42] Allow failures with jruby 18 and 19 mode, RedCloth has a known problem, see https://jgarber.lighthouseapp.com/projects/13054/tickets/230-use-rbconfig-instead-of-obsolete-and-deprecated-config * .travis.yml: --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b638af12..5aa9e5f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,6 @@ rvm: - 2.2 - 2.3.0 - ruby-head - - jruby-18mode - - jruby-19mode - jruby-head - rbx-18mode - rbx-19mode @@ -24,5 +22,7 @@ matrix: - rvm: jruby-head - rvm: rbx-18mode - rvm: rbx-19mode + - rvm: jruby-18mode + - rvm: jruby-19mode script: "rake test" # test:scanners" sudo: false From cd3bffb1086420c02774ba905a403f8efe313f46 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 27 May 2016 21:07:35 +0200 Subject: [PATCH 08/42] Shouldn't have removed the jruby lines * .travis.yml: --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5aa9e5f9..498158f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ rvm: - 2.3.0 - ruby-head - jruby-head + - jruby-18mode + - jruby-19mode - rbx-18mode - rbx-19mode branches: From de2e2acd91988e6b54f50f6c44ad85f28b68c615 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 29 May 2016 23:28:43 +0200 Subject: [PATCH 09/42] tweaking list of Rubies for CI --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8156982..f3520043 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,16 +10,16 @@ rvm: - jruby-18mode - jruby-19mode - jruby-head - - rbx-18mode - - rbx-19mode + - rbx-2 branches: only: - master matrix: allow_failures: - rvm: ruby-head + - rvm: jruby-18mode + - rvm: jruby-19mode - rvm: jruby-head - - rvm: rbx-18mode - - rvm: rbx-19mode + - rvm: rbx-2 script: "rake test" # test:scanners" sudo: false From f664af2d8e9451cd03bf1d815139514bff8956d1 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 30 May 2016 08:41:30 +0200 Subject: [PATCH 10/42] Moved final from keywords to directive * lib/coderay/scanners/cpp.rb: --- lib/coderay/scanners/cpp.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coderay/scanners/cpp.rb b/lib/coderay/scanners/cpp.rb index 50a25b7a..40aeb426 100644 --- a/lib/coderay/scanners/cpp.rb +++ b/lib/coderay/scanners/cpp.rb @@ -15,7 +15,7 @@ class CPlusPlus < Scanner 'and', 'and_eq', 'asm', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'compl', 'const_cast', 'continue', 'default', 'delete', 'do', 'dynamic_cast', 'else', - 'enum', 'export', 'final', 'for', 'goto', 'if', 'namespace', 'new', + 'enum', 'export', 'for', 'goto', 'if', 'namespace', 'new', 'not', 'not_eq', 'or', 'or_eq', 'reinterpret_cast', 'return', 'sizeof', 'static_assert', 'static_cast', 'struct', 'switch', 'template', 'throw', 'try', 'typedef', 'typeid', 'typename', 'union', @@ -36,7 +36,7 @@ class CPlusPlus < Scanner ] # :nodoc: DIRECTIVES = [ 'alignas', 'alignof', 'auto', 'const', 'constexpr', 'decltype', 'explicit', - 'extern', 'friend', 'inline', 'mutable', 'noexcept', 'operator', + 'extern', 'final', 'friend', 'inline', 'mutable', 'noexcept', 'operator', 'override', 'private', 'protected', 'public', 'register', 'static', 'thread_local', 'using', 'virtual', 'void', 'volatile', ] # :nodoc: From 1ad3f9651b0cdc75b7efd819b112ffa1efa16538 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 30 May 2016 08:42:20 +0200 Subject: [PATCH 11/42] Removed merge issue * .travis.yml: --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2c7b0f4e..ea1f1c10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ rvm: - jruby-19mode - jruby-head - rbx-2 ->>>>>>> de2e2acd91988e6b54f50f6c44ad85f28b68c615 branches: only: - master From 7e330abe861bcd2b23b5ea09456335a45555530b Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 30 May 2016 08:50:49 +0200 Subject: [PATCH 12/42] Removed double line * .travis.yml: --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ea1f1c10..e04b1645 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ rvm: - jruby-head - jruby-18mode - jruby-19mode - - jruby-head - rbx-2 branches: only: From fdb27f78983cc4d4e52d887875b1a4cd256c2757 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Thu, 2 Jun 2016 18:58:26 +0200 Subject: [PATCH 13/42] revert some changes not related to #195 --- .travis.yml | 2 +- FOLDERS | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e04b1645..a8080ce4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,9 @@ rvm: - 2.2 - 2.3.0 - ruby-head - - jruby-head - jruby-18mode - jruby-19mode + - jruby-head - rbx-2 branches: only: diff --git a/FOLDERS b/FOLDERS index 9eae35ec..1709d08a 100644 --- a/FOLDERS +++ b/FOLDERS @@ -29,6 +29,7 @@ Run them as functional tests with rake test:demos. Some additional files for CodeRay, mainly graphics and Vim scripts. + == lib - CodeRay library code This is the base directory for the CodeRay library. From 4c7bedc3bf2392444f62e90b7b8dc91d1a2effbb Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Thu, 2 Jun 2016 19:01:56 +0200 Subject: [PATCH 14/42] add changelog --- Changes.textile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changes.textile b/Changes.textile index 10f1d6eb..d77cff29 100644 --- a/Changes.textile +++ b/Changes.textile @@ -2,6 +2,10 @@ 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.2 + +* C++ scanner: Added C++11 keywords. [#195, thanks to Johnny Willemsen] + h2. Changes in 1.1.1 * SQL scanner: Allow @$@ signs in SQL identifiers [#164, thanks to jasir and Ben Basson] From 935f003b2c15d6effb637abfc2ba40c20ad4ba98 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Wed, 28 Dec 2016 12:07:17 +0100 Subject: [PATCH 15/42] tweak benchmark numbers, improve accuracy --- bench/bench.rb | 10 +++++++--- rake_tasks/benchmark.rake | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bench/bench.rb b/bench/bench.rb index 92f9d07f..34ea9f9e 100644 --- a/bench/bench.rb +++ b/bench/bench.rb @@ -15,7 +15,7 @@ format = ARGV.fetch(1, 'html').downcase encoder = CodeRay.encoder(format) -size = ARGV.fetch(2, 1000).to_i * 1000 +size = ARGV.fetch(2, 2000).to_i * 1000 unless size.zero? data += data until data.size >= size data = data[0, size] @@ -23,14 +23,18 @@ size = data.size puts "encoding %d kB of #{lang} code to #{format}..." % [(size / 1000.0).round] -n = ARGV.fetch(3, 5).to_s[/\d+/].to_i +n = ARGV.fetch(3, 10).to_s[/\d+/].to_i require 'profile' if ARGV.include? '-p' +times = [] n.times do |i| time = Benchmark.realtime { encoder.encode(data, lang) } puts "run %d: %5.2f s, %4.0f kB/s" % [i + 1, time, size / time / 1000.0] + times << time end -STDIN.gets if ARGV.include? '-w' +times_sum = times.inject(0) { |time, sum| sum + time } +puts 'Average time: %5.2f s, %4.0f kB/s' % [times_sum / times.size, (size * n) / times_sum / 1000.0] +puts 'Best time: %5.2f s, %4.0f kB/s' % [times.min, size / times.min / 1000.0] __END__ Usage: diff --git a/rake_tasks/benchmark.rake b/rake_tasks/benchmark.rake index 2e38b577..8edeffb0 100644 --- a/rake_tasks/benchmark.rake +++ b/rake_tasks/benchmark.rake @@ -1,6 +1,6 @@ desc 'Do a benchmark' task :benchmark do - ruby 'bench/bench.rb ruby html 3000' + ruby 'bench/bench.rb ruby html' end task :bench => :benchmark From 443911f134b2485f2d0b101b78342e0c0e1548fe Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 10 Jan 2017 18:38:57 +0100 Subject: [PATCH 16/42] 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 a8080ce4..4c005471 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 From b22fc36299faf1348f2168773b10fb1eeacfcb26 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 10 Jan 2017 19:01:40 +0100 Subject: [PATCH 17/42] Change license file name correctly. --- MIT-LICENSE.txt => MIT-LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename MIT-LICENSE.txt => MIT-LICENSE (100%) diff --git a/MIT-LICENSE.txt b/MIT-LICENSE similarity index 100% rename from MIT-LICENSE.txt rename to MIT-LICENSE From 8afe8aa1ea8b6c7bcf46144977bcb45a72c997f6 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 11 Jan 2017 14:45:19 +0100 Subject: [PATCH 18/42] 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 From f38438f31319cf87fc87db71768b5902671a99f5 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:30:04 +1300 Subject: [PATCH 19/42] fixing tests --- .travis.yml | 4 ++-- Gemfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c005471..3a803e3d 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 592b79fb..d849d689 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 From 294183efae11e1a002cd455480e4dde8301f6b1e Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:35:33 +1300 Subject: [PATCH 20/42] fixing tests... --- .travis.yml | 4 ++-- Gemfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a803e3d..dc228fcb 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 d849d689..c4463a9f 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 From 6f9b2b8eb356327fa73e3e1d6c4ce18420f9db2a Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:38:46 +1300 Subject: [PATCH 21/42] downgrade shoulda-context --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index c4463a9f..87105557 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" From 6734fffd1c7fd951ecae0bb7a2b228a0b24c833a Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:42:07 +1300 Subject: [PATCH 22/42] 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 dc228fcb..75a57bb5 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 From 6b3df316a81e94ca7336f75d82bb1da6c10de9f7 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 15 Jan 2017 18:46:11 +1300 Subject: [PATCH 23/42] does this version work with JRuby? --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 87105557..f631cbe3 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" From 06f6ec4702c47fb5b7d654c477461a532062d742 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Sun, 15 Jan 2017 14:24:49 +0100 Subject: [PATCH 24/42] 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 328b94c1..50c195b5 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'] From 457ffbf3ee02b1b6f57eacb33df44c80f4bf9d71 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 9 Apr 2017 18:40:31 +0200 Subject: [PATCH 25/42] 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 d77cff29..6b448549 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 5433790a..d516ba9e 100644 --- a/lib/coderay/scanners/haml.rb +++ b/lib/coderay/scanners/haml.rb @@ -75,7 +75,7 @@ def scan_tokens encoder, options tag = false - if match = scan(/%[\w:]+\/?/) + if match = scan(/%[-\w:]+\/?/) encoder.text_token match, :tag # if match = scan(/( +)(.+)/) # encoder.text_token self[1], :space From 761234f380b3e42c283e82d784826bae280f9075 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Wed, 28 Jun 2017 10:36:18 +1000 Subject: [PATCH 26/42] 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 fa5695d6..2baeedb6 100644 --- a/lib/coderay/encoders/encoder.rb +++ b/lib/coderay/encoders/encoder.rb @@ -146,7 +146,7 @@ def setup options 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 942b9c89..1b33e921 100644 --- a/lib/coderay/encoders/html.rb +++ b/lib/coderay/encoders/html.rb @@ -176,7 +176,7 @@ def setup options if options[:wrap] || options[:line_numbers] @real_out = @out - @out = '' + @out = ''.dup end @break_lines = (options[:break_lines] == true) @@ -314,7 +314,7 @@ def check_group_nesting name, kind 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 From eccb20a661eaed79cbd987a524579da92edcbf9c Mon Sep 17 00:00:00 2001 From: t-gergely Date: Tue, 4 Jul 2017 17:01:52 +0200 Subject: [PATCH 27/42] 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 962154eb..b40d4a69 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ class Java < Scanner '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :nodoc: - IDENT = /[a-zA-Z_][A-Za-z_0-9]*/ # :nodoc: + IDENT = /[\p{L}_][\p{L}_0-9]*/ # :nodoc: protected From e94b1a91ce85306622f03996792d3665a675d69d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 7 Jul 2017 08:39:43 +0200 Subject: [PATCH 28/42] 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 75a57bb5..a486c233 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 From ef5e2611d6a937fab885eb18a0c6ac5906e65ee8 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 7 Jul 2017 08:41:07 +0200 Subject: [PATCH 29/42] update Ruby minor versions --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a486c233..96233c6a 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 From eb3f281428d59760271c757287066d39430449ae Mon Sep 17 00:00:00 2001 From: t-gergely Date: Fri, 7 Jul 2017 10:45:30 +0200 Subject: [PATCH 30/42] 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 b40d4a69..5fde4339 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ class Java < Scanner '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :nodoc: - IDENT = /[\p{L}_][\p{L}_0-9]*/ # :nodoc: + IDENT = /[[[:alpha:]]_][[[:alnum:]]_]*/ # :nodoc: protected From 0bea645c30a10b0e0c2949d629ec0d1932861c90 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:05:27 +0200 Subject: [PATCH 31/42] don't test on rubinius anymore --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 96233c6a..2c90b189 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ rvm: - 2.4 - ruby-head - jruby - - rbx branches: only: - master From 931ee0a74ba13049e452fb6c6d594750768cb908 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:32:22 +0200 Subject: [PATCH 32/42] 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 b15b9993..1a23a5bc 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' From c3473412188de4349a5cae4d4a4dc73ceac9e36f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:32:34 +0200 Subject: [PATCH 33/42] update changelog --- Changes.textile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes.textile b/Changes.textile index 6b448549..f9846109 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 From 860c2e132d2eed2b10285276fb6d1ca509f56cdc Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:34:33 +0200 Subject: [PATCH 34/42] 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 2c90b189..b99c95e0 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 From d4d27b2f9b090291f0e85b82f94b6e3bf266256d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:47:15 +0200 Subject: [PATCH 35/42] update changelog --- Changes.textile | 1 + 1 file changed, 1 insertion(+) diff --git a/Changes.textile b/Changes.textile index f9846109..37de4ace 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 From f16a659e503171024924d64feb1d478dd2527e39 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:47:23 +0200 Subject: [PATCH 36/42] update development gems --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index f631cbe3..89cd72b3 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' From 436c1a48074d786a542bf59ea2ea2da69cb121b9 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 10:49:32 +0200 Subject: [PATCH 37/42] update more gems --- Gemfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 89cd72b3..f07e274f 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 From 6f95c964d94a35b306e8086018917d16d7adc9ca Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:01:37 +0200 Subject: [PATCH 38/42] 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 f07e274f..951e3d1b 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 5fde4339..3ac7efe7 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ class Java < Scanner '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :nodoc: - IDENT = /[[[:alpha:]]_][[[:alnum:]]_]*/ # :nodoc: + IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : /[[[:alpha:]]_][[[:alnum:]]_]*/ # :nodoc: protected From 51ee233e72d5165f480ccad94487d995b3b2280f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:07:04 +0200 Subject: [PATCH 39/42] 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 34ea9f9e..a47721e3 100644 --- a/bench/bench.rb +++ b/bench/bench.rb @@ -15,7 +15,7 @@ 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] From 44a4f08fb3a5ee07a85557ff0d7f38fa54105d2b Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:12:52 +0200 Subject: [PATCH 40/42] fixing gems for Ruby 1.9 --- Gemfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 951e3d1b..530c0e80 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 From 1632c66c81b9fde52df23bbbe0bbeea077a9c5dc Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:18:11 +0200 Subject: [PATCH 41/42] 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 3ac7efe7..982a796f 100644 --- a/lib/coderay/scanners/java.rb +++ b/lib/coderay/scanners/java.rb @@ -44,7 +44,7 @@ class Java < Scanner '"' => /[^\\"]+/, '/' => /[^\\\/]+/, } # :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 From e15cf96405177153e1418496a7a8e85beaa679fb Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 3 Sep 2017 11:18:21 +0200 Subject: [PATCH 42/42] 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 7ea3f70c..f5e7a39d 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