citeproc-ruby 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: d7e27a2fa38bed79e8ede700e8c56dcdf3c85385
4
- data.tar.gz: e3dca73a24fe2e19af75a443c3ab421a648840d0
3
+ metadata.gz: 921caaacab669f170d0b1043a7b0aa9d33a611bc
4
+ data.tar.gz: 0775a1787a30941529cc07fb21a9dc0244f094ba
5
5
  SHA512:
6
- metadata.gz: 0378f97fc8968a919bea8128dfba1552b1dd4142a344fcff8ff79317868205f6978594efa870736436278748eee0f7e5a9816e80e07657351fb5a6f5421d0998
7
- data.tar.gz: 8f008779a3f1d1aa21025daf6d24aa3ea288ad38b4961458c9a631ecaa51549fe01c5210fe0ce9106527dbfb5edbbfa96648089982377fa951c3c8bb50061298
6
+ metadata.gz: 608a8459ad04db43c67430c8959a4847209303f5563690a71ef71088135a3c7615f4f6b180a1aad9710b39d28d18d49fbe3826279b1a77adde18d26fcf455acc
7
+ data.tar.gz: 55700a7d962669f7c1e02c38c42ae9e050b1b686b2425a41e6a2861aa4010e14746c4652cd21912644b69c5e616539984906261bc0bc4bbd434491a8e7f6939c
data/Gemfile CHANGED
@@ -1,13 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- #gem 'citeproc', :github => 'inukshuk/citeproc.git'
5
- #gem 'csl', :github => 'inukshuk/csl-ruby.git'
4
+ #gem 'citeproc', :github => 'inukshuk/citeproc'
5
+ #gem 'csl', :github => 'inukshuk/csl-ruby'
6
6
 
7
7
  group :development, :test do
8
8
  gem 'rake', '~>10.0'
9
9
  gem 'rspec', '~>3.0', '<3.2.0'
10
- gem 'cucumber', '~>1.2'
10
+ gem 'cucumber', '~>2.3'
11
11
  gem 'simplecov', '~>0.8'
12
12
  gem 'rubinius-coverage', :platforms => :rbx
13
13
  gem 'coveralls', :require => false
@@ -2,13 +2,20 @@ Given(/^the following style:$/) do |string|
2
2
  @style = CSL::Style.parse!(string)
3
3
  end
4
4
 
5
- When(/^I cite the following items as "(.*?)":$/) do |format, items|
6
- processor = CiteProc::Processor.new :style => @style, format: format
5
+ Given(/^the "(.*?)" style$/) do |style|
6
+ @style = CSL::Style.load(style)
7
+ end
8
+
9
+ When(/^I (cite|reference) the following items as "(.*?)":$/) do |mode, format, items|
10
+ processor = CiteProc::Processor.new :style => @style, format: format, locale: @locale
11
+ mode = if mode == 'cite' then :citation else :bibliography end
7
12
 
8
13
  processor.import items.hashes.map.with_index { |data, idx|
9
14
  data[:id] = "ID-#{idx}"
10
15
  data
11
16
  }
12
17
 
13
- @results = processor.items.keys.map { |id| processor.process :id => id }
18
+ @results = processor.items.keys.map { |id|
19
+ processor.render mode, :id => id
20
+ }.flatten
14
21
  end
@@ -15,8 +15,13 @@ Given(/^the following macro:$/) do |string|
15
15
  @macro = CSL.parse!(string, CSL::Style)
16
16
  end
17
17
 
18
+ Given(/^the "(.*?)" locale$/) do |locale|
19
+ @locale = locale
20
+ end
21
+
18
22
  When(/^I render the following citation items as "(.*?)":$/) do |format, items|
19
- r = CiteProc::Ruby::Renderer.new(:format => format)
23
+ @locale ||= 'en'
24
+ r = CiteProc::Ruby::Renderer.new(:format => format, :locale => @locale)
20
25
 
21
26
  @results = items.hashes.map.with_index do |data, idx|
22
27
  i = CiteProc::CitationItem.new(:id => "ID-#{idx}")
@@ -0,0 +1,30 @@
1
+ Feature: Rendering bibliography nodes
2
+ As a hacker of cite processors
3
+ I want to render citation items
4
+ Using bibliography nodes
5
+
6
+ Scenario: Rendering APA style bibliographies as text in English
7
+ Given the "apa-with-different-translations" style
8
+ When I reference the following items as "text":
9
+ | type | author | title | issued | translator |
10
+ | book | Thomas Pynchon | The crying of lot 49 | July 7, 2006 | Harald Hard |
11
+ Then the results should be:
12
+ | Pynchon, T. (2006). The crying of lot 49. (H. Hard, Who translated this piece on her/his own). |
13
+
14
+ Scenario: Rendering APA style bibliographies as text in French
15
+ Given the "apa-with-different-translations" style
16
+ Given the "fr" locale
17
+ When I reference the following items as "text":
18
+ | type | author | title | issued | translator |
19
+ | book | Thomas Pynchon | The crying of lot 49 | July 7, 2006 | Harald Hard |
20
+ Then the results should be:
21
+ | Pynchon, T. (2006). The crying of lot 49. (H. Hard, Le merveilleux traducteur). |
22
+
23
+ Scenario: Rendering APA style bibliographies as text in German (a language where the style has no explicit terms for)
24
+ Given the "apa-with-different-translations" style
25
+ Given the "de" locale
26
+ When I reference the following items as "text":
27
+ | type | author | title | issued | translator |
28
+ | book | Thomas Pynchon | The crying of lot 49 | July 7, 2006 | Harald Hard |
29
+ Then the results should be:
30
+ | Pynchon, T. (2006). The crying of lot 49. (H. Hard, Übers.). |
@@ -89,7 +89,6 @@ module CiteProc
89
89
  new_locale = CSL::Locale.load(item.language)
