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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 921caaacab669f170d0b1043a7b0aa9d33a611bc
4
- data.tar.gz: 0775a1787a30941529cc07fb21a9dc0244f094ba
3
+ metadata.gz: 0d5201ef4533faad4c1d0b174be62ef093a2ac74
4
+ data.tar.gz: a789cdc717e7f13b366fa5d7bdda6fe14663fcd6
5
5
  SHA512:
6
- metadata.gz: 608a8459ad04db43c67430c8959a4847209303f5563690a71ef71088135a3c7615f4f6b180a1aad9710b39d28d18d49fbe3826279b1a77adde18d26fcf455acc
7
- data.tar.gz: 55700a7d962669f7c1e02c38c42ae9e050b1b686b2425a41e6a2861aa4010e14746c4652cd21912644b69c5e616539984906261bc0bc4bbd434491a8e7f6939c
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
- gem 'edtf'
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
- platform :rbx do
45
- gem 'rubysl'
46
- gem 'racc'
47
- gem 'json'
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
- require 'coveralls/rake/task'
43
- Coveralls::RakeTask.new
44
- task :test_with_coveralls => [:spec, :cucumber, 'coveralls:push']
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"
@@ -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[:page].to_s, :page
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[:editor], variable.to_s
34
+ value, name = item.data.unobservable_read_attribute(:editor), variable.to_s
35
35
  else
36
- value, name = item.data[variable], variable.to_s
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[variable], node.term
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| n[1].nil? || n[1].empty? }
16
+ suppressed = names.reject! { |n| item.suppressed? n[0] }
17
17
 
18
- # Filter out suppressed names only now, because
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
@@ -1,5 +1,5 @@
1
1
  module CiteProc
2
2
  module Ruby
3
- VERSION = '1.1.2'
3
+ VERSION = '1.1.3'
4
4
  end
5
5
  end
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.2
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-04-23 00:00:00.000000000 Z
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.5.1
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