rouge 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/Gemfile +2 -0
  2. data/lib/rouge/cli.rb +15 -0
  3. data/lib/rouge/demos/matlab +6 -0
  4. data/lib/rouge/demos/ocaml +12 -0
  5. data/lib/rouge/demos/scala +3 -0
  6. data/lib/rouge/demos/sml +4 -0
  7. data/lib/rouge/demos/vb +4 -0
  8. data/lib/rouge/formatters/html.rb +13 -17
  9. data/lib/rouge/formatters/terminal256.rb +2 -2
  10. data/lib/rouge/lexer.rb +12 -14
  11. data/lib/rouge/lexers/coffeescript.rb +2 -4
  12. data/lib/rouge/lexers/common_lisp.rb +2 -4
  13. data/lib/rouge/lexers/erlang.rb +4 -13
  14. data/lib/rouge/lexers/factor.rb +25 -24
  15. data/lib/rouge/lexers/gherkin.rb +6 -6
  16. data/lib/rouge/lexers/groovy.rb +1 -2
  17. data/lib/rouge/lexers/haml.rb +2 -2
  18. data/lib/rouge/lexers/haskell.rb +18 -20
  19. data/lib/rouge/lexers/http.rb +13 -12
  20. data/lib/rouge/lexers/ini.rb +1 -2
  21. data/lib/rouge/lexers/java.rb +1 -2
  22. data/lib/rouge/lexers/lua.rb +1 -1
  23. data/lib/rouge/lexers/make.rb +4 -5
  24. data/lib/rouge/lexers/markdown.rb +4 -12
  25. data/lib/rouge/lexers/matlab.rb +71 -0
  26. data/lib/rouge/lexers/matlab/builtins.rb +10 -0
  27. data/lib/rouge/lexers/nginx.rb +3 -4
  28. data/lib/rouge/lexers/objective_c.rb +1 -1
  29. data/lib/rouge/lexers/ocaml.rb +109 -0
  30. data/lib/rouge/lexers/perl.rb +2 -5
  31. data/lib/rouge/lexers/php.rb +5 -5
  32. data/lib/rouge/lexers/php/builtins.rb +4 -2
  33. data/lib/rouge/lexers/puppet.rb +1 -2
  34. data/lib/rouge/lexers/python.rb +5 -11
  35. data/lib/rouge/lexers/racket.rb +1 -3
  36. data/lib/rouge/lexers/ruby.rb +8 -8
  37. data/lib/rouge/lexers/rust.rb +3 -3
  38. data/lib/rouge/lexers/sass/common.rb +4 -4
  39. data/lib/rouge/lexers/scala.rb +141 -0
  40. data/lib/rouge/lexers/scheme.rb +1 -3
  41. data/lib/rouge/lexers/sed.rb +4 -4
  42. data/lib/rouge/lexers/shell.rb +1 -2
  43. data/lib/rouge/lexers/smalltalk.rb +6 -7
  44. data/lib/rouge/lexers/sml.rb +236 -6
  45. data/lib/rouge/lexers/tex.rb +1 -4
  46. data/lib/rouge/lexers/toml.rb +1 -2
  47. data/lib/rouge/lexers/vb.rb +162 -0
  48. data/lib/rouge/lexers/viml.rb +1 -1
  49. data/lib/rouge/lexers/yaml.rb +10 -11
  50. data/lib/rouge/regex_lexer.rb +77 -92
  51. data/lib/rouge/token.rb +3 -3
  52. data/lib/rouge/util.rb +4 -4
  53. data/lib/rouge/version.rb +1 -1
  54. metadata +13 -4
@@ -1,9 +1,9 @@
1
1
  module Rouge
2
2
  class Token
3
3
  class << self
4
- def name; @name; end
5
- def parent; @parent; end
6
- def shortname; @shortname; end
4
+ attr_reader :name
5
+ attr_reader :parent
6
+ attr_reader :shortname
7
7
 
8
8
  def cache
9
9
  @cache ||= {}
@@ -72,14 +72,14 @@ module Rouge
72
72
  def starts_block(block_state)
73
73
  @block_state = block_state
74
74
  @block_indentation = @last_indentation || ''
75
- debug { " starts_block #{block_state.inspect}" }
76
- debug { " block_indentation: #{@block_indentation.inspect}" }
75
+ puts " starts_block #{block_state.inspect}" if @debug
76
+ puts " block_indentation: #{@block_indentation.inspect}" if @debug
77
77
  end
