citeproc-ruby 1.1.8 → 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +10 -32
  3. data/lib/citeproc/ruby/renderer.rb +2 -1
  4. data/lib/citeproc/ruby/version.rb +1 -1
  5. metadata +14 -84
  6. data/.rspec +0 -3
  7. data/.rubocop.yml +0 -1156
  8. data/.simplecov +0 -4
  9. data/Guardfile +0 -14
  10. data/features/bibliography.feature +0 -25
  11. data/features/locale_overrides.feature +0 -31
  12. data/features/name_options.feature +0 -37
  13. data/features/names.feature +0 -198
  14. data/features/renderer.feature +0 -94
  15. data/features/sort.feature +0 -50
  16. data/features/step_definitions/engine.rb +0 -21
  17. data/features/step_definitions/renderer.rb +0 -85
  18. data/features/style_immanent_locale_terms.feature +0 -30
  19. data/features/support/env.rb +0 -35
  20. data/features/support/hooks.rb +0 -10
  21. data/spec/citeproc/ruby/engine_spec.rb +0 -120
  22. data/spec/citeproc/ruby/formats/default_spec.rb +0 -168
  23. data/spec/citeproc/ruby/formats/html_spec.rb +0 -167
  24. data/spec/citeproc/ruby/renderer/choose_spec.rb +0 -293
  25. data/spec/citeproc/ruby/renderer/date_spec.rb +0 -173
  26. data/spec/citeproc/ruby/renderer/group_spec.rb +0 -114
  27. data/spec/citeproc/ruby/renderer/history_spec.rb +0 -47
  28. data/spec/citeproc/ruby/renderer/label_spec.rb +0 -225
  29. data/spec/citeproc/ruby/renderer/layout_spec.rb +0 -41
  30. data/spec/citeproc/ruby/renderer/macro_spec.rb +0 -31
  31. data/spec/citeproc/ruby/renderer/names_spec.rb +0 -396
  32. data/spec/citeproc/ruby/renderer/number_spec.rb +0 -120
  33. data/spec/citeproc/ruby/renderer/text_spec.rb +0 -125
  34. data/spec/citeproc/ruby/renderer_spec.rb +0 -65
  35. data/spec/fixtures/items.rb +0 -113
  36. data/spec/fixtures/locales/locales-de-DE.xml +0 -298
  37. data/spec/fixtures/locales/locales-en-US.xml +0 -304
  38. data/spec/fixtures/locales/locales-fr-FR.xml +0 -317
  39. data/spec/fixtures/styles/apa-with-different-translations.csl +0 -451
  40. data/spec/fixtures/styles/apa.csl +0 -443
  41. data/spec/fixtures/styles/modern-language-association-8th-edition.csl +0 -293
  42. data/spec/spec_helper.rb +0 -73
data/.simplecov DELETED
@@ -1,4 +0,0 @@
1
- SimpleCov.start do
2
- add_filter 'spec/'
3
- add_filter 'features/'
4
- end
data/Guardfile DELETED
@@ -1,14 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- guard 'rspec' do
5
- watch(%r{^spec/.+_spec\.rb$})
6
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
- watch('spec/spec_helper.rb') { 'spec' }
8
- end
9
-
10
- guard 'cucumber' do
11
- watch(%r{^features/.+\.feature$})
12
- watch(%r{^features/support/.+$}) { 'features' }
13
- watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
14
- end
@@ -1,25 +0,0 @@
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
7
- Given the "apa" style's bibliography node
8
- When I render the following citation items as "text":
9
- | type | author | title | issued | publisher | container-title | page | issue |
10
- | book | Thomas Pynchon | The crying of lot 49 | November 7, 2006 | Harper Perennial | | | |
11
- | article-journal | Derrida, Jacques | The purveyor of truth | 1975 | Yale University Press | Yale French Studies | 31-113 | 52 |
12
- Then the results should be:
13
- | Pynchon, T. (2006). The crying of lot 49. Harper Perennial. |
14
- | Derrida, J. (1975). The purveyor of truth. Yale French Studies, (52), 31–113. |
15
-
16
- Scenario: Rendering APA style bibliographies as HTML
17
- Given the "apa" style's bibliography node
18
- When I render the following citation item as "html":
19
- | type | book |
20
- | author | Vladimir Nabokov |
21
- | title | Pale fire |
22
- | issued | April 23, 1989 |
23
- | publisher | Vintage |
24
- | publisher-place | London |
25
- Then the result should be: Nabokov, V. (1989). <i>Pale fire</i>. London: Vintage.
@@ -1,31 +0,0 @@
1
- Feature: Locale overrides
2
- As a hacker of CSL styles
3
- I want to overrice localized terms
4
- In the locale section of a CSL style
5
-
6
- @locale-override @page-range
7
- Scenario: Page range delimiter override
8
- Given the following style:
9
- """
10
- <style page-range-format="expanded">
11
- <locale>
12
- <terms>
13
- <term name="page-range-delimiter">--</term>
14
- </terms>
15
- </locale>
16
- <citation>
17
- <layout>
18
- <text variable="page"/>
19
- </layout>
20
- </citation>
21
- </style>
22
- """
23
- When I cite the following items as "text":
24
- | page |
25
- | 23 |
26
- | 23-5 |
27
- | 23-25 |
28
- Then the results should be:
29
- | 23 |
30
- | 23--25 |
31
- | 23--25 |
@@ -1,37 +0,0 @@
1
- Feature: Inheritance of Name Options
2
- As a style author
3
- I want name nodes to inherit attributes
4
- From the citation/bibliography and style nodes
5
-
6
- Scenario: Name options from bibliography node
7
- Given the following style node:
8
- """
9
- <bibliography name-form="short">
10
- <layout>
11
- <names variable="author">
12
- <name />
13
- </names>
14
- </layout>
15
- </bibliography>
16
- """
17
- When I render the following citation items as "html":
18
- | author |
19
- | John Doe |
20
- Then the results should be:
21
- | Doe |
22
-
23
- Given the following style node:
24
- """
25
- <bibliography name-form="short">
26
- <layout>
27
- <names variable="author"/>
28
- <!--it works without a name node-->
29
- </layout>
30
- </bibliography>
31
- """
32
- When I render the following citation items as "html":
33
- | author |
34
- | John Doe |
35
- Then the results should be:
36
- | Doe |
37
-
@@ -1,198 +0,0 @@
1
- Feature: CSL Name Rendering
2
- As a CSL hacker
3
- I want to render names
4
- Using names nodes
5
-
6
- Scenario: Names Rendering
7
- Given the following style node:
8
- """
9
- <names variable="translator" delimiter=", " prefix="(" suffix=")">
10
- <name and="symbol" delimiter=", "/>
11
- <label form="short" prefix=", " text-case="capitalize-first" suffix=""/>
12
- </names>
13
- """
14
- When I render the following citation items as "text":
15
- | translator |
16
- | Romy Schneider and Peter Sellers |
17
- Then the results should be:
18
- | (Romy Schneider & Peter Sellers, Trans.) |
19
-
20
-
21
- Scenario: Initials
22
- Given the following style node:
23
- """
24
- <names variable="translator author" delimiter=", " prefix="(" suffix=")">
25
- <name and="symbol" delimiter=", " initialize-with=". "/>
26
- <label form="short" prefix=", " text-case="capitalize-first" suffix=""/>
27
- </names>
28
- """
29
- When I render the following citation items as "text":
30
- | translator | author |
31
- | Romy Schneider and Peter Sellers | |
32
- Then the results should be:
33
- | (R. Schneider & P. Sellers, Trans.) |
34
-
35
- Scenario: Initials when given part is uppercased
36
- Given the following style node:
37
- """
38
- <names variable="author" suffix=".">
39
- <name name-as-sort-order="all" sort-separator=", " initialize-with=". " delimiter="; " delimiter-precedes-last="always">
40
- <name-part name="family" text-case="uppercase"/>
41
- <name-part name="given" text-case="uppercase"/>
42
- </name>
43
- <et-al prefix=" " font-style="italic"/>
44
- <label form="short" prefix=" (" suffix=".)" text-case="uppercase"/>
45
- </names>
46
- """
47
- When I render the following citation items as "html":
48
- | author |
49
- | Cole, Steven J. and Moore, Robert |
50
- Then the results should be:
51
- | COLE, S. J.; MOORE, R. |
52
-
53
-
54
- Scenario: Name as sort order
55
- Given the following style node:
56
- """
57
- <names variable="author">
58
- <name and="text" delimiter=", " delimiter-precedes-last="always" name-as-sort-order="first" sort-separator=", " />
59
- </names>
60
- """
61
- When I render the following citation items as "html":
62
- | author |
63
- | John Doe |
64
- | John Doe and Jane Doe |
65
- Then the results should be:
66
- | Doe, John |
67
- | Doe, John, and Jane Doe |
68
-
69
-
70
- Scenario: Substitutions
71
- Given the following style node:
72
- """
73
- <names variable="author">
74
- <name and="text" delimiter=", " delimiter-precedes-last="always" name-as-sort-order="first" sort-separator=", " />
75
- <substitute>
76
- <names variable="editor"/>
77
- <text value="UNKNOWN"/>
78
- </substitute>
79
- </names>
80
- """
81
- When I render the following citation items as "html":
82
- | editor |
83
- | John Doe |
84
- | |
85
- | John Doe and Jane Doe |
86
- Then the results should be:
87
- | Doe, John |
88
- | UNKNOWN |
89
- | Doe, John, and Jane Doe |
90
-
91
-
92
- Scenario: Suppression after substitutions
93
- Given the following style node:
94
- """
95
- <group delimiter=", ">
96
- <names variable="author">
97
- <name and="text" delimiter=", " delimiter-precedes-last="always" name-as-sort-order="first" sort-separator=", " />
98
- <substitute>
99
- <names variable="editor"/>
100
- <text variable="title"/>
101
- </substitute>
102
- </names>
103
- <names variable="editor">
104
- <label prefix=" (" suffix=")"/>
105
- <substitute>
106
- <text variable="title"/>
107
- </substitute>
108
- </names>
109
- <text variable="title" text-case="uppercase"/>
110
- </group>
111
- """
112
- When I render the following citation items as "html":
113
- | editor | author | title |
114
- | John Doe | Jane Doe | The Title |
115
- | | Jane Doe | The Title |
116
- | John Doe | | The Title |
117
- | | | The Title |
118
- Then the results should be:
119
- | Doe, Jane, John Doe (editor), THE TITLE |
120
- | Doe, Jane, The Title |
121
- | Doe, John, THE TITLE |
122
- | The Title |
123
-
124
- Scenario: Subsequent author substitutes complete-all with different roles
125
- Given the following style node:
126
- """
127
- <bibliography subsequent-author-substitute="---">
128
- <layout>
129
- <group delimiter=" ">
130
- <names variable="author" delimiter=", " suffix=".">
131
- <name name-as-sort-order="first"/>
132
- <substitute>
133
- <names variable="editor">
134
- <name name-as-sort-order="first"/>
135
- <label form="short" prefix=" " suffix="."/>
136
- </names>
137
- </substitute>
138
- </names>
139
- <text variable="title" suffix="."/>
140
- </group>
141
- </layout>
142
- </bibliography>
143
- """
144
- When I render the following citation items as "text":
145
- | editor | author | title |
146
- | | Jane Doe | Title A |
147
- | | Jane Doe | Title B |
148
- | | John Doe | Title C |
149
- | John Doe | | Title D |
150
- | | Jane Doe and John Doe | Title E |
151
- | | Jane Doe and John Doe | Title F |
152
- Then the results should be:
153
- | Doe, Jane. Title A. |
154
- | ---. Title B. |
155
- | Doe, John. Title C. |
156
- | --- ed. Title D. |
157
- | Doe, Jane, John Doe. Title E. |
158
- | ---. Title F. |
159
-
160
- Scenario: Name / Label Order
161
- Given the following style node:
162
- """
163
- <group delimiter=". ">
164
- <names variable="author" delimiter=". ">
165
- <name and="symbol" delimiter=", "/>
166
- <label prefix=" (" suffix=")"/>
167
- </names>
168
- <names variable="translator" delimiter=". ">
169
- <label form="verb-short" text-case="capitalize-first" suffix=" "/>
170
- <name and="symbol" delimiter=", "/>
171
- </names>
172
- </group>
173
- """
174
- When I render the following citation items as "text":
175
- | translator | author |
176
- | John Doe | Jane Doe |
177
- | John Doe and Jack Doe | Jane Doe and Jill Doe |
178
- Then the results should be:
179
- | Jane Doe (author). Trans. John Doe |
180
- | Jane Doe & Jill Doe (authors). Trans. John Doe & Jack Doe |
181
-
182
- Scenario: EtAlUseFirst options
183
- Given the following style node:
184
- """
185
- <group delimiter=" // ">
186
- <names variable="author">
187
- <name et-al-min="2" et-al-use-first="0"/>
188
- </names>
189
- <names variable="author">
190
- <name et-al-min="2" et-al-use-first="1"/>
191
- </names>
192
- </group>
193
- """
194
- When I render the following citation item as "text":
195
- | author | John Doe and Jane Roe |
196
- Then the result should be: John Doe et al.
197
-
198
-
@@ -1,94 +0,0 @@
1
- Feature: Rendering CSL nodes
2
- As a hacker of cite processors
3
- I want to render citation items
4
- With selected CSL nodes
5
-
6
- Scenario: Simple Date Rendering
7
- Given the following style node:
8
- """
9
- <date variable="issued">
10
- <date-part name="year"/>
11
- </date>
12
- """
13
- When I render the following citation items as "text":
14
- | issued |
15
- | November 7, 2006 |
16
- | 2014-01-01 |
17
- | 1999 |
18
- Then the results should be:
19
- | 2006 |
20
- | 2014 |
21
- | 1999 |
22
-
23
- Scenario: Date Group Rendering
24
- Given the following style node:
25
- """
26
- <group prefix="(" suffix=").">
27
- <date variable="issued">
28
- <date-part name="year"/>
29
- </date>
30
- <text variable="year-suffix"/>
31
- </group>
32
- """
33
- When I render the following citation items as "text":
34
- | issued | year-suffix |
35
- | November 7, 2006 | |
36
- | 2014-01-01 | |
37
- | 1999 | a |
38
- Then the results should be:
39
- | (2006). |
40
- | (2014). |
41
- | (1999a). |
42
-
43
- @html @formatting
44
- Scenario: Formatted Groups
45
- Given the following style node:
46
- """
47
- <group>
48
- <group suffix=" " font-weight="bold">
49
- <!--group formatting is not pushed down-->
50
- <text variable="volume" suffix=","/>
51
- </group>
52
- <text variable="page" suffix="," font-weight="bold"/>
53
- </group>
54
- """
55
- When I render the following citation item as "html":
56
- | volume | 5 |
57
- | page | 23 |
58
- Then the result should be: <b>5,</b> <b>23</b>,
59
-
60
- Scenario: Page labels
61
- Given the following style node:
62
- """
63
- <label variable="page"/>
64
- """
65
- When I render the following citation items as "text":
66
- | page |
67
- | 23 |
68
- | |
69
- | 23, 34 |
70
- Then the results should be:
71
- | page |
72
- | |
73
- | pages |
74
-
75
- @group @substitute
76
- Scenario: Substitute in Groups
77
- Given the following style node:
78
- """
79
- <group>
80
- <text value="by: "/>
81
- <names variable="author">
82
- <substitute>
83
- <text value="Anonymous"/>
84
- </substitute>
85
- </names>
86
- </group>
87
- """
88
- When I render the following citation items as "text":
89
- | author |
90
- | Jane Doe |
91
- | |
92
- Then the results should be:
93
- | by: Jane Doe |
94
- | by: Anonymous |
@@ -1,50 +0,0 @@
1
- Feature: Sorting
2
- As a hacker of cite processors
3
- I want to sort citation items
4
- According to the rules of a CSL style
5
-
6
- Scenario: Name sorting
7
- Given the following sort keys:
8
- """
9
- <sort>
10
- <key variable="author"/>
11
- </sort>
12
- """
13
- When I sort the following items:
14
- | author |
15
- | Edelweis |
16
- | ANZ-Group |
17
- | Aardvaark |
18
- Then the order should be:
19
- | ID-2 |
20
- | ID-1 |
21
- | ID-0 |
22
-
23
- Scenario: Name sorting macros
24
- Given the following sort keys:
25
- """
26
- <sort>
27
- <key macro="author"/>
28
- </sort>
29
- """
30
- And the following macro:
31
- """
32
- <macro name="author">
33
- <names variable="author">
34
- <name name-as-sort-order="all" and="symbol" sort-separator=", "
35
- initialize-with="." delimiter-precedes-last="never" delimiter=", "/>
36
- <label form="short" prefix=" (" suffix=".)" text-case="capitalize-first"/>
37
- <substitute>
38
- <names variable="editor"/>
39
- <text value="Anon"/>
40
- </substitute>
41
- </names>
42
- </macro>
43
- """
44
- When I sort the following items:
45
- | author |
46
- | ABC |
47
- | Aaa |
48
- Then the order should be:
49
- | ID-1 |
50
- | ID-0 |