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 +4 -4
- data/lib/bibtex/value.rb +1 -1
- data/lib/bibtex/version.rb +1 -1
- data/test/bibtex/test_entry.rb +21 -0
- 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: 31cdff476cee38ead2161b578b907daa073320391523659cc14d35e8fae5c052
|
4
|
+
data.tar.gz: e7e2a2c9ef27f881a3a8fc85897e4d3f3419759e35ad533a0bb47520ff88cb9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95b3fb3bd7dc0475202faf023971c3b6f89c12670dcc1cad00794e61af94cbeb3f348656f8a4c3d5f0ba9fed1c716b439588922ed84f68fb7dbf9f98cbf4e0a8
|
7
|
+
data.tar.gz: 74c852d9a65c060c10da882efcc192f8ec912b5dd95fa249678350a9bd82e9678e2cc052580dbe4ae712f065f6542480c4cb0705b387dda716c95d9d1e5545f5
|
data/lib/bibtex/value.rb
CHANGED
@@ -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
|
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])
|
data/lib/bibtex/version.rb
CHANGED
data/test/bibtex/test_entry.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2020-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: latex-decode
|