78
78
 
79
79
  # handle a single indented line
80
80
  def indentation(indent_str)
81
- debug { " indentation #{indent_str.inspect}" }
82
- debug { " block_indentation: #{@block_indentation.inspect}" }
81
+ puts " indentation #{indent_str.inspect}" if @debug
82
+ puts " block_indentation: #{@block_indentation.inspect}" if @debug
83
83
  @last_indentation = indent_str
84
84
 
85
85
  # if it's an indent and we know where to go next,
@@ -1,5 +1,5 @@
1
1
  module Rouge
2
2
  def self.version
3
- "1.1.0"
3
+ "1.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-05 00:00:00.000000000 Z
12
+ date: 2013-11-26 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
15
15
  email:
@@ -51,6 +51,7 @@ files:
51
51
  - lib/rouge/lexers/php/builtins.rb
52
52
  - lib/rouge/lexers/nginx.rb
53
53
  - lib/rouge/lexers/llvm.rb
54
+ - lib/rouge/lexers/scala.rb
54
55
  - lib/rouge/lexers/perl.rb
55
56
  - lib/rouge/lexers/groovy.rb
56
57
  - lib/rouge/lexers/sed.rb
@@ -71,6 +72,7 @@ files:
71
72
  - lib/rouge/lexers/tcl.rb
72
73
  - lib/rouge/lexers/tex.rb
73
74
  - lib/rouge/lexers/gherkin.rb
75
+ - lib/rouge/lexers/vb.rb
74
76
  - lib/rouge/lexers/rust.rb
75
77
  - lib/rouge/lexers/ini.rb
76
78
  - lib/rouge/lexers/scss.rb
@@ -99,8 +101,11 @@ files:
99
101
  - lib/rouge/lexers/cpp.rb
100
102
  - lib/rouge/lexers/sql.rb
101
103
  - lib/rouge/lexers/haskell.rb
104
+ - lib/rouge/lexers/matlab.rb
105
+ - lib/rouge/lexers/matlab/builtins.rb
102
106
  - lib/rouge/lexers/r.rb
103
107
  - lib/rouge/lexers/markdown.rb
108
+ - lib/rouge/lexers/ocaml.rb
104
109
  - lib/rouge/lexers/prolog.rb
105
110
  - lib/rouge/lexers/conf.rb
106
111
  - lib/rouge.rb
@@ -123,6 +128,7 @@ files:
123
128
  - lib/rouge/demos/perl
124
129
  - lib/rouge/demos/prolog
125
130
  - lib/rouge/demos/r
131
+ - lib/rouge/demos/scala
126
132
  - lib/rouge/demos/viml
127
133
  - lib/rouge/demos/haskell
128
134
  - lib/rouge/demos/css
@@ -146,6 +152,7 @@ files:
146
152
  - lib/rouge/demos/groovy
147
153
  - lib/rouge/demos/sml
148
154
  - lib/rouge/demos/nginx
155
+ - lib/rouge/demos/vb
149
156
  - lib/rouge/demos/toml
150
157
  - lib/rouge/demos/gherkin
151
158
  - lib/rouge/demos/http
@@ -161,7 +168,9 @@ files:
161
168
  - lib/rouge/demos/objective_c
162
169
  - lib/rouge/demos/sql
163
170
  - lib/rouge/demos/puppet
171
+ - lib/rouge/demos/matlab
164
172
  - lib/rouge/demos/ini
173
+ - lib/rouge/demos/ocaml
165
174
  - lib/rouge/demos/scheme
166
175
  - lib/rouge/demos/diff
167
176
  homepage: http://github.com/jayferd/rouge
@@ -172,17 +181,17 @@ rdoc_options: []
172
181
  require_paths:
173
182
  - lib
174
183
  required_ruby_version: !ruby/object:Gem::Requirement
184
+ none: false
175
185
  requirements:
176
186
  - - ! '>='
177
187
  - !ruby/object:Gem::Version
178
188
  version: '0'
179
- none: false
180
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
+ none: false
181
191
  requirements:
182
192
  - - ! '>='
183
193
  - !ruby/object:Gem::Version
184
194
  version: '0'
185
- none: false
186
195
  requirements: []
187
196
  rubyforge_project: rouge
188
197
  rubygems_version: 1.8.23