citeproc-ruby 1.1.2 → 1.1.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 +15 -8
- data/Rakefile +7 -3
- data/features/names.feature +6 -0
- data/lib/citeproc/ruby/renderer.rb +0 -8
- data/lib/citeproc/ruby/renderer/label.rb +5 -5
- data/lib/citeproc/ruby/renderer/names.rb +2 -5
- data/lib/citeproc/ruby/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d5201ef4533faad4c1d0b174be62ef093a2ac74
|
4
|
+
data.tar.gz: a789cdc717e7f13b366fa5d7bdda6fe14663fcd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd67a84a38bb7cfb7d5d61135ba2b6dfd202ae90fd2946ff96c549addb776e46634cee0e153dc64594cc79e42e5c11da46f247893023d06c7b785c45878ca0f6
|
7
|
+
data.tar.gz: bfb356e63b75055399d902ae1da8dcf230681387a7d6754c47d3b37b9de4be0f6da79eb5c33b9a44ab3c344c6b62cb1b27dddcd8eaac89baf8092370790ae939
|
data/Gemfile
CHANGED
@@ -8,9 +8,6 @@ group :development, :test do
|
|
8
8
|
gem 'rake', '~>10.0'
|
9
9
|
gem 'rspec', '~>3.0', '<3.2.0'
|
10
10
|
gem 'cucumber', '~>2.3'
|
11
|
-
gem 'simplecov', '~>0.8'
|
12
|
-
gem 'rubinius-coverage', :platforms => :rbx
|
13
|
-
gem 'coveralls', :require => false
|
14
11
|
end
|
15
12
|
|
16
13
|
group :debug do
|
@@ -27,7 +24,11 @@ group :debug do
|
|
27
24
|
end
|
28
25
|
|
29
26
|
group :optional do
|
30
|
-
|
27
|
+
if RUBY_VERSION >= '2.2.2'
|
28
|
+
gem 'edtf', '~>3.0'
|
29
|
+
else
|
30
|
+
gem 'edtf', '~>2.0'
|
31
|
+
end
|
31
32
|
gem 'chronic'
|
32
33
|
end
|
33
34
|
|
@@ -41,8 +42,14 @@ group :extra do
|
|
41
42
|
gem 'redcarpet', '~>3.0', :platforms => :mri
|
42
43
|
end
|
43
44
|
|
44
|
-
|
45
|
-
gem '
|
46
|
-
gem '
|
47
|
-
gem '
|
45
|
+
group :coverage do
|
46
|
+
gem 'simplecov', '~>0.8'
|
47
|
+
gem 'rubinius-coverage', :platforms => :rbx
|
48
|
+
gem 'coveralls', :require => false
|
49
|
+
end
|
50
|
+
|
51
|
+
group :rbx do
|
52
|
+
gem 'rubysl', :platforms => :rbx
|
53
|
+
gem 'racc', :platforms => :rbx
|
54
|
+
gem 'json', '~>1.8', :platforms => :rbx
|
48
55
|
end
|
data/Rakefile
CHANGED
@@ -39,9 +39,13 @@ Cucumber::Rake::Task.new(:cucumber) do |t|
|
|
39
39
|
t.profile = 'default'
|
40
40
|
end
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
begin
|
43
|
+
require 'coveralls/rake/task'
|
44
|
+
Coveralls::RakeTask.new
|
45
|
+
task :test_with_coveralls => [:spec, :cucumber, 'coveralls:push']
|
46
|
+
rescue LoadError => e
|
47
|
+
# ignore
|
48
|
+
end
|
45
49
|
|
46
50
|
task :release do |t|
|
47
51
|
system "gem build citeproc-ruby.gemspec"
|
data/features/names.feature
CHANGED
@@ -88,6 +88,7 @@ Feature: CSL Name Rendering
|
|
88
88
|
| UNKNOWN |
|
89
89
|
| Doe, John, and Jane Doe |
|
90
90
|
|
91
|
+
|
91
92
|
Scenario: Suppression after substitutions
|
92
93
|
Given the following style node:
|
93
94
|
"""
|
@@ -101,6 +102,9 @@ Feature: CSL Name Rendering
|
|
101
102
|
</names>
|
102
103
|
<names variable="editor">
|
103
104
|
<label prefix=" (" suffix=")"/>
|
105
|
+
<substitute>
|
106
|
+
<text variable="title"/>
|
107
|
+
</substitute>
|
104
108
|
</names>
|
105
109
|
<text variable="title" text-case="uppercase"/>
|
106
110
|
</group>
|
@@ -108,10 +112,12 @@ Feature: CSL Name Rendering
|
|
108
112
|
When I render the following citation items as "html":
|
109
113
|
| editor | author | title |
|
110
114
|
| John Doe | Jane Doe | The Title |
|
115
|
+
| | Jane Doe | The Title |
|
111
116
|
| John Doe | | The Title |
|
112
117
|
| | | The Title |
|
113
118
|
Then the results should be:
|
114
119
|
| Doe, Jane, John Doe (editor), THE TITLE |
|
120
|
+
| Doe, Jane, The Title |
|
115
121
|
| Doe, John, THE TITLE |
|
116
122
|
| The Title |
|
117
123
|
|
@@ -19,14 +19,6 @@ module CiteProc
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def locale
|
23
|
-
@locale ||= CSL::Locale.load
|
24
|
-
end
|
25
|
-
|
26
|
-
def locale=(new_locale)
|
27
|
-
@locale = CSL::Locale.load new_locale
|
28
|
-
end
|
29
|
-
|
30
22
|
def abbreviate(*arguments)
|
31
23
|
return unless engine
|
32
24
|
engine.abbreviate(*arguments)
|
@@ -13,7 +13,7 @@ module CiteProc
|
|
13
13
|
|
14
14
|
case
|
15
15
|
when node.page?
|
16
|
-
value, name = item.read_attribute(:page) || item.data
|
16
|
+
value, name = item.read_attribute(:page) || item.data.unobservable_read_attribute(:page).to_s, :page
|
17
17
|
|
18
18
|
format_page_range!(value, node.page_range_format)
|
19
19
|
|
@@ -23,7 +23,7 @@ module CiteProc
|
|
23
23
|
# in item.data; there should be no locator there
|
24
24
|
# either but the read access will be noticed by
|
25
25
|
# observers (if any).
|
26
|
-
value, name = item.locator || item.data.locator, item.label || 'page'
|
26
|
+
value, name = item.locator || item.data.unobservable_read_attribute(:locator), item.label || 'page'
|
27
27
|
|
28
28
|
when node.names_label?
|
29
29
|
|
@@ -31,13 +31,13 @@ module CiteProc
|
|
31
31
|
# by fetching editors since we can assume
|
32
32
|
# that both are present and identical!
|
33
33
|
if variable == :editortranslator
|
34
|
-
value, name = item.data
|
34
|
+
value, name = item.data.unobservable_read_attribute(:editor), variable.to_s
|
35
35
|
else
|
36
|
-
value, name = item.data
|
36
|
+
value, name = item.data.unobservable_read_attribute(variable), variable.to_s
|
37
37
|
end
|
38
38
|
|
39
39
|
else
|
40
|
-
value, name = item.data
|
40
|
+
value, name = item.data.unobservable_read_attribute(variable), node.term
|
41
41
|
end
|
42
42
|
|
43
43
|
return '' if value.nil? || value.respond_to?(:empty?) && value.empty?
|
@@ -13,12 +13,9 @@ module CiteProc
|
|
13
13
|
[role.to_sym, item.data[role]]
|
14
14
|
end
|
15
15
|
|
16
|
-
names.reject! { |n|
|
16
|
+
suppressed = names.reject! { |n| item.suppressed? n[0] }
|
17
17
|
|
18
|
-
|
19
|
-
# we are not interested in suppressed variables
|
20
|
-
# which are empty anyway!
|
21
|
-
suppressed = names.reject! { |n| item.suppressed? n }
|
18
|
+
names.reject! { |n| n[1].nil? || n[1].empty? }
|
22
19
|
|
23
20
|
if names.empty?
|
24
21
|
# We also return when the list is empty because
|
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.
|
4
|
+
version: 1.1.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: 2016-
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: citeproc
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.6.3
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: A Citation Style Language (CSL) cite processor
|
@@ -175,4 +175,3 @@ test_files:
|
|
175
175
|
- spec/fixtures/styles/apa-with-different-translations.csl
|
176
176
|
- spec/fixtures/styles/apa.csl
|
177
177
|
- spec/spec_helper.rb
|
178
|
-
has_rdoc: yard
|