summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-09 07:27:56 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-09 07:27:56 +0200
commit444054629e31bd69ee697586348572998e93bdab (patch)
tree2a1753f85d5c14f72eaf701628e5e50b42cab328
parent0e4858322bfc969bde1b02cab3113940654acf31 (diff)
parent737fb3608c92506a573a79f611b94ff5d5da18e6 (diff)
downloadcoderay-444054629e31bd69ee697586348572998e93bdab.tar.gz
Merge branch 'master' into sass-scanner
Conflicts: lib/coderay/scanners/css.rb
-rw-r--r--.gitignore1
-rw-r--r--Changes.textile3
-rw-r--r--Gemfile4
-rw-r--r--lib/coderay/encoders/debug.rb1
-rw-r--r--lib/coderay/helpers/file_type.rb1
-rw-r--r--lib/coderay/helpers/plugin.rb1
-rw-r--r--lib/coderay/scanners/diff.rb2
-rwxr-xr-xlib/coderay/token_kinds.rb2
-rw-r--r--lib/coderay/tokens.rb1
-rw-r--r--lib/coderay/version.rb2
10 files changed, 11 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index fe9b05f..dd001c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
.DS_Store
+.*~
coverage
pkg
spec/reports
diff --git a/Changes.textile b/Changes.textile
index 625006a..6dcb0ee 100644
--- a/Changes.textile
+++ b/Changes.textile
@@ -7,7 +7,10 @@ h2. Changes in 1.1
* New scanner: Sass [#93]
* Diff scanner: Highlight inline changes in multi-line changes [#99]
* Remove double-click toggle handler from HTML table output
+* Fixes to CSS scanner (floats, pseudoclasses)
+* Plugin does not warn about fallback when default is defined
* Display line numbers in HTML @:table@ mode even for single-line code (remove special case) [#41, thanks to Ariejan de Vroom]
+* @CodeRay::TokenKinds@ should not be frozen [#130, thanks to Gavin Kistner]
h2. Changes in 1.0.9
diff --git a/Gemfile b/Gemfile
index 9f47966..508f1e8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,4 @@
-source :rubygems
+source 'https://rubygems.org'
# Specify your gem's dependencies in coderay.gemspec
gemspec
@@ -9,7 +9,7 @@ group :development do
gem "bundler", ">= 1.0.0"
gem "rake"
gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3"
- gem "term-ansicolor"
+ gem "term-ansicolor", '= 1.1.1'
gem "shoulda-context", "~> 1.0.0"
gem "json" if RUBY_VERSION < '1.9'
gem "rdoc"
diff --git a/lib/coderay/encoders/debug.rb b/lib/coderay/encoders/debug.rb
index 62f9f0a..c03d3fb 100644
--- a/lib/coderay/encoders/debug.rb
+++ b/lib/coderay/encoders/debug.rb
@@ -24,6 +24,7 @@ module Encoders
end
def text_token text, kind
+ raise 'empty token' if $CODERAY_DEBUG && text.empty?
if kind == :space
@out << text
else
diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb
index b06b9bc..12556d0 100644
--- a/lib/coderay/helpers/file_type.rb
+++ b/lib/coderay/helpers/file_type.rb
@@ -99,6 +99,7 @@ module CodeRay
'mab' => :ruby,
'pas' => :delphi,
'patch' => :diff,
+ 'phtml' => :php,
'php' => :php,
'php3' => :php,
'php4' => :php,
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb
index 137c1ab..dd4e830 100644
--- a/lib/coderay/helpers/plugin.rb
+++ b/lib/coderay/helpers/plugin.rb
@@ -180,7 +180,6 @@ module CodeRay
rescue LoadError => boom
if @plugin_map_loaded
if h.has_key?(:default)
- warn '%p could not load plugin %p; falling back to %p' % [self, id, h[:default]]
h[:default]
else
raise PluginNotFound, '%p could not load plugin %p: %s' % [self, id, boom]
diff --git a/lib/coderay/scanners/diff.rb b/lib/coderay/scanners/diff.rb
index 38efaf4..af0f755 100644
--- a/lib/coderay/scanners/diff.rb
+++ b/lib/coderay/scanners/diff.rb
@@ -45,7 +45,7 @@ module Scanners
if match = scan(/--- |\+\+\+ |=+|_+/)
encoder.begin_line line_kind = :head
encoder.text_token match, :head
- if match = scan(/.*?(?=$|[\t\n\x00]| \(revision)/)
+ if match = scan(/[^\x00\n]+?(?=$|[\t\n]| \(revision)/)
encoder.text_token match, :filename
if options[:highlight_code] && match != '/dev/null'
file_type = CodeRay::FileType.fetch(match, :text)
diff --git a/lib/coderay/token_kinds.rb b/lib/coderay/token_kinds.rb
index 3b8d07e..8db8530 100755
--- a/lib/coderay/token_kinds.rb
+++ b/lib/coderay/token_kinds.rb
@@ -85,6 +85,4 @@ module CodeRay
TokenKinds[:method] = TokenKinds[:function]
TokenKinds[:escape] = TokenKinds[:delimiter]
TokenKinds[:docstring] = TokenKinds[:comment]
-
- TokenKinds.freeze
end
diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb
index c747017..6957d69 100644
--- a/lib/coderay/tokens.rb
+++ b/lib/coderay/tokens.rb
@@ -93,6 +93,7 @@ module CodeRay
# This method is used by @Scanner#tokenize@ when called with an Array
# of source strings. The Diff encoder uses it for inline highlighting.
def split_into_parts *sizes
+ return Array.new(sizes.size) { Tokens.new } if size == 2 && first == ''
parts = []
opened = []
content = nil
diff --git a/lib/coderay/version.rb b/lib/coderay/version.rb
index bfb5f24..4b4f085 100644
--- a/lib/coderay/version.rb
+++ b/lib/coderay/version.rb
@@ -1,3 +1,3 @@
module CodeRay
- VERSION = '1.0.9'
+ VERSION = '1.1.0'
end