iso-bib-item 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2e3ded14d469f9734fdab09cb033b9a0318d4862
4
- data.tar.gz: 5a329772e2c0d75d0285a877195b7d28122f6e5a
2
+ SHA256:
3
+ metadata.gz: 5c55d46b221d43dfbcd9224d18f314807b33926a0a4bb8951b039a23b0c258be
4
+ data.tar.gz: 71e7a963f3ea926687b5f6e36ed791dabdec532bfe82670101ec59e87992b63b
5
5
  SHA512:
6
- metadata.gz: a4858b2a74995529c1d6f80021bdba641ed9af66de133600872a13e5f66404bbecacc4b9394a528444f472ea6345037a7248332ea0ac8cf9d6e36675e9c5ec09
7
- data.tar.gz: 521ace1e261b7a2de9ca37d819fcf6b7e6d15b9bbb0913dbb7d3106aa1b207ca8627c0915c3ebf1536a8998bfc32138c4a51611bdbdc3434f7763037d23280e9
6
+ metadata.gz: e99e3d0aff6f4da0b6d8aeee1ce712d629d4c97ffd8b1ef12dc5fe75e79006420c22bfcfa24dfa89087e3df4c85ecb46e764acfca84aa99797f2dfdb14f6c15e
7
+ data.tar.gz: 259ff3b47c827b1e5c3475214b2fd4f844ccf9454be4d773554730890a61d492191d5c34868397a235495e489e94cc727ea152a506f26f7a1054a087ee5f4043
data/Gemfile.lock CHANGED
@@ -14,6 +14,8 @@ GEM
14
14
  diff-lcs (1.3)
15
15
  docile (1.3.1)
16
16
  duplicate (1.1.1)
17
+ equivalent-xml (0.6.0)
18
+ nokogiri (>= 1.4.3)
17
19
  isoics (0.1.6)
18
20
  json (2.1.0)
19
21
  method_source (0.9.0)
@@ -51,6 +53,7 @@ PLATFORMS
51
53
 
52
54
  DEPENDENCIES
53
55
  bundler (~> 1.16)
56
+ equivalent-xml (~> 0.6)
54
57
  iso-bib-item!
55
58
  pry-byebug
56
59
  rake (~> 10.0)
data/iso-bib-item.gemspec CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'rake', '~> 10.0'
28
28
  spec.add_development_dependency 'rspec', '~> 3.0'
29
29
  spec.add_development_dependency 'simplecov'
30
+ spec.add_development_dependency "equivalent-xml", "~> 0.6"
30
31
 
31
32
  spec.add_dependency 'isoics', '~> 0.1.6'
32
33
  spec.add_dependency 'nokogiri'
@@ -88,7 +88,7 @@ module IsoBibItem
88
88
  end
89
89
 
90
90
  def to_xml(builder)
91
- builder.source(content.to_s, type: type)
91
+ builder.link(content.to_s, type: type)
92
92
  end
93
93
  end
94
94
 
@@ -101,7 +101,7 @@ module IsoBibItem
101
101
  attr_reader :title
102
102
 
103
103
  # @return [Array<IsoBibItem::TypedUri>]
104
- attr_reader :source
104
+ attr_reader :link
105
105
 
106
106
  # @return [IsoBibItem::BibItemType]
107
107
  attr_reader :type
@@ -180,7 +180,7 @@ module IsoBibItem
180
180
  FormattedString.new(a)
181
181
  end
182
182
  @relations = DocRelationCollection.new(args[:relations] || [])
183
- @source = args[:source].map { |s| TypedUri.new(s) }
183
+ @link = args[:link].map { |s| TypedUri.new(s) }
184
184
  @series = args[:series]
185
185
  end
186
186
  # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
@@ -203,7 +203,7 @@ module IsoBibItem
203
203
  Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
204
204
  xml.bibitem(id: id) do
205
205
  title.each { |t| xml.title { t.to_xml xml } }
206
- source.each { |s| s.to_xml xml }
206
+ link.each { |s| s.to_xml xml }
207
207
  docidentifier.each { |di| di.to_xml xml }
208
208
  dates.each { |d| d.to_xml xml }
209
209
  contributors.each do |c|
@@ -113,12 +113,12 @@ module IsoBibItem
113
113
  # abbreviation=>String}, roles=>Array<String>}>]
114
114
  # @param copyright [Hash{owner=>Hash{name=>String, abbreviation=>String,
115
115
  # url=>String}, form=>String, to=>String}]
116
- # @param source [Array<Hash{type=>String, content=>String}>]
116
+ # @param link [Array<Hash{type=>String, content=>String}>]
117
117
  # @param relations [Array<Hash{type=>String, identifier=>String}>]
118
118
  def initialize(**args)
119
119
  super_args = args.select do |k|
120
120
  %i[
121
- id language script dates abstract contributors relations source
121
+ id language script dates abstract contributors relations link
122
122
  ].include? k
123
123
  end
124
124
  super(super_args)
@@ -130,7 +130,7 @@ module IsoBibItem
130
130
  @workgroup = IsoProjectGroup.new(args[:workgroup]) if args[:workgroup]
131
131
  @ics = args[:ics].map { |i| Ics.new(i) }
132
132
  @copyright = CopyrightAssociation.new args[:copyright] if args[:copyright]
133
- @source = args[:source].map { |s| TypedUri.new(s) }
133
+ @link = args[:link].map { |s| TypedUri.new(s) }
134
134
  @id_attribute = true
135
135
  end
136
136
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
@@ -189,7 +189,7 @@ module IsoBibItem
189
189
  # @param type [Symbol] type of url, can be :src/:obp/:rss
190
190
  # @return [String]
191
191
  def url(type = :src)
192
- @source.find { |s| s.type == type.to_s }.content.to_s
192
+ @link.find { |s| s.type == type.to_s }.content.to_s
193
193
  end
194
194
 
195
195
  # @return [String]
@@ -231,7 +231,7 @@ module IsoBibItem
231
231
  def render_xml(builder, **opts)
232
232
  builder.send(:bibitem, xml_attrs(type)) do
233
233
  title.each { |t| t.to_xml builder }
234
- source.each { |s| s.to_xml builder }
234
+ link.each { |s| s.to_xml builder }
235
235
  # docidentifier.to_xml builder
236
236
  builder.docidentifier shortref(opts.merge(no_year: true))
237
237
  dates.each { |d| d.to_xml builder, opts }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module IsoBibItem
4
- VERSION = '0.1.9'.freeze
4
+ VERSION = '0.1.10'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iso-bib-item
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-27 00:00:00.000000000 Z
11
+ date: 2018-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: equivalent-xml
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.6'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.6'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: isoics
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -178,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
192
  version: '0'
179
193
  requirements: []
180
194
  rubyforge_project:
181
- rubygems_version: 2.6.12
195
+ rubygems_version: 2.7.6
182
196
  signing_key:
183
197
  specification_version: 4
184
198
  summary: 'IsoBibItem: Ruby ISOXMLDOC impementation.'