rouge 3.4.0 → 3.4.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5794858ca2a3090f6302e34bf98115e3dd56ad8b7abe30151c304b26ff414547
4
- data.tar.gz: e633c0de8ab7553b7873e75108a9fcd233b438fb93a19d5f317a8c3b83faf844
3
+ metadata.gz: b8b2c941a57cd61fef299dd3c106785c4b417872ec6cc1a50034cfcbbbff3187
4
+ data.tar.gz: 34ffb315c85b42b21e3a24a6ca0b7ea3ebbdbb8232057718da9c3cb355dbb693
5
5
  SHA512:
6
- metadata.gz: 11f8425d849b2f5f0307942c47b99a7504cf6c560d5ae8d87371b901d44ec610cd91b616c2eb6efae6bc0ce3064e0e336b83d2c2393461075f1d14498e239fc1
7
- data.tar.gz: d0d07ed86419b3c3b1043b1ff5fcfce7fce1da4fb1a1827edf861603e8f99b79e16b3aa4f2e0f4471eeafce8f79ff93b41cdb79d936afc68302af99fe7e82023
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(:debug)
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
- if @options.key?(name.to_s)
369
- as_bool(@options[name.to_s])
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
- def lex(string, opts=nil, &b)
419
- if opts
420
- warn 'the :continue option to Formatter#lex is deprecated, use #continue_lex instead.'
421
- return continue_lex(string, &b)
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
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Rouge
5
5
  def self.version
6
- "3.4.0"
6
+ "3.4.1"
7
7
  end
8
8
  end
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.0
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 00:00:00.000000000 Z
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: