citeproc-ruby 1.1.7 → 1.1.13

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.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. data/BSDL +1 -1
  3. data/Gemfile +10 -32
  4. data/README.md +5 -2
  5. data/lib/citeproc/ruby.rb +1 -0
  6. data/lib/citeproc/ruby/format.rb +1 -1
  7. data/lib/citeproc/ruby/formats/latex.rb +136 -0
  8. data/lib/citeproc/ruby/renderer.rb +2 -1
  9. data/lib/citeproc/ruby/renderer/date.rb +9 -4
  10. data/lib/citeproc/ruby/renderer/format.rb +1 -0
  11. data/lib/citeproc/ruby/version.rb +1 -1
  12. metadata +18 -88
  13. data/.rspec +0 -3
  14. data/.rubocop.yml +0 -1156
  15. data/.simplecov +0 -4
  16. data/Guardfile +0 -14
  17. data/features/bibliography.feature +0 -25
  18. data/features/locale_overrides.feature +0 -31
  19. data/features/name_options.feature +0 -37
  20. data/features/names.feature +0 -198
  21. data/features/renderer.feature +0 -94
  22. data/features/sort.feature +0 -50
  23. data/features/step_definitions/engine.rb +0 -21
  24. data/features/step_definitions/renderer.rb +0 -85
  25. data/features/style_immanent_locale_terms.feature +0 -30
  26. data/features/support/env.rb +0 -35
  27. data/features/support/hooks.rb +0 -10
  28. data/spec/citeproc/ruby/engine_spec.rb +0 -120
  29. data/spec/citeproc/ruby/formats/default_spec.rb +0 -168
  30. data/spec/citeproc/ruby/formats/html_spec.rb +0 -167
  31. data/spec/citeproc/ruby/renderer/choose_spec.rb +0 -293
  32. data/spec/citeproc/ruby/renderer/date_spec.rb +0 -173
  33. data/spec/citeproc/ruby/renderer/group_spec.rb +0 -114
  34. data/spec/citeproc/ruby/renderer/history_spec.rb +0 -47
  35. data/spec/citeproc/ruby/renderer/label_spec.rb +0 -225
  36. data/spec/citeproc/ruby/renderer/layout_spec.rb +0 -41
  37. data/spec/citeproc/ruby/renderer/macro_spec.rb +0 -31
  38. data/spec/citeproc/ruby/renderer/names_spec.rb +0 -396
  39. data/spec/citeproc/ruby/renderer/number_spec.rb +0 -120
  40. data/spec/citeproc/ruby/renderer/text_spec.rb +0 -125
  41. data/spec/citeproc/ruby/renderer_spec.rb +0 -65
  42. data/spec/fixtures/items.rb +0 -113
  43. data/spec/fixtures/locales/locales-de-DE.xml +0 -298
  44. data/spec/fixtures/locales/locales-en-US.xml +0 -304
  45. data/spec/fixtures/locales/locales-fr-FR.xml +0 -317
  46. data/spec/fixtures/styles/apa-with-different-translations.csl +0 -451
  47. data/spec/fixtures/styles/apa.csl +0 -443
  48. data/spec/fixtures/styles/modern-language-association-8th-edition.csl +0 -293
  49. data/spec/spec_helper.rb +0 -73
@@ -1,293 +0,0 @@
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>Modern Language Association 8th edition</title>
5
- <title-short>MLA</title-short>
6
- <id>http://www.zotero.org/styles/modern-language-association-8th-edition</id>
7
- <link href="http://www.zotero.org/styles/modern-language-association-8th-edition" rel="self"/>
8
- <link href="http://style.mla.org" rel="documentation"/>
9
- <author>
10
- <name>Sebastian Karcher</name>
11
- </author>
12
- <category citation-format="author"/>
13
- <category field="generic-base"/>
14
- <summary>This style adheres to the MLA 8th edition handbook. Follows the structure of references as outlined in the MLA Manual closely</summary>
15
- <updated>2014-07-06T20:05:10+00:00</updated>
16
- <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
17
- </info>
18
- <locale xml:lang="en">
19
- <date form="text">
20
- <date-part name="day" suffix=" "/>
21
- <date-part name="month" suffix=" " form="short"/>
22
- <date-part name="year"/>
23
- </date>
24
- <terms>
25
- <term name="month-01" form="short">Jan.</term>
26
- <term name="month-02" form="short">Feb.</term>
27
- <term name="month-03" form="short">Mar.</term>
28
- <term name="month-04" form="short">Apr.</term>
29
- <term name="month-05" form="short">May</term>
30
- <term name="month-06" form="short">June</term>
31
- <term name="month-07" form="short">July</term>
32
- <term name="month-08" form="short">Aug.</term>
33
- <term name="month-09" form="short">Sept.</term>
34
- <term name="month-10" form="short">Oct.</term>
35
- <term name="month-11" form="short">Nov.</term>
36
- <term name="month-12" form="short">Dec.</term>
37
- <term name="translator" form="short">trans.</term>
38
- </terms>
39
- </locale>
40
- <macro name="author">
41
- <names variable="author">
42
- <name name-as-sort-order="first" and="text" delimiter-precedes-last="always" delimiter-precedes-et-al="always" initialize="false" initialize-with=". "/>
43
- <label form="long" prefix=", "/>
44
- <substitute>
45
- <names variable="editor"/>
46
- <names variable="translator"/>
47
- <text macro="title-short"/>
48
- </substitute>
49
- </names>
50
- </macro>
51
- <macro name="author-short">
52
- <group delimiter=", ">
53
- <names variable="author">
54
- <name form="short" initialize-with=". " and="text"/>
55
- <substitute>
56
- <names variable="editor"/>
57
- <names variable="translator"/>
58
- <text macro="title-short"/>
59
- </substitute>
60
- </names>
61
- <choose>
62
- <if disambiguate="true">
63
- <text macro="title-short"/>
64
- </if>
65
- </choose>
66
- </group>
67
- </macro>
68
- <macro name="title">
69
- <choose>
70
- <if variable="container-title" match="any">
71
- <text variable="title" quotes="true"/>
72
- </if>
73
- <else>
74
- <text variable="title" font-style="italic"/>
75
- </else>
76
- </choose>
77
- </macro>
78
- <macro name="title-short">
79
- <choose>
80
- <if variable="container-title" match="any">
81
- <text variable="title" form="short" quotes="true"/>
82
- </if>
83
- <else>
84
- <text variable="title" form="short" font-style="italic"/>
85
- </else>
86
- </choose>
87
- </macro>
88
- <macro name="container-title">
89
- <text variable="container-title" font-style="italic"/>
90
- </macro>
91
- <macro name="other-contributors">
92
- <choose>
93
- <if variable="container-title" match="any">
94
- <names variable="editor translator" delimiter=", ">
95
- <label form="verb" suffix=" "/>
96
- <name and="text"/>
97
- </names>
98
- </if>
99
- <else>
100
- <names variable="editor translator" delimiter=", ">
101
- <label form="verb" suffix=" " text-case="capitalize-first"/>
102
- <name and="text"/>
103
- </names>
104
- </else>
105
- </choose>
106
- </macro>
107
- <macro name="version">
108
- <group delimiter=", ">
109
- <choose>
110
- <if is-numeric="edition">
111
- <group delimiter=" ">
112
- <number variable="edition" form="ordinal"/>
113
- <text term="edition" form="short"/>
114
- </group>
115
- </if>
116
- <else>
117
- <text variable="edition" text-case="capitalize-first"/>
118
- </else>
119
- </choose>
120
- <text variable="version"/>
121
- </group>
122
- </macro>
123
- <macro name="number">
124
- <group delimiter=", ">
125
- <group>
126
- <choose>
127
- <!--lowercase if we have a preceding element-->
128
- <if variable="edition container-title" match="any">
129
- <group delimiter=" ">
130
- <text term="volume" form="short"/>
131
- <text variable="volume"/>
132
- </group>
133
- </if>
134
- <!--other contributors preceding the volume-->
135
- <else-if variable="author editor" match="all">
136
- <group delimiter=" ">
137
- <text term="volume" form="short"/>
138
- <text variable="volume"/>
139
- </group>
140
- </else-if>
141
- <else>
142
- <group delimiter=" ">
143
- <text term="volume" form="short" text-case="capitalize-first"/>
144
- <text variable="volume"/>
145
- </group>
146
- </else>
147
- </choose>
148
- </group>
149
- <group delimiter=" ">
150
- <text term="issue" form="short"/>
151
- <text variable="issue"/>
152
- </group>
153
- <choose>
154
- <if type="report">
155
- <text variable="genre"/>
156
- </if>
157
- </choose>
158
- <text variable="number"/>
159
- </group>
160
- </macro>
161
- <macro name="publisher">
162
- <text variable="publisher"/>
163
- </macro>
164
- <macro name="publication-date">
165
- <choose>
166
- <if type="book chapter paper-conference motion_picture" match="any">
167
- <date variable="issued" form="numeric" date-parts="year"/>
168
- </if>
169
- <else-if type="article-journal article-magazine" match="any">
170
- <date variable="issued" form="text" date-parts="year-month"/>
171
- </else-if>
172
- <else-if type="webpage" match="any">
173
- <date variable="issued" form="text"/>
174
- </else-if>
175
- <else-if type="speech" match="none">
176
- <date variable="issued" form="text"/>
177
- </else-if>
178
- </choose>
179
- </macro>
180
- <macro name="location">
181
- <group delimiter=", ">
182
- <group delimiter=" ">
183
- <label variable="page" form="short"/>
184
- <text variable="page"/>
185
- </group>
186
- <choose>
187
- <if variable="source" match="none">
188
- <choose>
189
- <if variable="URL DOI" match="any">
190
- <text macro="URI"/>
191
- </if>
192
- </choose>
193
- </if>
194
- </choose>
195
- </group>
196
- </macro>
197
- <macro name="container2-title">
198
- <group delimiter=", ">
199
- <choose>
200
- <if type="speech">
201
- <text variable="event"/>
202
- <date variable="event-date" form="text"/>
203
- <text variable="event-place"/>
204
- </if>
205
- </choose>
206
- <text variable="archive"/>
207
- <text variable="archive-place"/>
208
- <text variable="archive_location"/>
209
- </group>
210
- </macro>
211
- <macro name="container2-location">
212
- <choose>
213
- <if variable="source">
214
- <group delimiter=", ">
215
- <text variable="source" font-style="italic"/>
216
- <text macro="URI"/>
217
- </group>
218
- </if>
219
- </choose>
220
- </macro>
221
- <macro name="URI">
222
- <choose>
223
- <if variable="DOI">
224
- <text variable="DOI" prefix="doi:"/>
225
- </if>
226
- <else>
227
- <text variable="URL"/>
228
- </else>
229
- </choose>
230
- </macro>
231
- <macro name="accessed">
232
- <!--using accessed where we don't have an issued date; follows recommendation on p. 53 -->
233
- <choose>
234
- <if variable="issued" match="none">
235
- <group delimiter=" ">
236
- <text term="accessed" text-case="capitalize-first"/>
237
- <date variable="accessed" form="text"/>
238
- </group>
239
- </if>
240
- </choose>
241
- </macro>
242
- <citation et-al-min="3" et-al-use-first="1" disambiguate-add-names="true" disambiguate-add-givenname="true">
243
- <layout prefix="(" suffix=")" delimiter="; ">
244
- <choose>
245
- <if locator="page">
246
- <group delimiter=" ">
247
- <text macro="author-short"/>
248
- <text variable="locator"/>
249
- </group>
250
- </if>
251
- <else>
252
- <group delimiter=", ">
253
- <text macro="author-short"/>
254
- <group>
255
- <label variable="locator" form="short"/>
256
- <text variable="locator"/>
257
- </group>
258
- </group>
259
- </else>
260
- </choose>
261
- </layout>
262
- </citation>
263
- <bibliography hanging-indent="true" et-al-min="3" et-al-use-first="1" line-spacing="2" entry-spacing="0" subsequent-author-substitute="---">
264
- <sort>
265
- <key macro="author"/>
266
- <key variable="title"/>
267
- </sort>
268
- <layout suffix=".">
269
- <group delimiter=". ">
270
- <text macro="author"/>
271
- <text macro="title"/>
272
- <date variable="original-date" form="numeric" date-parts="year"/>
273
- <group delimiter=", ">
274
- <!---This group corresponds to MLA's "Container 1"-->
275
- <text macro="container-title"/>
276
- <text macro="other-contributors"/>
277
- <text macro="version"/>
278
- <text macro="number"/>
279
- <text macro="publisher"/>
280
- <text macro="publication-date"/>
281
- <text macro="location"/>
282
- </group>
283
- <group delimiter=", ">
284
- <!---This group corresponds to MLA's "Container 2"-->
285
- <!--currently just using this one for archival info-->
286
- <text macro="container2-title"/>
287
- <text macro="container2-location"/>
288
- </group>
289
- <text macro="accessed"/>
290
- </group>
291
- </layout>
292
- </bibliography>
293
- </style>
@@ -1,73 +0,0 @@
1
- require 'bundler'
2
- begin
3
- Bundler.setup
4
- rescue Bundler::BundlerError => e
5
- $stderr.puts e.message
6
- $stderr.puts "Run `bundle install` to install missing gems"
7
- exit e.status_code
8
- end
9
-
10
- begin
11
- require 'simplecov'
12
- require 'coveralls' if ENV['CI']
13
- rescue LoadError
14
- # ignore
15
- end
16
-
17
- begin
18
- case
19
- when RUBY_PLATFORM == 'java'
20
- # require 'debug'
21
- # Debugger.start
22
- when defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
23
- require 'rubinius/debugger'
24
- when RUBY_VERSION < '2.0'
25
- require 'debugger'
26
- else
27
- require 'byebug'
28
- end
29
- rescue LoadError
30
- # ignore
31
- end
32
-
33
- require 'citeproc/ruby'
34
-
35
- module Fixtures
36
- PATH = File.expand_path('../fixtures', __FILE__)
37
-
38
- Dir[File.join(PATH, '*.rb')].each do |fixture|
39
- require fixture
40
- end
41
- end
42
-
43
- module SilentWarnings
44
- require 'stringio'
45
- #
46
- # Adapted form silent_warnings gist by @avdi
47
- # https://gist.github.com/1170926
48
- #
49
- def silent_warnings
50
- original_stderr = $stderr
51
- $stderr = StringIO.new
52
- yield
53
- ensure
54
- $stderr = original_stderr
55
- end
56
- end
57
-
58
- RSpec.configure do |config|
59
- config.include(SilentWarnings)
60
- config.include(Fixtures)
61
-
62
- config.before :all do
63
- @style_root, @locale_root = CSL::Style.root, CSL::Locale.root
64
-
65
- CSL::Style.root = File.join(Fixtures::PATH, 'styles')
66
- CSL::Locale.root = File.join(Fixtures::PATH, 'locales')
67
- end
68
-
69
- config.after :all do
70
- CSL::Style.root, CSL::Locale.root = @style_root, @locale_root
71
- end
72
-
73
- end