citeproc 1.0.2 → 1.0.3
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 +4 -4
- data/Gemfile +3 -3
- data/README.md +1 -1
- data/lib/citeproc/version.rb +1 -1
- data/spec/citeproc/attributes_spec.rb +1 -1
- data/spec/citeproc/bibliography_spec.rb +2 -2
- data/spec/citeproc/citation_data_spec.rb +4 -4
- data/spec/citeproc/date_spec.rb +73 -75
- data/spec/citeproc/item_spec.rb +2 -2
- data/spec/citeproc/names_spec.rb +3 -3
- data/spec/citeproc/processor_spec.rb +1 -1
- data/spec/citeproc/selector_spec.rb +4 -4
- data/spec/citeproc/variable_spec.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78ef5a51c4293349898a747075a3e904884843e1
|
4
|
+
data.tar.gz: 1f81ce6ed54bf27c657fd75ca0f4f1b737e7468f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab468c07a8248a0fc03d55bab26a5f20c96341f01a33ce5c971c1b604a24ba7e95c7945625ba35e8a79c1b28487adb6d1a9d4523054a2cbf43baf665a3e33936
|
7
|
+
data.tar.gz: f759c43e6235d3a52c5a14408909b8ad9f049cbb22391fba4efc2d3bff463d89c6e0b4849263d1f6a4be6614154fd7ef8e12ddc3e5c0aa9a28bd55f079381604
|
data/Gemfile
CHANGED
@@ -19,11 +19,11 @@ group :optional do
|
|
19
19
|
gem 'chronic', '~>0.10', :require => false
|
20
20
|
gem 'edtf', '~>2.1'
|
21
21
|
|
22
|
-
gem 'bibtex-ruby', '~>
|
22
|
+
gem 'bibtex-ruby', '~>4.0', :require => 'bibtex'
|
23
23
|
|
24
24
|
gem 'guard', '~>2.2'
|
25
25
|
gem 'guard-rspec', '~>4.2'
|
26
|
-
gem 'guard-cucumber', '~>
|
26
|
+
gem 'guard-cucumber', '~>2.0'
|
27
27
|
|
28
28
|
gem 'pry'
|
29
29
|
|
@@ -36,7 +36,7 @@ end
|
|
36
36
|
group :development do
|
37
37
|
gem 'rake'
|
38
38
|
gem 'cucumber'
|
39
|
-
gem 'rspec', '~>
|
39
|
+
gem 'rspec', '~>3.0'
|
40
40
|
gem 'simplecov', '~>0.8', :require => false
|
41
41
|
gem 'rubinius-coverage', :platform => :rbx
|
42
42
|
gem 'coveralls', :require => false
|
data/README.md
CHANGED
@@ -135,7 +135,7 @@ this project as part of [Google Summer of Code](https://developers.google.com/op
|
|
135
135
|
|
136
136
|
Copyright
|
137
137
|
---------
|
138
|
-
Copyright 2009-
|
138
|
+
Copyright 2009-2016 Sylvester Keil. All rights reserved.
|
139
139
|
|
140
140
|
Copyright 2012 President and Fellows of Harvard College.
|
141
141
|
|
data/lib/citeproc/version.rb
CHANGED
@@ -21,8 +21,8 @@ module CiteProc
|
|
21
21
|
|
22
22
|
describe CitationData do
|
23
23
|
|
24
|
-
it {
|
25
|
-
it {
|
24
|
+
it { is_expected.not_to be nil }
|
25
|
+
it { is_expected.to be_empty }
|
26
26
|
|
27
27
|
it 'has not been processed by default' do
|
28
28
|
expect(CitationData.new).not_to be_processed
|
@@ -61,8 +61,8 @@ module CiteProc
|
|
61
61
|
|
62
62
|
describe CitationItem do
|
63
63
|
|
64
|
-
it {
|
65
|
-
it {
|
64
|
+
it { is_expected.not_to be nil }
|
65
|
+
it { is_expected.to be_empty }
|
66
66
|
|
67
67
|
describe '.new' do
|
68
68
|
|
data/spec/citeproc/date_spec.rb
CHANGED
@@ -3,96 +3,94 @@ require 'spec_helper'
|
|
3
3
|
module CiteProc
|
4
4
|
describe Date do
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
expect(DateParts.new(1994,1,23)).to be < ::Date.today
|
38
|
-
end
|
6
|
+
describe Date::DateParts do
|
7
|
+
it { is_expected.not_to be_nil }
|
8
|
+
it { is_expected.to be_empty }
|
9
|
+
|
10
|
+
describe 'sorting' do
|
11
|
+
it 'treats [2003] as less than [2003,1]' do
|
12
|
+
expect(Date::DateParts.new(2003)).to be < Date::DateParts.new(2003,1)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'treats [1992,9,23] as less than [1993,8,22]' do
|
16
|
+
expect(Date::DateParts.new(1992,9,23)).to be < Date::DateParts.new(1993,8,22)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'treats [1992,9,23] as less than [1992,10,22]' do
|
20
|
+
expect(Date::DateParts.new(1992,9,23)).to be < Date::DateParts.new(1992,10,22)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'treats [1992,9,23] as less than [1992,9,24]' do
|
24
|
+
expect(Date::DateParts.new(1992,9,23)).to be < Date::DateParts.new(1992,9,24)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'treats [-50] as less than [-25]' do
|
28
|
+
expect(Date::DateParts.new(-50)).to be < Date::DateParts.new(-25)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'treats [-50] as less than [-50,12]' do
|
32
|
+
expect(Date::DateParts.new(-50)).to be < Date::DateParts.new(-50,12)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'treats [1994,1,23] as less than today' do
|
36
|
+
expect(Date::DateParts.new(1994,1,23)).to be < ::Date.today
|
39
37
|
end
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
40
|
+
describe '#dup' do
|
41
|
+
let(:date) { Date::DateParts.new(1991,8,22) }
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
it 'creates a copy that contains the same parts' do
|
44
|
+
expect(date.dup.to_a).to eq([1991,8,22])
|
45
|
+
end
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
47
|
+
it 'does not return self' do
|
48
|
+
expect(date.dup).not_to equal(date)
|
49
|
+
expect(date.dup).to eq(date)
|
52
50
|
end
|
51
|
+
end
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
describe '#update' do
|
54
|
+
it 'accepts a hash' do
|
55
|
+
expect(Date::DateParts.new.update(:month => 2, :year => 80).to_a).to eq([80,2,nil])
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
end
|
58
|
+
it 'accepts an array' do
|
59
|
+
expect(Date::DateParts.new.update([80,2]).to_a).to eq([80,2,nil])
|
62
60
|
end
|
61
|
+
end
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
63
|
+
describe '#strftime' do
|
64
|
+
it 'formats the date parts according to the format string' do
|
65
|
+
expect(Date::DateParts.new(1998,2,4).strftime('FOO %0m%0d%y')).to eq('FOO 020498')
|
68
66
|
end
|
67
|
+
end
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
describe 'to_citeproc' do
|
70
|
+
it 'returns an empty list by default' do
|
71
|
+
expect(Date::DateParts.new.to_citeproc).to eq([])
|
72
|
+
end
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
it 'returns a list with the year if only the year is set' do
|
75
|
+
expect(Date::DateParts.new(2001).to_citeproc).to eq([2001])
|
76
|
+
end
|
78
77
|
|
79
|
-
|
80
|
-
|
81
|
-
end
|
78
|
+
it 'supports zero parts' do
|
79
|
+
expect(Date::DateParts.new(0,0).to_citeproc).to eq([0,0])
|
82
80
|
end
|
81
|
+
end
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
83
|
+
describe '#open?' do
|
84
|
+
it 'returns false by default' do
|
85
|
+
expect(Date::DateParts.new).not_to be_open
|
86
|
+
end
|
88
87
|
|
89
|
-
|
90
|
-
|
91
|
-
|
88
|
+
it 'returns false for [1999,8,24]' do
|
89
|
+
expect(Date::DateParts.new(1999, 8, 24)).not_to be_open
|
90
|
+
end
|
92
91
|
|
93
|
-
|
94
|
-
|
95
|
-
end
|
92
|
+
it 'returns true for [0]' do
|
93
|
+
expect(Date::DateParts.new(0)).to be_open
|
96
94
|
end
|
97
95
|
end
|
98
96
|
end
|
@@ -107,9 +105,9 @@ module CiteProc
|
|
107
105
|
let(:ad50) { Date.create('date-parts' => [[50]]) }
|
108
106
|
let(:ad100) { Date.create('date-parts' => [[100]]) }
|
109
107
|
|
110
|
-
it {
|
108
|
+
it { is_expected.not_to be nil }
|
111
109
|
|
112
|
-
it {
|
110
|
+
it { is_expected.not_to be_numeric }
|
113
111
|
|
114
112
|
describe '.new' do
|
115
113
|
it 'accepts a hash as input' do
|
data/spec/citeproc/item_spec.rb
CHANGED
@@ -5,7 +5,7 @@ module CiteProc
|
|
5
5
|
|
6
6
|
|
7
7
|
describe '.new' do
|
8
|
-
it {
|
8
|
+
it { is_expected.not_to be nil }
|
9
9
|
|
10
10
|
it 'creates number variables for number fields' do
|
11
11
|
expect(Item.new(:edition => 23).edition).to be_a(Number)
|
@@ -32,7 +32,7 @@ module CiteProc
|
|
32
32
|
end
|
33
33
|
|
34
34
|
describe '#empty' do
|
35
|
-
it {
|
35
|
+
it { is_expected.to be_empty }
|
36
36
|
|
37
37
|
it 'returns false when there is at least one variable in the item' do
|
38
38
|
expect(Item.new(:title => 'foo')).not_to be_empty
|
data/spec/citeproc/names_spec.rb
CHANGED
@@ -70,7 +70,7 @@ module CiteProc
|
|
70
70
|
describe Name do
|
71
71
|
|
72
72
|
|
73
|
-
it {
|
73
|
+
it { is_expected.not_to be_nil }
|
74
74
|
|
75
75
|
describe 'formatting options' do
|
76
76
|
|
@@ -452,8 +452,8 @@ module CiteProc
|
|
452
452
|
Names.parse!('Erich Gamma and Richard Helm and Ralph Johnson and John Vlissides')
|
453
453
|
}
|
454
454
|
|
455
|
-
it {
|
456
|
-
it {
|
455
|
+
it { is_expected.not_to be nil }
|
456
|
+
it { is_expected.not_to be_numeric }
|
457
457
|
|
458
458
|
describe 'constructing' do
|
459
459
|
|
@@ -7,7 +7,7 @@ module CiteProc
|
|
7
7
|
let(:palefire) { Item.new(:id => 'palefire', :type => :book, :title => 'Pale Fire') }
|
8
8
|
let(:despair) { Item.new(:id => 'despair', :type => :book, :title => 'Despair') }
|
9
9
|
|
10
|
-
it {
|
10
|
+
it { is_expected.not_to be nil }
|
11
11
|
|
12
12
|
it { expect(p.engine).not_to be nil }
|
13
13
|
it { expect(p.engine.name).to eq('citeproc-ruby') }
|
@@ -6,8 +6,8 @@ module CiteProc
|
|
6
6
|
|
7
7
|
let(:select_books) { Selector.new(:all => { :type => :book }) }
|
8
8
|
|
9
|
-
it {
|
10
|
-
it {
|
9
|
+
it { is_expected.not_to be nil }
|
10
|
+
it { is_expected.to be_empty }
|
11
11
|
|
12
12
|
|
13
13
|
it 'should have no skip_condtions by default' do
|
@@ -76,13 +76,13 @@ module CiteProc
|
|
76
76
|
|
77
77
|
describe '#matches?' do
|
78
78
|
it 'always matches by default' do
|
79
|
-
expect(Selector.new.matches?(nil)).to
|
79
|
+
expect(Selector.new.matches?(nil)).to be_truthy
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
83
|
describe '#skip?' do
|
84
84
|
it 'never skips when by default' do
|
85
|
-
expect(Selector.new.skip?(nil)).to
|
85
|
+
expect(Selector.new.skip?(nil)).to be_falsey
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: citeproc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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:
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: namae
|
@@ -83,7 +83,7 @@ files:
|
|
83
83
|
- tasks/testsuite.rb
|
84
84
|
homepage: https://github.com/inukshuk/citeproc
|
85
85
|
licenses:
|
86
|
-
- AGPL
|
86
|
+
- AGPL-3.0
|
87
87
|
metadata: {}
|
88
88
|
post_install_message:
|
89
89
|
rdoc_options: []
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.5.1
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: A cite processor interface.
|