90
90
 
91
91
  unless new_locale.nil?
92
- new_locale.merge!(locale)
93
92
  original_locale, @locale = @locale, new_locale
94
93
  end
95
94
  rescue ParseError
@@ -13,6 +13,8 @@ module CiteProc
13
13
  date = item.data[node.variable]
14
14
  return '' if date.nil? || date.empty?
15
15
 
16
+ return date.to_s if date.literal?
17
+
16
18
  # TODO date-ranges
17
19
 
18
20
  if node.localized?
@@ -1,5 +1,5 @@
1
1
  module CiteProc
2
2
  module Ruby
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
@@ -40,6 +40,7 @@ module CiteProc
40
40
  cp << items(:grammatology).data
41
41
  cp << items(:knuth1968).data
42
42
  cp << items(:difference).data
43
+ cp << items(:literal_date).data
43
44
  end
44
45
 
45
46
  it 'renders the reference for the given id' do
@@ -62,6 +63,10 @@ module CiteProc
62
63
  cp.options[:allow_locale_overrides] = true
63
64
  expect(cp.render(:bibliography, :id => 'difference')).to eq(['Derrida, J. (1967). L’écriture et la différence (1ʳᵉ éd.). Paris: Éditions du Seuil.'])
64
65
  end
66
+
67
+ it 'can handle literal dates' do
68
+ expect(cp.render(:bibliography, :id => 'literal_date')).to eq(['Derrida, J. (sometime in 1967). L’écriture et la différence (1st ed.). Paris: Éditions du Seuil.'])
69
+ end
65
70
  end
66
71
  end
67
72
 
@@ -10,7 +10,7 @@ module CiteProc
10
10
  i.data = CiteProc::Item.new(:id => 'ID-1')
11
11
  i
12
12
  }
13
-
13
+
14
14
  describe 'Renderer#render_choose' do
15
15
  let(:node) { CSL::Style::Choose.new }
16
16
 
@@ -65,7 +65,7 @@ module CiteProc
65
65
 
66
66
  it 'fails if there is an unknown condition type' do
67
67
  allow(node).to receive(:conditions).and_return([[:unknown, :all?, 'x']])
68
- expect { renderer.evaluates?(item, node) }.to raise_error
68
+ expect { renderer.evaluates?(item, node) }.to raise_error(RuntimeError)
69
69
  end
70
70
 
71
71
  it 'returns false for disambiguate (implementation pending)' do
@@ -83,7 +83,7 @@ module CiteProc
83
83
 
84
84
  it 'returns false unless all variables are numeric' do
85
85
  expect(renderer.evaluates?(item, node)).to be_falsey
86
-
86
+
87
87
  item.data[:archive] = 1
88
88
  expect(renderer.evaluates?(item, node)).to be_falsey
89
89
 
@@ -72,6 +72,19 @@ module Fixtures
72
72
  :language => 'fr',
73
73
  :publisher => 'Éditions du Seuil',
74
74
  :'publisher-place' => 'Paris'
75
+ ),
76
+
77
+ :literal_date => CiteProc::Item.new(
78
+ :id => 'literal_date',
79
+ :type => 'book',
80
+ :title => 'L’écriture et la différence',
81
+ :author => @people[:derrida],
82
+ :issued => { 'literal' => 'sometime in 1967' },
83
+ :edition => 1,
84
+ :pages => 446,
85
+ :language => 'fr',
86
+ :publisher => 'Éditions du Seuil',
87
+ :'publisher-place' => 'Paris'
75
88
  )
76
89
 
77
90
  }
