bibtex-ruby 5.1.2 → 5.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9ac5e9768e0d7068c9283e81a5f678b57f5f5d0088050fd9568882277fe9a4f
4
- data.tar.gz: 5cdbb72904fd9836db7479b5eecfb3e0d89410798fd286b63e7ffd32c2a6701b
3
+ metadata.gz: 31cdff476cee38ead2161b578b907daa073320391523659cc14d35e8fae5c052
4
+ data.tar.gz: e7e2a2c9ef27f881a3a8fc85897e4d3f3419759e35ad533a0bb47520ff88cb9e
5
5
  SHA512:
6
- metadata.gz: 932db70949073cee21ee395c8b927b6e17fa065ffa90388f6092f69f758cf30580373ef039872221bb6aac933484850f9e734ced933a8c7699bceaa16d26b791
7
- data.tar.gz: f1b94a673dd9bc16a195de943c21264c189a6b6623c7abc641e1af554216bdf5b06ac141ef85061221f2aba460f72d6b9a3b52f4207a8feec5ca44ffb6b731f9
6
+ metadata.gz: 95b3fb3bd7dc0475202faf023971c3b6f89c12670dcc1cad00794e61af94cbeb3f348656f8a4c3d5f0ba9fed1c716b439588922ed84f68fb7dbf9f98cbf4e0a8
7
+ data.tar.gz: 74c852d9a65c060c10da882efcc192f8ec912b5dd95fa249678350a9bd82e9678e2cc052580dbe4ae712f065f6542480c4cb0705b387dda716c95d9d1e5545f5
@@ -180,7 +180,7 @@ module BibTeX
180
180
  # If the option :filter is given, the Value will be converted using
181
181
  # the filter(s) specified.
182
182
  def to_s(options = {})
183
- return convert(options.delete(:filter)).to_s(options) if options.key?(:filter)
183
+ return convert(options[:filter]).to_s(options.reject { |k,| k == :filter || (k == :quotes && (!atomic? || symbol?)) }) if options.key?(:filter)
184
184
  return value.to_s unless options.key?(:quotes) && atomic? && !symbol?
185
185
 
186
186
  q = Array(options[:quotes])
@@ -20,7 +20,7 @@ module BibTeX
20
20
  module Version
21
21
  MAJOR = 5
22
22
  MINOR = 1
23
- PATCH = 2
23
+ PATCH = 3
24
24
  BUILD = nil
25
25
 
26
26
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
@@ -483,6 +483,27 @@ module BibTeX
483
483
  end
484
484
  end
485
485
 
486
+ describe '#to_s' do
487
+ before do
488
+ @bib = Bibliography.parse(<<-BIBINPUT, { :parse_months => false })
489
+ @misc{foo,
490
+ title = {A
491
+ title},
492
+ series = {A
493
+ series},
494
+ month = dec
495
+ }
496
+ BIBINPUT
497
+ end
498
+ it 'applies filters when converting to strings' do
499
+ assert_equal "@misc{foo,\n"\
500
+ " title = {A title},\n"\
501
+ " series = {A series},\n"\
502
+ " month = dec\n"\
503
+ "}\n", @bib['foo'].to_s({ filter: :linebreaks })
504
+ end
505
+ end
506
+
486
507
  def test_simple
487
508
  bib = BibTeX::Bibliography.open(Test.fixtures(:entry), debug: false)
488
509
  refute_nil(bib)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibtex-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-27 00:00:00.000000000 Z
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: latex-decode