Skip to content

Commit 4440546

Browse files
committed
Merge branch 'master' into sass-scanner
Conflicts: lib/coderay/scanners/css.rb
2 parents 0e48583 + 737fb36 commit 4440546

File tree

10 files changed

+11
-7
lines changed

10 files changed

+11
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
.*~
23
coverage
34
pkg
45
spec/reports

Changes.textile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ h2. Changes in 1.1
77
* New scanner: Sass [#93]
88
* Diff scanner: Highlight inline changes in multi-line changes [#99]
99
* Remove double-click toggle handler from HTML table output
10+
* Fixes to CSS scanner (floats, pseudoclasses)
11+
* Plugin does not warn about fallback when default is defined
1012
* Display line numbers in HTML @:table@ mode even for single-line code (remove special case) [#41, thanks to Ariejan de Vroom]
13+
* @CodeRay::TokenKinds@ should not be frozen [#130, thanks to Gavin Kistner]
1114

1215
h2. Changes in 1.0.9
1316

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source :rubygems
1+
source 'https://rubygems.org'
22

33
# Specify your gem's dependencies in coderay.gemspec
44
gemspec
@@ -9,7 +9,7 @@ group :development do
99
gem "bundler", ">= 1.0.0"
1010
gem "rake"
1111
gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3"
12-
gem "term-ansicolor"
12+
gem "term-ansicolor", '= 1.1.1'
1313
gem "shoulda-context", "~> 1.0.0"
1414
gem "json" if RUBY_VERSION < '1.9'
1515
gem "rdoc"

lib/coderay/encoders/debug.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def initialize options = {}
2424
end
2525

2626
def text_token text, kind
27+
raise 'empty token' if $CODERAY_DEBUG && text.empty?
2728
if kind == :space
2829
@out << text
2930
else

lib/coderay/helpers/file_type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def shebang filename
9999
'mab' => :ruby,
100100
'pas' => :delphi,
101101
'patch' => :diff,
102+
'phtml' => :php,
102103
'php' => :php,
103104
'php3' => :php,
104105
'php4' => :php,

lib/coderay/helpers/plugin.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def make_plugin_hash
180180
rescue LoadError => boom
181181
if @plugin_map_loaded
182182
if h.has_key?(:default)
183-
warn '%p could not load plugin %p; falling back to %p' % [self, id, h[:default]]
184183
h[:default]
185184
else
186185
raise PluginNotFound, '%p could not load plugin %p: %s' % [self, id, boom]

lib/coderay/scanners/diff.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def scan_tokens encoder, options
4545
if match = scan(/--- |\+\+\+ |=+|_+/)
4646
encoder.begin_line line_kind = :head
4747
encoder.text_token match, :head
48-
if match = scan(/.*?(?=$|[\t\n\x00]| \(revision)/)
48+
if match = scan(/[^\x00\n]+?(?=$|[\t\n]| \(revision)/)
4949
encoder.text_token match, :filename
5050
if options[:highlight_code] && match != '/dev/null'
5151
file_type = CodeRay::FileType.fetch(match, :text)

lib/coderay/token_kinds.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,4 @@ module CodeRay
8585
TokenKinds[:method] = TokenKinds[:function]
8686
TokenKinds[:escape] = TokenKinds[:delimiter]
8787
TokenKinds[:docstring] = TokenKinds[:comment]
88-
89-
TokenKinds.freeze
9088
end

lib/coderay/tokens.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def method_missing meth, options = {}
9393
# This method is used by @Scanner#tokenize@ when called with an Array
9494
# of source strings. The Diff encoder uses it for inline highlighting.
9595
def split_into_parts *sizes
96+
return Array.new(sizes.size) { Tokens.new } if size == 2 && first == ''
9697
parts = []
9798
opened = []
9899
content = nil

lib/coderay/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module CodeRay
2-
VERSION = '1.0.9'
2+
VERSION = '1.1.0'
33
end

0 commit comments

Comments
 (0)