@@ -0,0 +1,298 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="de-DE">
3
+ <info>
4
+ <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
5
+ <updated>2012-07-04T23:31:02+00:00</updated>
6
+ </info>
7
+ <style-options punctuation-in-quote="false"/>
8
+ <date form="text">
9
+ <date-part name="day" suffix=". "/>
10
+ <date-part name="month" suffix=" "/>
11
+ <date-part name="year"/>
12
+ </date>
13
+ <date form="numeric">
14
+ <date-part name="day" form="numeric-leading-zeros" suffix="."/>
15
+ <date-part name="month" form="numeric-leading-zeros" suffix="."/>
16
+ <date-part name="year"/>
17
+ </date>
18
+ <terms>
19
+ <term name="accessed">zugegriffen</term>
20
+ <term name="and">und</term>
21
+ <term name="and others">und andere</term>
22
+ <term name="anonymous">ohne Autor</term>
23
+ <term name="anonymous" form="short">o. A.</term>
24
+ <term name="at">auf</term>
25
+ <term name="available at">verfügbar unter</term>
26
+ <term name="by">von</term>
27
+ <term name="circa">circa</term>
28
+ <term name="circa" form="short">ca.</term>
29
+ <term name="cited">zitiert</term>
30
+ <term name="edition">
31
+ <single>Auflage</single>
32
+ <multiple>Auflagen</multiple>
33
+ </term>
34
+ <term name="edition" form="short">Aufl.</term>
35
+ <term name="et-al">u. a.</term>
36
+ <term name="forthcoming">i. E.</term>
37
+ <term name="from">von</term>
38
+ <term name="ibid">ebd.</term>
39
+ <term name="in">in</term>
40
+ <term name="in press">im Druck</term>
41
+ <term name="internet">Internet</term>
42
+ <term name="interview">Interview</term>
43
+ <term name="letter">Brief</term>
44
+ <term name="no date">ohne Datum</term>
45
+ <term name="no date" form="short">o. J.</term>
46
+ <term name="online">online</term>
47
+ <term name="presented at">gehalten auf der</term>
48
+ <term name="reference">
49
+ <single>Referenz</single>
50
+ <multiple>Referenzen</multiple>
51
+ </term>
52
+ <term name="reference" form="short">
53
+ <single>Ref.</single>
54
+ <multiple>Ref.</multiple>
55
+ </term>
56
+ <term name="retrieved">abgerufen</term>
57
+ <term name="scale">Maßstab</term>
58
+ <term name="version">Version</term>
59
+
60
+ <!-- ANNO DOMINI; BEFORE CHRIST -->
61
+ <term name="ad">n. Chr.</term>
62
+ <term name="bc">v. Chr.</term>
63
+
64
+ <!-- PUNCTUATION -->
65
+ <term name="open-quote">„</term>
66
+ <term name="close-quote">“</term>
67
+ <term name="open-inner-quote">‚</term>
68
+ <term name="close-inner-quote">‘</term>
69
+ <term name="page-range-delimiter">–</term>
70
+
71
+ <!-- ORDINALS -->
72
+ <term name="ordinal">.</term>
73
+
74
+ <!-- LONG ORDINALS -->
75
+ <term name="long-ordinal-01">erster</term>
76
+ <term name="long-ordinal-02">zweiter</term>
77
+ <term name="long-ordinal-03">dritter</term>
78
+ <term name="long-ordinal-04">vierter</term>
79
+ <term name="long-ordinal-05">fünfter</term>
80
+ <term name="long-ordinal-06">sechster</term>
81
+ <term name="long-ordinal-07">siebter</term>
82
+ <term name="long-ordinal-08">achter</term>
83
+ <term name="long-ordinal-09">neunter</term>
84
+ <term name="long-ordinal-10">zehnter</term>
85
+
86
+ <!-- LONG LOCATOR FORMS -->
87
+ <term name="book">
88
+ <single>Buch</single>
89
+ <multiple>Bücher</multiple>
90
+ </term>
91
+ <term name="chapter">
92
+ <single>Kapitel</single>
93
+ <multiple>Kapitel</multiple>
94
+ </term>
95
+ <term name="column">
96
+ <single>Spalte</single>
97
+ <multiple>Spalten</multiple>
98
+ </term>
99
+ <term name="figure">
100
+ <single>Abbildung</single>
101
+ <multiple>Abbildungen</multiple>
102
+ </term>
103
+ <term name="folio">
104
+ <single>Blatt</single>
105
+ <multiple>Blätter</multiple>
106
+ </term>
107
+ <term name="issue">
108
+ <single>Nummer</single>
109
+ <multiple>Nummern</multiple>
110
+ </term>
111
+ <term name="line">
112
+ <single>Zeile</single>
113
+ <multiple>Zeilen</multiple>
114
+ </term>
115
+ <term name="note">
116
+ <single>Note</single>
117
+ <multiple>Noten</multiple>
118
+ </term>
119
+ <term name="opus">
120
+ <single>Opus</single>
121
+ <multiple>Opera</multiple>
122
+ </term>
123
+ <term name="page">
124
+ <single>Seite</single>
125
+ <multiple>Seiten</multiple>
126
+ </term>
127
+ <term name="paragraph">
128
+ <single>Absatz</single>
129
+ <multiple>Absätze</multiple>
130
+ </term>
131
+ <term name="part">
132
+ <single>Teil</single>
133
+ <multiple>Teile</multiple>
134
+ </term>
135
+ <term name="section">
136
+ <single>Abschnitt</single>
137
+ <multiple>Abschnitte</multiple>
138
+ </term>
139
+ <term name="sub verbo">
140
+ <single>sub verbo</single>
141
+ <multiple>sub verbis</multiple>
142
+ </term>
143
+ <term name="verse">
144
+ <single>Vers</single>
145
+ <multiple>Verse</multiple>
146
+ </term>
147
+ <term name="volume">
148
+ <single>Band</single>
149
+ <multiple>Bände</multiple>
150
+ </term>
151
+
152
+ <!-- SHORT LOCATOR FORMS -->
153
+ <term name="book" form="short">B.</term>
154
+ <term name="chapter" form="short">Kap.</term>
155
+ <term name="column" form="short">Sp.</term>
156
+ <term name="figure" form="short">Abb.</term>
157
+ <term name="folio" form="short">Fol.</term>
158
+ <term name="issue" form="short">Nr.</term>
159
+ <term name="line" form="short">l.</term>
160
+ <term name="note" form="short">n.</term>
161
+ <term name="opus" form="short">op.</term>
162
+ <term name="page" form="short">
163
+ <single>S.</single>
164
+ <multiple>S.</multiple>
165
+ </term>
166
+ <term name="paragraph" form="short">Abs.</term>
167
+ <term name="part" form="short">Teil</term>
168
+ <term name="section" form="short">Abschn.</term>
169
+ <term name="sub verbo" form="short">
170
+ <single>s.v.</single>
171
+ <multiple>s.vv.</multiple>
172
+ </term>
173
+ <term name="verse" form="short">
174
+ <single>V.</single>
175
+ <multiple>V.</multiple>
176
+ </term>
177
+ <term name="volume" form="short">
178
+ <single>Bd.</single>
179
+ <multiple>Bd.</multiple>
180
+ </term>
181
+
182
+ <!-- SYMBOL LOCATOR FORMS -->
183
+ <term name="paragraph" form="symbol">
184
+ <single>¶</single>
185
+ <multiple>¶¶</multiple>
186
+ </term>
187
+ <term name="section" form="symbol">
188
+ <single>§</single>
189
+ <multiple>§§</multiple>
190
+ </term>
191
+
192
+ <!-- LONG ROLE FORMS -->
193
+ <term name="director">
194
+ <single>Regisseur</single>
195
+ <multiple>Regisseure</multiple>
196
+ </term>
197
+ <term name="editor">
198
+ <single>Herausgeber</single>
199
+ <multiple>Herausgeber</multiple>
200
+ </term>
201
+ <term name="editorial-director">
202
+ <single>Herausgeber</single>
203
+ <multiple>Herausgeber</multiple>
204
+ </term>
205
+ <term name="illustrator">
206
+ <single>Illustrator</single>
207
+ <multiple>illustratoren</multiple>
208
+ </term>
209
+ <term name="translator">
210
+ <single>Übersetzer</single>
211
+ <multiple>Übersetzer</multiple>
212
+ </term>
213
+ <term name="editortranslator">
214
+ <single>Herausgeber &amp; Übersetzer</single>
215
+ <multiple>Herausgeber &amp; Übersetzer</multiple>
216
+ </term>
217
+
218
+ <!-- SHORT ROLE FORMS -->
219
+ <term name="director" form="short">
220
+ <single>Reg.</single>
221
+ <multiple>Reg..</multiple>
222
+ </term>
223
+ <term name="editor" form="short">
224
+ <single>Hrsg.</single>
225
+ <multiple>Hrsg.</multiple>
226
+ </term>
227
+ <term name="editorial-director" form="short">
228
+ <single>Hrsg.</single>
229
+ <multiple>Hrsg.</multiple>
230
+ </term>
231
+ <term name="illustrator" form="short">
232
+ <single>Ill.</single>
233
+ <multiple>Ill.</multiple>
234
+ </term>
235
+ <term name="translator" form="short">
236
+ <single>Übers.</single>
237
+ <multiple>Übers.</multiple>
238
+ </term>
239
+ <term name="editortranslator" form="short">
240
+ <single>Hrsg. &amp; Übers.</single>
241
+ <multiple>Hrsg. &amp; Übers</multiple>
242
+ </term>
243
+
244
+ <!-- VERB ROLE FORMS -->
245
+ <term name="director" form="verb">directed by</term>
246
+ <term name="editor" form="verb">herausgegeben von</term>
247
+ <term name="editorial-director" form="verb">herausgegeben von</term>
248
+ <term name="illustrator" form="verb">illustriert von</term>
249
+ <term name="interviewer" form="verb">interviewt von</term>
250
+ <term name="recipient" form="verb">an</term>
251
+ <term name="reviewed-author" form="verb">von</term>
252
+ <term name="translator" form="verb">übersetzt von</term>
253
+ <term name="editortranslator" form="verb">herausgegeben und übersetzt von</term>
254
+
255
+ <!-- SHORT VERB ROLE FORMS -->
256
+ <term name="container-author" form="verb-short">von</term>
257
+ <term name="director" form="verb-short">Reg.</term>
258
+ <term name="editor" form="verb-short">hg. von</term>
259
+ <term name="editorial-director" form="verb-short">hg. von</term>
260
+ <term name="illustrator" form="verb-short">illus. von</term>
261
+ <term name="translator" form="verb-short">übers. von</term>
262
+ <term name="editortranslator" form="verb-short">hg. &amp; übers. von</term>
263
+
264
+ <!-- LONG MONTH FORMS -->
265
+ <term name="month-01">Januar</term>
266
+ <term name="month-02">Februar</term>
267
+ <term name="month-03">März</term>
268
+ <term name="month-04">April</term>
269
+ <term name="month-05">Mai</term>
270
+ <term name="month-06">Juni</term>
271
+ <term name="month-07">Juli</term>
272
+ <term name="month-08">August</term>
273
+ <term name="month-09">September</term>
274
+ <term name="month-10">Oktober</term>
275
+ <term name="month-11">November</term>
276
+ <term name="month-12">Dezember</term>
277
+
278
+ <!-- SHORT MONTH FORMS -->
279
+ <term name="month-01" form="short">Jan.</term>
280
+ <term name="month-02" form="short">Feb.</term>
281
+ <term name="month-03" form="short">März</term>
282
+ <term name="month-04" form="short">Apr.</term>
283
+ <term name="month-05" form="short">Mai</term>
284
+ <term name="month-06" form="short">Juni</term>
285
+ <term name="month-07" form="short">Juli</term>
286
+ <term name="month-08" form="short">Aug.</term>
287
+ <term name="month-09" form="short">Sep.</term>
288
+ <term name="month-10" form="short">Okt.</term>
289
+ <term name="month-11" form="short">Nov.</term>
290
+ <term name="month-12" form="short">Dez.</term>
291
+
292
+ <!-- SEASONS -->
293
+ <term name="season-01">Frühjahr</term>
294
+ <term name="season-02">Sommer</term>
295
+ <term name="season-03">Herbst</term>
296
+ <term name="season-04">Winter</term>
297
+ </terms>
298
+ </locale>
@@ -0,0 +1,451 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never">
3
+ <info>
4
+ <title>American Psychological Association 6th Edition</title>
5
+ <id>http://www.zotero.org/styles/apa-with-different-translations</id>
6
+ <link href="http://www.zotero.org/styles/apa-with-different-translations" rel="self"/>
7
+ <link href="http://owl.english.purdue.edu/owl/resource/560/01/" rel="documentation"/>
8
+ <author>
9
+ <name>Simon Kornblith</name>
10
+ <email>simon@simonster.com</email>
11
+ </author>
12
+ <contributor>
13
+ <name>Bruce D'Arcus</name>
14
+ </contributor>
15
+ <contributor>
16
+ <name>Curtis M. Humphrey</name>
17
+ </contributor>
18
+ <contributor>
19
+ <name>Richard Karnesky</name>
20
+ <email>karnesky+zotero@gmail.com</email>
21
+ <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
22
+ </contributor>
23
+ <contributor>
24
+ <name>Sebastian Karcher</name>
25
+ </contributor>
26
+ <category field="psychology"/>
27
+ <category field="generic-base"/>
28
+ <category citation-format="author-date"/>
29
+ <updated>2010-01-27T20:08:03+00:00</updated>
30
+ <rights>This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/</rights>
31
+ </info>
32
+ <locale xml:lang="en">
33
+ <terms>
34
+ <term name="translator" form="short">
35
+ <single>Who translated this piece on her/his own</single>
36
+ <multiple>Who translated this piece together</multiple>
37
+ </term>
38
+ </terms>
39
+ </locale>
40
+ <locale xml:lang="fr">
41
+ <terms>
42
+ <term name="translator" form="short">
43
+ <single>le merveilleux traducteur</single>
44
+ <multiple>les traducteurs merveilleux</multiple>
45
+ </term>
46
+ </terms>
47
+ </locale>
48
+ <macro name="container-contributors">
49
+ <choose>
50
+ <if type="chapter paper-conference" match="any">
51
+ <text term="in" text-case="capitalize-first" suffix=" "/>
52
+ <names variable="editor" delimiter=", " suffix=", ">
53
+ <name and="symbol" initialize-with=". " delimiter=", "/>
54
+ <label form="short" prefix=" (" text-case="capitalize-first" suffix=")"/>
55
+ <substitute>
56
+ <names variable="translator"/>
57
+ </substitute>
58
+ </names>
59
+ </if>
60
+ </choose>
61
+ </macro>
62
+ <macro name="secondary-contributors">
63
+ <choose>
64
+ <if type="chapter paper-conference" match="none">
65
+ <names variable="translator" delimiter=", " prefix=" (" suffix=")">
66
+ <name and="symbol" initialize-with=". " delimiter=", "/>
67
+ <label form="short" prefix=", " text-case="capitalize-first" suffix=""/>
68
+ <substitute>
69
+ <names variable="editor"/>
70
+ </substitute>
71
+ </names>
72
+ </if>
73
+ </choose>
74
+ </macro>
75
+ <macro name="author">
76
+ <names variable="author">
77
+ <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
78
+ <label form="short" prefix=" (" suffix=".)" text-case="capitalize-first" strip-periods="true"/>
79
+ <substitute>
80
+ <names variable="editor"/>
81
+ <names variable="translator"/>
82
+ <choose>
83
+ <if type="report">
84
+ <text variable="publisher"/>
85
+ <text macro="title"/>
86
+ </if>
87
+ <else>
88
+ <text macro="title"/>
89
+ </else>
90
+ </choose>
91
+ </substitute>
92
+ </names>
93
+ </macro>
94
+ <macro name="author-short">
95
+ <names variable="author">
96
+ <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
97
+ <substitute>
98
+ <names variable="editor"/>
99
+ <names variable="translator"/>
100
+ <choose>
101
+ <if type="report">
102
+ <text variable="publisher"/>
103
+ <text variable="title" form="short" font-style="italic"/>
104
+ </if>
105
+ <else-if type="bill book graphic legal_case legislation motion_picture song" match="any">
106
+ <text variable="title" form="short" font-style="italic"/>
107
+ </else-if>
108
+ <else>
109
+ <text variable="title" form="short" quotes="true"/>
110
+ </else>
111
+ </choose>
112
+ </substitute>
113
+ </names>
114
+ </macro>
115
+ <macro name="access">
116
+ <choose>
117
+ <if type="thesis">
118
+ <choose>
119
+ <if variable="archive" match="any">
120
+ <group>
121
+ <text term="retrieved" text-case="capitalize-first" suffix=" "/>
122
+ <text term="from" suffix=" "/>
123
+ <text variable="archive" suffix="."/>
124
+ <text variable="archive_location" prefix=" (" suffix=")"/>
125
+ </group>
126
+ </if>
127
+ <else>
128
+ <group>
129
+ <text term="retrieved" text-case="capitalize-first" suffix=" "/>
130
+ <text term="from" suffix=" "/>
131
+ <text variable="URL"/>
132
+ </group>
133
+ </else>
134
+ </choose>
135
+ </if>
136
+ <else>
137
+ <choose>
138
+ <if variable="DOI">
139
+ <text variable="DOI" prefix="doi:"/>
140
+ </if>
141
+ <else>
142
+ <choose>
143
+ <if type="webpage">
144
+ <group delimiter=" ">
145
+ <text term="retrieved" text-case="capitalize-first" suffix=" "/>
146
+ <group>
147
+ <date variable="accessed" suffix=", ">
148
+ <date-part name="month" suffix=" "/>
149
+ <date-part name="day" suffix=", "/>
150
+ <date-part name="year"/>
151
+ </date>
152
+ </group>
153
+ <text term="from"/>
154
+ <text variable="URL"/>
155
+ </group>
156
+ </if>
157
+ <else>
158
+ <group>
159
+ <text term="retrieved" text-case="capitalize-first" suffix=" "/>
160
+ <text term="from" suffix=" "/>
161
+ <text variable="URL"/>
162
+ </group>
163
+ </else>
164
+ </choose>
165
+ </else>
166
+ </choose>
167
+ </else>
168
+ </choose>
169
+ </macro>
170
+ <macro name="title">
171
+ <choose>
172
+ <if type="report thesis" match="any">
173
+ <text variable="title" font-style="italic"/>
174
+ <group prefix=" (" suffix=")" delimiter=" ">
175
+ <text variable="genre"/>
176
+ <text variable="number" prefix="No. "/>
177
+ </group>
178
+ </if>
179
+ <else-if type="book graphic motion_picture report song manuscript speech" match="any">
180
+ <text variable="title" font-style="italic"/>
181
+ </else-if>
182
+ <else>
183
+ <text variable="title"/>
184
+ </else>
185
+ </choose>
186
+ </macro>
187
+ <macro name="publisher">
188
+ <choose>
189
+ <if type="report" match="any">
190
+ <group delimiter=": ">
191
+ <text variable="publisher-place"/>
192
+ <text variable="publisher"/>
193
+ </group>
194
+ </if>
195
+ <else-if type="thesis" match="any">
196
+ <group delimiter=", ">
197
+ <text variable="publisher"/>
198
+ <text variable="publisher-place"/>
199
+ </group>
200
+ </else-if>
201
+ <else>
202
+ <group delimiter=", ">
203
+ <choose>
204
+ <if variable="event" match="none">
205
+ <text variable="genre"/>
206
+ </if>
207
+ </choose>
208
+ <choose>
209
+ <if type="article-journal article-magazine" match="none">
210
+ <group delimiter=": ">
211
+ <text variable="publisher-place"/>
212
+ <text variable="publisher"/>
213
+ </group>
214
+ </if>
215
+ </choose>
216
+ </group>
217
+ </else>
218
+ </choose>
219
+ </macro>
220
+ <macro name="event">
221
+ <choose>
222
+ <if variable="event">
223
+ <choose>
224
+ <if variable="genre" match="none">
225
+ <text term="presented at" text-case="capitalize-first" suffix=" "/>
226
+ <text variable="event"/>
227
+ </if>
228
+ <else>
229
+ <group delimiter=" ">
230
+ <text variable="genre" text-case="capitalize-first"/>
231
+ <text term="presented at"/>
232
+ <text variable="event"/>
233
+ </group>
234
+ </else>
235
+ </choose>
236
+ </if>
237
+ </choose>
238
+ </macro>
239
+ <macro name="issued">
240
+ <choose>
241
+ <if type="bill legal_case legislation" match="none">
242
+ <choose>
243
+ <if variable="issued">
244
+ <group prefix=" (" suffix=").">
245
+ <date variable="issued">
246
+ <date-part name="year"/>
247
+ </date>
248
+ <text variable="year-suffix"/>
249
+ <choose>
250
+ <if type="article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="none">
251
+ <date variable="issued">
252
+ <date-part prefix=", " name="month"/>
253
+ <date-part prefix=" " name="day"/>
254
+ </date>
255
+ </if>
256
+ </choose>
257
+ </group>
258
+ </if>
259
+ <else>
260
+ <group prefix=" (" suffix=").">
261
+ <text term="no date" form="short"/>
262
+ <text variable="year-suffix" prefix="-"/>
263
+ </group>
264
+ </else>
265
+ </choose>
266
+ </if>
267
+ </choose>
268
+ </macro>
269
+ <macro name="issued-sort">
270
+ <choose>
271
+ <if type="article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="none">
272
+ <date variable="issued">
273
+ <date-part name="year"/>
274
+ <date-part name="month"/>
275
+ <date-part name="day"/>
276
+ </date>
277
+ </if>
278
+ <else>
279
+ <date variable="issued">
280
+ <date-part name="year"/>
281
+ </date>
282
+ </else>
283
+ </choose>
284
+ </macro>
285
+ <macro name="issued-year">
286
+ <choose>
287
+ <if variable="issued">
288
+ <date variable="issued">
289
+ <date-part name="year"/>
290
+ </date>
291
+ <text variable="year-suffix"/>
292
+ </if>
293
+ <else>
294
+ <text term="no date" form="short"/>
295
+ <text variable="year-suffix" prefix="-"/>
296
+ </else>
297
+ </choose>
298
+ </macro>
299
+ <macro name="edition">
300
+ <choose>
301
+ <if is-numeric="edition">
302
+ <group delimiter=" ">
303
+ <number variable="edition" form="ordinal"/>
304
+ <text term="edition" form="short" suffix="." strip-periods="true"/>
305
+ </group>
306
+ </if>
307
+ <else>
308
+ <text variable="edition" suffix="."/>
309
+ </else>
310
+ </choose>
311
+ </macro>
312
+ <macro name="locators">
313
+ <choose>
314
+ <if type="article-journal article-magazine" match="any">
315
+ <group prefix=", " delimiter=", ">
316
+ <group>
317
+ <text variable="volume" font-style="italic"/>
318
+ <text variable="issue" prefix="(" suffix=")"/>
319
+ </group>
320
+ <text variable="page"/>
321
+ </group>
322
+ </if>
323
+ <else-if type="article-newspaper">
324
+ <group delimiter=" " prefix=", ">
325
+ <label variable="page" form="short"/>
326
+ <text variable="page"/>
327
+ </group>
328
+ </else-if>
329
+ <else-if type="book graphic motion_picture report song chapter paper-conference" match="any">
330
+ <group prefix=" (" suffix=")" delimiter=", ">
331
+ <text macro="edition"/>
332
+ <group>
333
+ <text term="volume" form="short" plural="true" text-case="capitalize-first" suffix=". " strip-periods="true"/>
334
+ <number variable="number-of-volumes" form="numeric" prefix="1-"/>
335
+ </group>
336
+ <group>
337
+ <text term="volume" form="short" text-case="capitalize-first" suffix=". " strip-periods="true"/>
338
+ <number variable="volume" form="numeric"/>
339
+ </group>
340
+ <group>
341
+ <label variable="page" form="short" suffix=" "/>
342
+ <text variable="page"/>
343
+ </group>
344
+ </group>
345
+ </else-if>
346
+ <else-if type="legal_case">
347
+ <group prefix=" (" suffix=")" delimiter=" ">
348
+ <text variable="authority"/>
349
+ <date variable="issued" delimiter=" ">
350
+ <date-part name="month" form="short"/>
351
+ <date-part name="day" suffix=","/>
352
+ <date-part name="year"/>
353
+ </date>
354
+ </group>
355
+ </else-if>
356
+ <else-if type="bill legislation">
357
+ <date variable="issued" prefix=" (" suffix=")">
358
+ <date-part name="year"/>
359
+ </date>
360
+ </else-if>
361
+ </choose>
362
+ </macro>
363
+ <macro name="citation-locator">
364
+ <group>
365
+ <label variable="locator" form="short"/>
366
+ <text variable="locator" prefix=" "/>
367
+ </group>
368
+ </macro>
369
+ <macro name="container">
370
+ <choose>
371
+ <if type="bill legal_case legislation" match="none">
372
+ <text variable="container-title" font-style="italic"/>
373
+ </if>
374
+ <else>
375
+ <group delimiter=" " prefix=", ">
376
+ <choose>
377
+ <if variable="container-title">
378
+ <text variable="volume"/>
379
+ <text variable="container-title"/>
380
+ <group delimiter=" ">
381
+ <!--change to label variable="section" as that becomes available -->
382
+ <text term="section" form="symbol"/>
383
+ <text variable="section"/>
384
+ </group>
385
+ <text variable="page"/>
386
+ </if>
387
+ <else>
388
+ <choose>
389
+ <if type="legal_case">
390
+ <text variable="number" prefix="No. "/>
391
+ </if>
392
+ <else>
393
+ <text variable="number" prefix="Pub. L. No. "/>
394
+ <group delimiter=" ">
395
+ <!--change to label variable="section" as that becomes available -->
396
+ <text term="section" form="symbol"/>
397
+ <text variable="section"/>
398
+ </group>
399
+ </else>
400
+ </choose>
401
+ </else>
402
+ </choose>
403
+ </group>
404
+ </else>
405
+ </choose>
406
+ </macro>
407
+ <citation et-al-min="6" et-al-use-first="1" et-al-subsequent-min="3" et-al-subsequent-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year" givenname-disambiguation-rule="primary-name">
408
+ <sort>
409
+ <key macro="author"/>
410
+ <key macro="issued-sort"/>
411
+ </sort>
412
+ <layout prefix="(" suffix=")" delimiter="; ">
413
+ <group delimiter=", ">
414
+ <text macro="author-short"/>
415
+ <text macro="issued-year"/>
416
+ <text macro="citation-locator"/>
417
+ </group>
418
+ </layout>
419
+ </citation>
420
+ <bibliography hanging-indent="true" et-al-min="8" et-al-use-first="7" entry-spacing="0" line-spacing="2">
421
+ <sort>
422
+ <key macro="author"/>
423
+ <key macro="issued-sort" sort="ascending"/>
424
+ </sort>
425
+ <layout>
426
+ <group suffix=".">
427
+ <group delimiter=". ">
428
+ <text macro="author"/>
429
+ <text macro="issued"/>
430
+ </group>
431
+ <group delimiter=". ">
432
+ <text macro="title" prefix=" "/>
433
+ <group>
434
+ <text macro="container-contributors"/>
435
+ <text macro="secondary-contributors"/>
436
+ <group delimiter=", ">
437
+ <text macro="container"/>
438
+ <text variable="collection-title"/>
439
+ </group>
440
+ </group>
441
+ </group>
442
+ <text macro="locators"/>
443
+ <group delimiter=", " prefix=". ">
444
+ <text macro="event"/>
445
+ <text macro="publisher"/>
446
+ </group>
447
+ </group>
448
+ <text macro="access" prefix=" "/>
449
+ </layout>
450
+ </bibliography>
451
+ </style>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citeproc-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
11
+ date: 2016-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citeproc
@@ -72,6 +72,7 @@ files:
72
72
  - features/sort.feature
