From 7c9531d155fb9159f90a5074586e906188686633 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sat, 21 Jan 2012 14:39:52 +0100 Subject: changelog --- Changes.textile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changes.textile b/Changes.textile index 60382f5..9ac871a 100644 --- a/Changes.textile +++ b/Changes.textile @@ -4,6 +4,10 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release {{toc}} +h2. Changes in 1.0.6 + +* The CSS Scanner now highlights tokens like @url(...)@ as @:function@ instead of @:string@. [GH-13, thanks to Joel Holdbrooks] + h2. Changes in 1.0.5 Fixes: -- cgit v1.2.1 From 0e8008ad88b4f56e35d71c3029d02ffb4e21120f Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Thu, 26 Jan 2012 21:14:59 +0100 Subject: Extracted code making HTML lines independent from numbering code to a specific option in encoder. --- lib/coderay/encoders/html.rb | 27 +++++++++++++++++++++++---- lib/coderay/encoders/html/numbering.rb | 16 ++-------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb index c32dbd1..14d1307 100644 --- a/lib/coderay/encoders/html.rb +++ b/lib/coderay/encoders/html.rb @@ -47,6 +47,12 @@ module Encoders # # Default: 'CodeRay output' # + # === :independent_lines + # Split multilines blocks into line-wide blocks. + # Forced to true if :line_numbers option is set to :inline. + # + # Default: false + # # === :line_numbers # Include line numbers in :table, :inline, or nil (no line numbers) # @@ -99,7 +105,8 @@ module Encoders :style => :alpha, :wrap => nil, :title => 'CodeRay output', - + + :independent_lines => false, :line_numbers => nil, :line_number_anchors => 'n', :line_number_start => 1, @@ -167,7 +174,11 @@ module Encoders @real_out = @out @out = '' end - + + options[:independent_lines] = true if options[:line_numbers] == :inline + + @independent_lines = (options[:independent_lines] == true) + @HTML_ESCAPE = HTML_ESCAPE.dup @HTML_ESCAPE["\t"] = ' ' * options[:tab_width] @@ -245,13 +256,21 @@ module Encoders if text =~ /#{HTML_ESCAPE_PATTERN}/o text = text.gsub(/#{HTML_ESCAPE_PATTERN}/o) { |m| @HTML_ESCAPE[m] } end + if @independent_lines && @opened.any? && text.end_with?("\n") + text.chomp! + close_eol_reopen = "#{'' * @opened.size}\n" + @opened.each_with_index do |k, index| + close_eol_reopen << (@span_for_kind[index > 0 ? [k, *@opened[0 ... index ]] : k] || '') + end + end if style = @span_for_kind[@last_opened ? [kind, *@opened] : kind] @out << style << text << '' else @out << text end + @out << close_eol_reopen if close_eol_reopen end - + # token groups, eg. strings def begin_group kind @out << (@span_for_kind[@last_opened ? [kind, *@opened] : kind] || '') @@ -299,4 +318,4 @@ module Encoders end end -end +end \ No newline at end of file diff --git a/lib/coderay/encoders/html/numbering.rb b/lib/coderay/encoders/html/numbering.rb index 15ce11b..904a64f 100644 --- a/lib/coderay/encoders/html/numbering.rb +++ b/lib/coderay/encoders/html/numbering.rb @@ -68,23 +68,11 @@ module Encoders when :inline max_width = (start + line_count).to_s.size line_number = start - nesting = [] output.gsub!(/^.*$\n?/) do |line| - line.chomp! - open = nesting.join - line.scan(%r!<(/)?span[^>]*>?!) do |close,| - if close - nesting.pop - else - nesting << $& - end - end - close = '' * nesting.size - line_number_text = bolding.call line_number indent = ' ' * (max_width - line_number.to_s.size) # TODO: Optimize (10^x) line_number += 1 - "#{indent}#{line_number_text}#{open}#{line}#{close}\n" + "#{indent}#{line_number_text}#{line}" end when :table @@ -112,4 +100,4 @@ module Encoders end end -end +end \ No newline at end of file -- cgit v1.2.1 From 9ead89222c42b0f370fdfaae788bcdeb0e82ae18 Mon Sep 17 00:00:00 2001 From: Doug Hammond Date: Thu, 23 Feb 2012 19:23:57 +1300 Subject: Fixing automatic type selection for html files. --- lib/coderay/helpers/file_type.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb index 7b90918..637001b 100644 --- a/lib/coderay/helpers/file_type.rb +++ b/lib/coderay/helpers/file_type.rb @@ -90,8 +90,8 @@ module CodeRay 'gvy' => :groovy, 'h' => :c, 'haml' => :haml, - 'htm' => :page, - 'html' => :page, + 'htm' => :html, + 'html' => :html, 'html.erb' => :erb, 'java' => :java, 'js' => :java_script, @@ -120,7 +120,7 @@ module CodeRay 'sql' => :sql, # 'ss' => :scheme, 'tmproj' => :xml, - 'xhtml' => :page, + 'xhtml' => :html, 'xml' => :xml, 'yaml' => :yaml, 'yml' => :yaml, -- cgit v1.2.1 From 9e9594156c3e83bb5a7529dfa9fb70aa2bf66e2f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 2 Mar 2012 17:49:02 +0100 Subject: update .travis.yml --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b1b91c..35b31c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,13 @@ rvm: - 1.8.7 - 1.9.2 - 1.9.3 + - jruby-18mode + - jruby-19mode + - rbx-18mode + - rbx-19mode - ruby-head - - rbx - - rbx-2.0 + - jruby-head - ree - - jruby branches: only: - master -- cgit v1.2.1 From d9bb7f2f718d5eb6ac104f7b661e32fae22f808c Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 2 Mar 2012 18:02:58 +0100 Subject: replace weird regexp that confuses ruby-head --- lib/coderay/scanners/python.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/coderay/scanners/python.rb b/lib/coderay/scanners/python.rb index 5e38a2c..cbdbbdb 100644 --- a/lib/coderay/scanners/python.rb +++ b/lib/coderay/scanners/python.rb @@ -61,7 +61,7 @@ module Scanners add(PREDEFINED_VARIABLES_AND_CONSTANTS, :predefined_constant). add(PREDEFINED_EXCEPTIONS, :exception) # :nodoc: - NAME = / [^\W\d] \w* /x # :nodoc: + NAME = / [[:alpha:]_] \w* /x # :nodoc: ESCAPE = / [abfnrtv\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} | N\{[-\w ]+\} /x # :nodoc: -- cgit v1.2.1 From ff050fe5ead8c3236b17ec9ed78b491298c8f44f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 2 Mar 2012 18:10:24 +0100 Subject: remove rbx-19mode from travis for now --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 35b31c7..43e9f45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ rvm: - jruby-18mode - jruby-19mode - rbx-18mode - - rbx-19mode + # - rbx-19mode # test again later - ruby-head - jruby-head - ree -- cgit v1.2.1 From a2e9acc4dabd2ec2d33ac17d83f92ef370354eb7 Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Thu, 29 Mar 2012 20:46:07 +0200 Subject: Fixed handling of eols inside token content. --- lib/coderay/encoders/html.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb index 14d1307..0d91cdf 100644 --- a/lib/coderay/encoders/html.rb +++ b/lib/coderay/encoders/html.rb @@ -256,19 +256,23 @@ module Encoders if text =~ /#{HTML_ESCAPE_PATTERN}/o text = text.gsub(/#{HTML_ESCAPE_PATTERN}/o) { |m| @HTML_ESCAPE[m] } end - if @independent_lines && @opened.any? && text.end_with?("\n") - text.chomp! - close_eol_reopen = "#{'' * @opened.size}\n" + + style = @span_for_kind[@last_opened ? [kind, *@opened] : kind] + + if @independent_lines && (i = text.index("\n")) && (c = @opened.size + (style ? 1 : 0)) > 0 + close = '' * c + reopen = '' @opened.each_with_index do |k, index| - close_eol_reopen << (@span_for_kind[index > 0 ? [k, *@opened[0 ... index ]] : k] || '') + reopen << (@span_for_kind[index > 0 ? [k, *@opened[0 ... index ]] : k] || '') end + text[i .. -1] = text[i .. -1].gsub("\n", "#{close}\n#{reopen}#{style}") end - if style = @span_for_kind[@last_opened ? [kind, *@opened] : kind] + + if style @out << style << text << '' else @out << text end - @out << close_eol_reopen if close_eol_reopen end # token groups, eg. strings -- cgit v1.2.1 From ce3a6c7bcc0b7efac4844de859d8c8364476ab0d Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Thu, 29 Mar 2012 20:47:18 +0200 Subject: Added a unit test for HTML encoder (with a test for :line_independent option) --- test/unit/html.rb | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 test/unit/html.rb diff --git a/test/unit/html.rb b/test/unit/html.rb new file mode 100644 index 0000000..f6e3d7e --- /dev/null +++ b/test/unit/html.rb @@ -0,0 +1,104 @@ +require 'test/unit' +require 'coderay' + +class HtmlTest < Test::Unit::TestCase + + def test_independent_lines_option + + snippets = {} + + snippets[:ruby] = {} + + snippets[:ruby][:in] = <<-RUBY +ruby_inside = <<-RUBY_INSIDE +This is tricky, +isn't it? +RUBY_INSIDE + RUBY + + snippets[:ruby][:expected_with_option_off] = <<-HTML_OPT_INDEPENDENT_LINES_OFF +ruby_inside = <<-RUBY_INSIDE +This is tricky, +isn't it? +RUBY_INSIDE + HTML_OPT_INDEPENDENT_LINES_OFF + + snippets[:ruby][:expected_with_option_on] = <<-HTML_OPT_INDEPENDENT_LINES_ON +ruby_inside = <<-RUBY_INSIDE +This is tricky, +isn't it? +RUBY_INSIDE + HTML_OPT_INDEPENDENT_LINES_ON + + snippets[:java] = {} + + snippets[:java][:in] = <<-JAVA +import java.lang.*; + +/** + * This is some multiline javadoc + * used to test the + */ +public class Test { + public static final String MESSAGE = "My message\ + To the world"; + + static void main() { + /* + * Another multiline + * comment + */ + System.out.println(MESSAGE); + } +} + JAVA + + snippets[:java][:expected_with_option_off] = <<-HTML_OPT_INDEPENDENT_LINES_OFF +import java.lang.*; + +/** + * This is some multiline javadoc + * used to test the + */ +public class Test { + public static final String MESSAGE = "My message To the world"; + + static void main() { + /* + * Another multiline + * comment + */ + System.out.println(MESSAGE); + } +} + HTML_OPT_INDEPENDENT_LINES_OFF + + snippets[:java][:expected_with_option_on] = <<-HTML_OPT_INDEPENDENT_LINES_ON +import java.lang.*; + +/** + * This is some multiline javadoc + * used to test the + */ +public class Test { + public static final String MESSAGE = "My message To the world"; + + static void main() { + /* + * Another multiline + * comment + */ + System.out.println(MESSAGE); + } +} + HTML_OPT_INDEPENDENT_LINES_ON + + snippets.entries().each do |lang, code| + tokens = CodeRay.scan code[:in], lang + + assert_equal code[:expected_with_option_off], tokens.html + assert_equal code[:expected_with_option_off], tokens.html(:independent_lines => false) + assert_equal code[:expected_with_option_on], tokens.html(:independent_lines => true) + end + end +end \ No newline at end of file -- cgit v1.2.1 From d385eff0109b890dccb3ae209b84bdd4fdd9b43d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sat, 31 Mar 2012 21:38:09 +0200 Subject: fix tests for #16 --- test/unit/file_type.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/file_type.rb b/test/unit/file_type.rb index 607e30a..263517b 100644 --- a/test/unit/file_type.rb +++ b/test/unit/file_type.rb @@ -63,9 +63,9 @@ class FileTypeTests < Test::Unit::TestCase end def test_html - assert_equal :page, FileType['test.htm'] - assert_equal :page, FileType['test.xhtml'] - assert_equal :page, FileType['test.html.xhtml'] + assert_equal :html, FileType['test.htm'] + assert_equal :html, FileType['test.xhtml'] + assert_equal :html, FileType['test.html.xhtml'] assert_equal :erb, FileType['_form.rhtml'] assert_equal :erb, FileType['_form.html.erb'] end -- cgit v1.2.1 From 36b1799efc9b74b556ca698c3e3808a363d3fabc Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sat, 31 Mar 2012 21:40:23 +0200 Subject: specify encoding of PHP scanner file (fails when RUBYOPT=-Ku is set) --- lib/coderay/scanners/php.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/coderay/scanners/php.rb b/lib/coderay/scanners/php.rb index dadab00..8acfff5 100644 --- a/lib/coderay/scanners/php.rb +++ b/lib/coderay/scanners/php.rb @@ -1,3 +1,4 @@ +# encoding: ASCII-8BIT module CodeRay module Scanners -- cgit v1.2.1 From df4e2bc7f7d8238f56e2d823aea707bfd860ad8f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 1 Apr 2012 00:28:15 +0200 Subject: here come the white-space nazis --- lib/coderay/encoders/html.rb | 23 ++++++++++---------- lib/coderay/encoders/html/numbering.rb | 2 +- test/unit/html.rb | 39 +++++++++++++++++----------------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb index 0d91cdf..2ec0f37 100644 --- a/lib/coderay/encoders/html.rb +++ b/lib/coderay/encoders/html.rb @@ -48,7 +48,7 @@ module Encoders # Default: 'CodeRay output' # # === :independent_lines - # Split multilines blocks into line-wide blocks. + # Split multiline blocks at line breaks. # Forced to true if :line_numbers option is set to :inline. # # Default: false @@ -105,8 +105,9 @@ module Encoders :style => :alpha, :wrap => nil, :title => 'CodeRay output', - - :independent_lines => false, + + :independent_lines => false, + :line_numbers => nil, :line_number_anchors => 'n', :line_number_start => 1, @@ -174,11 +175,11 @@ module Encoders @real_out = @out @out = '' end - + options[:independent_lines] = true if options[:line_numbers] == :inline - + @independent_lines = (options[:independent_lines] == true) - + @HTML_ESCAPE = HTML_ESCAPE.dup @HTML_ESCAPE["\t"] = ' ' * options[:tab_width] @@ -256,9 +257,9 @@ module Encoders if text =~ /#{HTML_ESCAPE_PATTERN}/o text = text.gsub(/#{HTML_ESCAPE_PATTERN}/o) { |m| @HTML_ESCAPE[m] } end - + style = @span_for_kind[@last_opened ? [kind, *@opened] : kind] - + if @independent_lines && (i = text.index("\n")) && (c = @opened.size + (style ? 1 : 0)) > 0 close = '' * c reopen = '' @@ -267,14 +268,14 @@ module Encoders end text[i .. -1] = text[i .. -1].gsub("\n", "#{close}\n#{reopen}#{style}") end - + if style @out << style << text << '' else @out << text end end - + # token groups, eg. strings def begin_group kind @out << (@span_for_kind[@last_opened ? [kind, *@opened] : kind] || '') @@ -322,4 +323,4 @@ module Encoders end end -end \ No newline at end of file +end diff --git a/lib/coderay/encoders/html/numbering.rb b/lib/coderay/encoders/html/numbering.rb index 904a64f..8bc6259 100644 --- a/lib/coderay/encoders/html/numbering.rb +++ b/lib/coderay/encoders/html/numbering.rb @@ -100,4 +100,4 @@ module Encoders end end -end \ No newline at end of file +end diff --git a/test/unit/html.rb b/test/unit/html.rb index f6e3d7e..cc4a0c6 100644 --- a/test/unit/html.rb +++ b/test/unit/html.rb @@ -2,36 +2,35 @@ require 'test/unit' require 'coderay' class HtmlTest < Test::Unit::TestCase - + def test_independent_lines_option - snippets = {} - + snippets[:ruby] = {} - + snippets[:ruby][:in] = <<-RUBY ruby_inside = <<-RUBY_INSIDE This is tricky, isn't it? RUBY_INSIDE - RUBY - + RUBY + snippets[:ruby][:expected_with_option_off] = <<-HTML_OPT_INDEPENDENT_LINES_OFF ruby_inside = <<-RUBY_INSIDE This is tricky, isn't it? RUBY_INSIDE - HTML_OPT_INDEPENDENT_LINES_OFF - + HTML_OPT_INDEPENDENT_LINES_OFF + snippets[:ruby][:expected_with_option_on] = <<-HTML_OPT_INDEPENDENT_LINES_ON ruby_inside = <<-RUBY_INSIDE This is tricky, isn't it? RUBY_INSIDE - HTML_OPT_INDEPENDENT_LINES_ON - + HTML_OPT_INDEPENDENT_LINES_ON + snippets[:java] = {} - + snippets[:java][:in] = <<-JAVA import java.lang.*; @@ -51,8 +50,8 @@ public class Test { System.out.println(MESSAGE); } } - JAVA - + JAVA + snippets[:java][:expected_with_option_off] = <<-HTML_OPT_INDEPENDENT_LINES_OFF import java.lang.*; @@ -71,8 +70,8 @@ public class Test { System.out.println(MESSAGE); } } - HTML_OPT_INDEPENDENT_LINES_OFF - + HTML_OPT_INDEPENDENT_LINES_OFF + snippets[:java][:expected_with_option_on] = <<-HTML_OPT_INDEPENDENT_LINES_ON import java.lang.*; @@ -91,14 +90,14 @@ public class Test { System.out.println(MESSAGE); } } - HTML_OPT_INDEPENDENT_LINES_ON - - snippets.entries().each do |lang, code| + HTML_OPT_INDEPENDENT_LINES_ON + + for lang, code in snippets tokens = CodeRay.scan code[:in], lang - + assert_equal code[:expected_with_option_off], tokens.html assert_equal code[:expected_with_option_off], tokens.html(:independent_lines => false) assert_equal code[:expected_with_option_on], tokens.html(:independent_lines => true) end end -end \ No newline at end of file +end -- cgit v1.2.1 From 5c4124559127f8ce991e31e4ea8a40516fe0757a Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Mon, 2 Apr 2012 00:15:20 +0200 Subject: rename :independent_lines option to :break_lines --- lib/coderay/encoders/html.rb | 11 ++++++----- test/unit/html.rb | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb index 2ec0f37..635a4d8 100644 --- a/lib/coderay/encoders/html.rb +++ b/lib/coderay/encoders/html.rb @@ -47,7 +47,8 @@ module Encoders # # Default: 'CodeRay output' # - # === :independent_lines + # === :break_lines + # # Split multiline blocks at line breaks. # Forced to true if :line_numbers option is set to :inline. # @@ -106,7 +107,7 @@ module Encoders :wrap => nil, :title => 'CodeRay output', - :independent_lines => false, + :break_lines => false, :line_numbers => nil, :line_number_anchors => 'n', @@ -176,9 +177,9 @@ module Encoders @out = '' end - options[:independent_lines] = true if options[:line_numbers] == :inline + options[:break_lines] = true if options[:line_numbers] == :inline - @independent_lines = (options[:independent_lines] == true) + @break_lines = (options[:break_lines] == true) @HTML_ESCAPE = HTML_ESCAPE.dup @HTML_ESCAPE["\t"] = ' ' * options[:tab_width] @@ -260,7 +261,7 @@ module Encoders style = @span_for_kind[@last_opened ? [kind, *@opened] : kind] - if @independent_lines && (i = text.index("\n")) && (c = @opened.size + (style ? 1 : 0)) > 0 + if @break_lines && (i = text.index("\n")) && (c = @opened.size + (style ? 1 : 0)) > 0 close = '' * c reopen = '' @opened.each_with_index do |k, index| diff --git a/test/unit/html.rb b/test/unit/html.rb index cc4a0c6..0072635 100644 --- a/test/unit/html.rb +++ b/test/unit/html.rb @@ -3,7 +3,7 @@ require 'coderay' class HtmlTest < Test::Unit::TestCase - def test_independent_lines_option + def test_break_lines_option snippets = {} snippets[:ruby] = {} @@ -96,8 +96,8 @@ public class Test { tokens = CodeRay.scan code[:in], lang assert_equal code[:expected_with_option_off], tokens.html - assert_equal code[:expected_with_option_off], tokens.html(:independent_lines => false) - assert_equal code[:expected_with_option_on], tokens.html(:independent_lines => true) + assert_equal code[:expected_with_option_off], tokens.html(:break_lines => false) + assert_equal code[:expected_with_option_on], tokens.html(:break_lines => true) end end end -- cgit v1.2.1 From 60e455575bf9ab6177014f662c50991a6db3df4a Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Mon, 2 Apr 2012 00:31:47 +0200 Subject: ignore .DS_Store --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2bb9385..a000699 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store *.gem *.rbc .bundle -- cgit v1.2.1 From 240f002759809c7c7ca368b04205f3f3de0e8592 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Mon, 2 Apr 2012 00:51:17 +0200 Subject: update changelog, bump version to 1.0.6 --- Changes.textile | 2 ++ lib/coderay/version.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changes.textile b/Changes.textile index 9ac871a..1689e7b 100644 --- a/Changes.textile +++ b/Changes.textile @@ -6,6 +6,8 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release h2. Changes in 1.0.6 +* New option @:break_lines@ for the HTML encoder (splits tokens at line breaks). [GH-15, thanks to Etienne Massip] +* Fixed wrong HTML file type. (was @:page@) [GH-16, thanks to Doug Hammond] * The CSS Scanner now highlights tokens like @url(...)@ as @:function@ instead of @:string@. [GH-13, thanks to Joel Holdbrooks] h2. Changes in 1.0.5 diff --git a/lib/coderay/version.rb b/lib/coderay/version.rb index e2797b5..368b963 100644 --- a/lib/coderay/version.rb +++ b/lib/coderay/version.rb @@ -1,3 +1,3 @@ module CodeRay - VERSION = '1.0.5' + VERSION = '1.0.6' end -- cgit v1.2.1 From e96c2acce3cdccc540419e21960e5c0aa18b5548 Mon Sep 17 00:00:00 2001 From: Will Read Date: Sun, 1 Apr 2012 20:25:25 -0700 Subject: Removing redundant LoadError raise. File.exists? seems to have problems when included in other gems and returns false when files are indeed present. --- lib/coderay/helpers/plugin.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index 06c1233..137c1ab 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -176,7 +176,6 @@ module CodeRay id = validate_id(plugin_id) path = path_to id begin - raise LoadError, "#{path} not found" unless File.exist? path require path rescue LoadError => boom if @plugin_map_loaded -- cgit v1.2.1 From 31f8b4e7bcc3b35bf6bbf35e84d9921697bdd6e4 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 6 Apr 2012 00:08:07 +0200 Subject: last changes before release of 1.0.6 --- Changes.textile | 1 + bench/bench.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/Changes.textile b/Changes.textile index 1689e7b..fb9c8d5 100644 --- a/Changes.textile +++ b/Changes.textile @@ -7,6 +7,7 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release h2. Changes in 1.0.6 * New option @:break_lines@ for the HTML encoder (splits tokens at line breaks). [GH-15, thanks to Etienne Massip] +* Improved speed of @:line_numbers => :inline@ option for the HTML encoder. * Fixed wrong HTML file type. (was @:page@) [GH-16, thanks to Doug Hammond] * The CSS Scanner now highlights tokens like @url(...)@ as @:function@ instead of @:string@. [GH-13, thanks to Joel Holdbrooks] diff --git a/bench/bench.rb b/bench/bench.rb index 5663466..45dc5b0 100644 --- a/bench/bench.rb +++ b/bench/bench.rb @@ -79,6 +79,7 @@ N.times do options = { :tab_width => 2, + # :line_numbers => :inline, :css => $style ? :style : :class, } $hl = CodeRay.encoder(format, options) unless $dump_output -- cgit v1.2.1 From 359db4594e7fc874cf8087f599dc4e96b22e586b Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 6 Apr 2012 00:24:21 +0200 Subject: bump version to 1.0.7 --- Changes.textile | 4 ++++ lib/coderay/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changes.textile b/Changes.textile index fb9c8d5..470ba33 100644 --- a/Changes.textile +++ b/Changes.textile @@ -4,6 +4,10 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release {{toc}} +h2. Changes in 1.0.7 + +* Fix issue with plugin files not being loaded. [GH-20, thanks to Will Read] + h2. Changes in 1.0.6 * New option @:break_lines@ for the HTML encoder (splits tokens at line breaks). [GH-15, thanks to Etienne Massip] diff --git a/lib/coderay/version.rb b/lib/coderay/version.rb index 368b963..620e703 100644 --- a/lib/coderay/version.rb +++ b/lib/coderay/version.rb @@ -1,3 +1,3 @@ module CodeRay - VERSION = '1.0.6' + VERSION = '1.0.7' end -- cgit v1.2.1