Skip to content

Commit 8537875

Browse files
committed
Merge branch 'master' into possible-speedups
2 parents ffdd9dd + e15cf96 commit 8537875

File tree

16 files changed

+29
-29
lines changed

16 files changed

+29
-29
lines changed

.travis.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@ rvm:
88
- 2.0
99
- 2.1
1010
- 2.2
11-
- 2.3.0
11+
- 2.3
12+
- 2.4
1213
- ruby-head
13-
- jruby-18mode
14-
- jruby-19mode
15-
- jruby-head
16-
- rbx-2
14+
- jruby
1715
branches:
1816
only:
1917
- master
18+
before_script:
19+
- if (ruby -e "exit RUBY_VERSION.to_f >= 2.3"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT
2020
matrix:
2121
allow_failures:
2222
- rvm: ruby-head
23-
- rvm: jruby-18mode
24-
- rvm: jruby-19mode
25-
- rvm: jruby-head
26-
- rvm: rbx-2
23+
- rvm: jruby
24+
- rvm: rbx
2725
script: "rake test" # test:scanners"
2826
sudo: false

Changes.textile

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release
44

55
h2. Changes in 1.1.2
66

7-
* C++ scanner: Added C++11 keywords. [#195, thanks to Johnny Willemsen]
7+
* Ruby future: Add support for frozen string literals. [#211, thanks to Pat Allan]
8+
* C++ scanner: Add C++11 keywords. [#195, thanks to Johnny Willemsen]
9+
* Haml scanner: Allow @-@ in tags.
10+
* Java scanner: Allow Unicode characters in identifiers. [#212, thanks to t-gergely]
811

912
h2. Changes in 1.1.1
1013

Gemfile

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ gemspec
66
# Add dependencies to develop your gem here.
77
# Include everything needed to run rake, tests, features, etc.
88
group :development do
9-
gem "bundler"
10-
gem "rake", "~> 10.5"
11-
gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3"
12-
gem "term-ansicolor"
13-
gem 'tins', '~> 1.6.0'
14-
gem "shoulda-context"
15-
gem "test-unit"
16-
gem "json" if RUBY_VERSION < '1.9'
17-
gem "rdoc"
9+
gem 'bundler'
10+
gem 'rake', RUBY_VERSION < '1.9' ? '~> 10.5' : '>= 10.5'
11+
gem 'RedCloth', RUBY_PLATFORM == 'java' ? '= 4.2.9' : '>= 4.0.3'
12+
gem 'term-ansicolor', RUBY_VERSION < '2.0' ? '~> 1.3.2' : '>= 1.3.2'
13+
gem 'tins', RUBY_VERSION < '2.0' ? '~> 1.6.0' : '>= 1.6.0'
14+
gem 'shoulda-context', RUBY_VERSION < '1.9' ? '= 1.2.1' : '>= 1.2.1'
15+
gem 'test-unit', RUBY_VERSION < '1.9' ? '~> 2.0' : '>= 3.0'
16+
gem 'json', '>= 1.8' if RUBY_VERSION < '1.9'
17+
gem 'rdoc', RUBY_VERSION < '1.9' ? '~> 4.2.2' : '>= 4.2.2'
1818
end
File renamed without changes.

bench/bench.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
format = ARGV.fetch(1, 'html').downcase
1616
encoder = CodeRay.encoder(format)
1717

18-
size = ARGV.fetch(2, 2000).to_i * 1000
18+
size = ARGV.fetch(2, 3000).to_i * 1000
1919
unless size.zero?
2020
data += data until data.size >= size
2121
data = data[0, size]

coderay.gemspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ Gem::Specification.new do |s|
2424

2525
readme_file = 'README_INDEX.rdoc'
2626

27-
s.files = `git ls-files -- lib/* test/functional/* Rakefile #{readme_file} MIT-LICENSE`.split("\n")
28-
s.test_files = `git ls-files -- test/functional/*`.split("\n")
27+
s.files = `git ls-files -- lib/* #{readme_file} MIT-LICENSE`.split("\n")
2928
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
3029
s.require_paths = ['lib']
3130

lib/coderay/encoders/encoder.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def setup options
146146
end
147147

148148
def get_output options
149-
options[:out] || ''
149+
options[:out] || ''.dup
150150
end
151151

152152
# Append data.to_s to the output. Returns the argument.

lib/coderay/encoders/html.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def setup options
161161

162162
if options[:wrap] || options[:line_numbers]
163163
@real_out = @out
164-
@out = ''
164+
@out = ''.dup
165165
end
166166

167167
@break_lines = (options[:break_lines] == true)
@@ -297,7 +297,7 @@ def check_group_nesting name, kind
297297
end
298298

299299
def break_lines text, style
300-
reopen = ''
300+
reopen = ''.dup
301301
@opened.each_with_index do |kind, index|
302302
reopen << (@span_for_kinds[index > 0 ? [kind, *@opened[0...index]] : kind] || '<span>')
303303
end

lib/coderay/scanners/haml.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def scan_tokens encoder, options
7575

7676
tag = false
7777

78-
if match = scan(/%[\w:]+\/?/)
78+
if match = scan(/%[-\w:]+\/?/)
7979
encoder.text_token match, :tag
8080
# if match = scan(/( +)(.+)/)
8181
# encoder.text_token self[1], :space

lib/coderay/scanners/java.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Java < Scanner
4444
'"' => /[^\\"]+/,
4545
'/' => /[^\\\/]+/,
4646
} # :nodoc:
47-
IDENT = /[a-zA-Z_][A-Za-z_0-9]*/ # :nodoc:
47+
IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : Regexp.new('[[[:alpha:]]_][[[:alnum:]]_]*') # :nodoc:
4848

4949
protected
5050

lib/coderay/token_kinds.rb

100755100644
File mode changed.

lib/coderay/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module CodeRay
2-
VERSION = '1.1.1'
2+
VERSION = '1.1.2'
33
end

rake_tasks/test.rake

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace :test do
22
desc 'run functional tests'
33
task :functional do
44
ruby './test/functional/suite.rb'
5-
ruby './test/functional/for_redcloth.rb'
5+
ruby './test/functional/for_redcloth.rb' unless (''.chop! rescue true)
66
end
77

88
desc 'run unit tests'

test/functional/basic.rb

100755100644
File mode changed.

test/functional/examples.rb

100755100644
File mode changed.

test/functional/suite.rb

100755100644
File mode changed.

0 commit comments

Comments
 (0)