73
73
  - features/step_definitions/engine.rb
74
74
  - features/step_definitions/renderer.rb
75
+ - features/style_immanent_locale_terms.feature
75
76
  - features/support/env.rb
76
77
  - features/support/hooks.rb
77
78
  - lib/citeproc/ruby.rb
@@ -111,8 +112,10 @@ files:
111
112
  - spec/citeproc/ruby/renderer/text_spec.rb
112
113
  - spec/citeproc/ruby/renderer_spec.rb
113
114
  - spec/fixtures/items.rb
115
+ - spec/fixtures/locales/locales-de-DE.xml
114
116
  - spec/fixtures/locales/locales-en-US.xml
115
117
  - spec/fixtures/locales/locales-fr-FR.xml
118
+ - spec/fixtures/styles/apa-with-different-translations.csl
116
119
  - spec/fixtures/styles/apa.csl
117
120
  - spec/spec_helper.rb
118
121
  homepage: https://github.com/inukshuk/citeproc-ruby
@@ -148,6 +151,7 @@ test_files:
148
151
  - features/sort.feature
149
152
  - features/step_definitions/engine.rb
150
153
  - features/step_definitions/renderer.rb
154
+ - features/style_immanent_locale_terms.feature
151
155
  - features/support/env.rb
152
156
  - features/support/hooks.rb
153
157
  - spec/citeproc/ruby/engine_spec.rb
@@ -165,8 +169,10 @@ test_files:
165
169
  - spec/citeproc/ruby/renderer/text_spec.rb
166
170
  - spec/citeproc/ruby/renderer_spec.rb
167
171
  - spec/fixtures/items.rb
172
+ - spec/fixtures/locales/locales-de-DE.xml
168
173
  - spec/fixtures/locales/locales-en-US.xml
169
174
  - spec/fixtures/locales/locales-fr-FR.xml
175
+ - spec/fixtures/styles/apa-with-different-translations.csl
170
176
  - spec/fixtures/styles/apa.csl
171
177
  - spec/spec_helper.rb
172
178
  has_rdoc: yard