diff options
-rw-r--r-- | .travis.yml | 7 | ||||
-rw-r--r-- | Changes.textile | 4 | ||||
-rw-r--r-- | lib/coderay/encoders/encoder.rb | 2 | ||||
-rw-r--r-- | lib/coderay/encoders/html.rb | 4 | ||||
-rw-r--r-- | lib/coderay/scanners/haml.rb | 2 | ||||
-rw-r--r-- | rake_tasks/test.rake | 2 |
6 files changed, 12 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml index 75a57bb..b99c95e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,14 +8,15 @@ rvm: - 2.0 - 2.1 - 2.2 - - 2.3.3 - - 2.4.0 + - 2.3 + - 2.4 - ruby-head - jruby - - rbx branches: only: - master +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: ruby-head diff --git a/Changes.textile b/Changes.textile index d77cff2..f984610 100644 --- a/Changes.textile +++ b/Changes.textile @@ -4,7 +4,9 @@ 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 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] || '<span>') end 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 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' |