bibtex-ruby 3.1.3 → 3.1.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bibtex-ruby might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Guardfile +3 -1
- data/History.txt +6 -0
- data/lib/bibtex/entry.rb +9 -1
- data/lib/bibtex/entry/citeproc_converter.rb +4 -0
- data/lib/bibtex/version.rb +1 -1
- data/test/bibtex/test_entry.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 317de5c4dd2012e6f142328bbb333a691947fd9b
|
4
|
+
data.tar.gz: 29835b159b2edf43445c70bec6798f0fddc234c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d20eef168fa79d500bb09fc1851eea6db8b110e7d74d0c1590e9639d166f767ec566e664142f588b6ddaec80f8c4968a1b2d5e6641d198205655288a85197092
|
7
|
+
data.tar.gz: 99c2fc3003f9c4629a7a7ecee5b04ae3416b6cd294c3f31093876565405b5982966a779561c1c03ac17ae815ba66fbeb6ad13bb4cde83727af958276b7cafda4
|
data/Guardfile
CHANGED
@@ -8,8 +8,10 @@ guard 'cucumber' do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
guard 'minitest' do
|
11
|
+
ignore(%r|swp$|)
|
12
|
+
|
11
13
|
# with Minitest::Unit
|
12
|
-
watch(%r|^test/(.*)
|
14
|
+
watch(%r|^test/(.*)/?test_(.*)\.rb|)
|
13
15
|
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
14
16
|
watch(%r|^test/helper\.rb|) { 'test' }
|
15
17
|
|
data/History.txt
CHANGED
data/lib/bibtex/entry.rb
CHANGED
@@ -49,7 +49,7 @@ module BibTeX
|
|
49
49
|
}.freeze
|
50
50
|
|
51
51
|
|
52
|
-
NAME_FIELDS = [:author,:editor,:translator].freeze
|
52
|
+
NAME_FIELDS = [:author,:editor,:translator,:director,:producer,:composer].freeze
|
53
53
|
DATE_FIELDS = [:year,:month].freeze
|
54
54
|
|
55
55
|
MONTHS = [:jan,:feb,:mar,:apr,:may,:jun,:jul,:aug,:sep,:oct,:nov,:dec].freeze
|
@@ -109,6 +109,14 @@ module BibTeX
|
|
109
109
|
self
|
110
110
|
end
|
111
111
|
|
112
|
+
def update(fields)
|
113
|
+
fields.each do |name, value|
|
114
|
+
add name, value
|
115
|
+
end
|
116
|
+
|
117
|
+
self
|
118
|
+
end
|
119
|
+
|
112
120
|
# Generate accessors for required fields (#52)
|
113
121
|
REQUIRED_FIELDS.values.flatten.uniq.each do |name|
|
114
122
|
define_method(name) do
|
@@ -105,6 +105,10 @@ class BibTeX::Entry::CiteProcConverter
|
|
105
105
|
if bibtex.field?(:month)
|
106
106
|
parts.push BibTeX::Entry::MONTHS.find_index(bibtex[:month].to_s.intern)
|
107
107
|
parts[1] = parts[1] + 1 unless parts[1].nil?
|
108
|
+
|
109
|
+
if bibtex.field?(:day)
|
110
|
+
parts.push bibtex[:day]
|
111
|
+
end
|
108
112
|
end
|
109
113
|
|
110
114
|
hash['issued'] = { 'date-parts' => [parts.compact.map(&:to_i)] }
|
data/lib/bibtex/version.rb
CHANGED
data/test/bibtex/test_entry.rb
CHANGED
@@ -321,6 +321,11 @@ module BibTeX
|
|
321
321
|
e = @entry.to_citeproc
|
322
322
|
assert_equal({ 'literal' => 'Test' }, e['issued'])
|
323
323
|
end
|
324
|
+
|
325
|
+
it 'combines year, month and day in issued date' do
|
326
|
+
@entry.update :year => 2005, :month => 5, :day => 31
|
327
|
+
assert_equal [[2005, 5, 31]], @entry.to_citeproc['issued']['date-parts']
|
328
|
+
end
|
324
329
|
end
|
325
330
|
|
326
331
|
describe 'given a filter object or a filter name' do
|
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: 3.1.
|
4
|
+
version: 3.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: latex-decode
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.2.
|
148
|
+
rubygems_version: 2.2.2
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: A BibTeX parser, converter and API for Ruby.
|