rouge 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rouge/lexer.rb +16 -9
- data/lib/rouge/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b2c941a57cd61fef299dd3c106785c4b417872ec6cc1a50034cfcbbbff3187
|
4
|
+
data.tar.gz: 34ffb315c85b42b21e3a24a6ca0b7ea3ebbdbb8232057718da9c3cb355dbb693
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b8c0b0109ce776e3744f03271adb71f8a486cff52c2df222eb69ece3a098aef9d7852b750629f8860007fae163274ea087208c22c821428b4a2757434a21b36
|
7
|
+
data.tar.gz: 291ee2e3d738fcdb181ed61b35511ad4c1dff44a90c359fe508fd23cdc939820766d662a1bba0dbbbbff1a5959f3a18ba71d87736f0ee9df8a0cbaf842528dfd
|
data/lib/rouge/lexer.rb
CHANGED
@@ -310,7 +310,7 @@ module Rouge
|
|
310
310
|
@options = {}
|
311
311
|
opts.each { |k, v| @options[k.to_s] = v }
|
312
312
|
|
313
|
-
@debug = Lexer.debug_enabled? && bool_option(
|
313
|
+
@debug = Lexer.debug_enabled? && bool_option('debug')
|
314
314
|
end
|
315
315
|
|
316
316
|
def as_bool(val)
|
@@ -365,8 +365,10 @@ module Rouge
|
|
365
365
|
end
|
366
366
|
|
367
367
|
def bool_option(name, &default)
|
368
|
-
|
369
|
-
|
368
|
+
name_str = name.to_s
|
369
|
+
|
370
|
+
if @options.key?(name_str)
|
371
|
+
as_bool(@options[name_str])
|
370
372
|
else
|
371
373
|
default ? default.call : false
|
372
374
|
end
|
@@ -415,16 +417,21 @@ module Rouge
|
|
415
417
|
|
416
418
|
# Given a string, yield [token, chunk] pairs. If no block is given,
|
417
419
|
# an enumerator is returned.
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
420
|
+
#
|
421
|
+
# @option opts :continue
|
422
|
+
# Continue the lex from the previous state (i.e. don't call #reset!)
|
423
|
+
#
|
424
|
+
# @note The use of `opts` has been deprecated. A warning is issued if run
|
425
|
+
# with `$VERBOSE` set to true.
|
426
|
+
def lex(string, opts={}, &b)
|
427
|
+
unless opts.nil?
|
428
|
+
warn 'The use of opts with Lexer.lex is deprecated' if $VERBOSE
|
422
429
|
end
|
423
430
|
|
424
|
-
return enum_for(:lex, string) unless block_given?
|
431
|
+
return enum_for(:lex, string, opts) unless block_given?
|
425
432
|
|
426
433
|
Lexer.assert_utf8!(string)
|
427
|
-
reset!
|
434
|
+
reset! unless opts[:continue]
|
428
435
|
|
429
436
|
continue_lex(string, &b)
|
430
437
|
end
|
data/lib/rouge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rouge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeanine Adkisson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
|
14
14
|
email:
|