syntax 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  Syntax: a syntax highlighting library for Ruby.
2
2
 
3
+ 1.2.2 03 July 2017
4
+ Add Travis CI configuration - @pat.
5
+ Updates to work with frozen string literals - @pat.
6
+
3
7
  1.2.1 01 June 2016
4
8
  Explicitly require 'set' - @jberkel.
5
9
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  A syntax highlighting a library for Ruby.
4
4
 
5
+ {<img src="https://travis-ci.org/dblock/syntax.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/dblock/syntax]
6
+
5
7
  This fork is maintained and version 1.1.0 has been published from it. However, there's currently none or not much new development going on here and the original author, @jamis[https://github.com/jamis], recommends using CodeRay[http://coderay.rubychan.de], over this library.
6
8
 
7
9
  == About
@@ -40,7 +40,7 @@ module Syntax
40
40
  # such as creating a new scanner for the text and saving the callback block.
41
41
  # The block will be invoked for each token extracted.
42
42
  def start( text, &block )
43
- @chunk = ""
43
+ @chunk = "".dup
44
44
  @group = :normal
45
45
  @callback = block
46
46
  @text = StringScanner.new( text )
@@ -148,7 +148,7 @@ module Syntax
148
148
 
149
149
  def flush_chunk
150
150
  @callback.call( Token.new( @chunk, @group ) ) unless @chunk.empty?
151
- @chunk = ""
151
+ @chunk = "".dup
152
152
  end
153
153
 
154
154
  def subtokenize( syntax, text )
@@ -10,7 +10,7 @@ module Syntax
10
10
  # of any type but <tt>:normal</tt> (which is always unhighlighted). If
11
11
  # +pre+ is +true+, the html is automatically wrapped in pre tags.
12
12
  def convert( text, pre=true )
13
- html = ""
13
+ html = "".dup
14
14
  html << "<pre>" if pre
15
15
  regions = []
16
16
  @tokenizer.tokenize( text ) do |tok|
@@ -218,7 +218,7 @@ module Syntax
218
218
 
219
219
  start_region inner_group
220
220
 
221
- items = "\\\\|"
221
+ items = "\\\\|".dup
222
222
  if heredoc
223
223
  items << "(^"
224
224
  items << '\s*' if heredoc == :float
@@ -273,7 +273,7 @@ module Syntax
273
273
  case matched[1]
274
274
  when ?{
275
275
  depth = 1
276
- content = ""
276
+ content = "".dup
277
277
  while depth > 0
278
278
  p = pos
279
279
  c = scan_until( /[\{}]/ )
@@ -2,7 +2,7 @@ module Syntax
2
2
  module Version
3
3
  MAJOR=1
4
4
  MINOR=2
5
- TINY=1
5
+ TINY=2
6
6
 
7
7
  STRING=[MAJOR,MINOR,TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,72 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-01 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2017-07-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - <
20
+ - !ruby/object:Gem::Version
21
+ version: 11.0.0
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - <
28
+ - !ruby/object:Gem::Version
29
+ version: 11.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake-contrib
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rdoc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: test-unit
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
14
78
  description: Syntax is Ruby library for performing simple syntax highlighting.
15
79
  email: jamis@jamisbuck.org
16
80
  executables: []