isobib 0.2.6 → 0.3.0

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
2
  SHA256:
3
- metadata.gz: 2da9b3d54cd5d9d2cb445f408f02d66277ffad53d2c8ffaf66fa1fc661c90fc1
4
- data.tar.gz: 95bd69ed6ef1aba5bc9d070b0749490686c297e6f9dd193e888369a26d4fa54d
3
+ metadata.gz: 42b9e332cc51cefe03ad7df9205e850e0c4dcbf944c9407858e9e8f6ddff7885
4
+ data.tar.gz: 0dd1cbed8cfe1093e5f759f880096dbb05e90e7dd1cd3167807692eabf6f2b59
5
5
  SHA512:
6
- metadata.gz: 0bea7ff7ba588d59fbdd880c0d2ab84b9378586ec326c5456f11fe9185b72428a3c936a16f5bcd633bd5b8d1a204c8503fbe7c679e0460f28dbe8751b0b3e4a7
7
- data.tar.gz: ddea54a266e48af26e9eb93e40cb2abc853a7e16af0af5fa76e30cff269ae8f11c24f006de19856963f32a43836e676b68ad845cda139cac5f32f7e0353c473a
6
+ metadata.gz: 464dc9d088ca1d308ad010e7267b15d4833d79a171138a81fc6306b7dd0607f2fe1e2add27f16f58644037d2bd74e7d058d50956eef52295082f40ba759d28c7
7
+ data.tar.gz: 05c60d9339d310fd5083988e476f71d78581451331e31c72738567cd1d1402d55737c6d1d67f36eb8e38e9b8449eb8ce3c32651b3319bbd9ddc8011ef2382d25
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- isobib (0.2.6)
4
+ isobib (0.3.0)
5
5
  algoliasearch
6
- iso-bib-item (~> 0.2.4)
6
+ iso-bib-item (~> 0.3.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -18,7 +18,7 @@ GEM
18
18
  equivalent-xml (0.6.0)
19
19
  nokogiri (>= 1.4.3)
20
20
  httpclient (2.8.3)
21
- iso-bib-item (0.2.5)
21
+ iso-bib-item (0.3.0)
22
22
  isoics (~> 0.1.6)
23
23
  nokogiri (~> 1.8.4)
24
24
  ruby_deep_clone (~> 0.8.0)
data/README.adoc CHANGED
@@ -163,6 +163,13 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
163
163
 
164
164
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
165
165
 
166
+
167
+ == Exceptional Citations
168
+
169
+ This gem retrieves bibliographic descriptions of ISO documents by doing searches on the ISO website, http://www.iso.org, and screenscraping the document that matches the queried document identifier. The following documents are not returned as search results from the ISO website, and the gem returns manually generated references to them.
170
+
171
+ * `IEV`: used in the metanorma-iso gem to reference Electropedia entries generically. Is resolved to an "all parts" reference to IEC 60050, which in turn is resolved into the specific documents cited by their top-level clause.
172
+
166
173
  == Contributing
167
174
 
168
175
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/iso-bib-item.
data/isobib.gemspec CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
35
35
 
36
36
  spec.add_dependency 'algoliasearch'
37
- spec.add_dependency 'iso-bib-item', '~> 0.2.4'
37
+ spec.add_dependency 'iso-bib-item', '~> 0.3.0'
38
38
  end
@@ -83,7 +83,7 @@ module Isobib
83
83
  <bibitem type="international-standard" id="IEV">
84
84
  <title format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary</title>
85
85
  <link type="src">http://www.electropedia.org</link>
86
- <docidentifier>#{code}</docidentifier>
86
+ <docidentifier>#{code}:2011</docidentifier>
87
87
  <date type="published"><on>2011</on></date>
88
88
  <contributor>
89
89
  <role type="publisher"/>
@@ -193,9 +193,11 @@ module Isobib
193
193
  # @param doc [Nokogiri::HTML::Document]
194
194
  # @return [Hash]
195
195
  def fetch_docid(doc)
196
- item_ref = doc.xpath("//strong[@id='itemReference']").text
197
- .match(/^(.*?\d+)-?((?<=-)\d+|)/)
198
- { project_number: item_ref[1], part_number: item_ref[2], prefix: nil }
196
+ item_ref = doc.xpath("//strong[@id='itemReference']") or
197
+ return { project_number: "?", part_number: "", prefix: nil, id: "?"}
198
+ m = item_ref.text.match(/^(.*?\d+)-?((?<=-)\d+|)/)
199
+ { project_number: m[1], part_number: m[2], prefix: nil,
200
+ id: item_ref.text, type: "ISO" }
199
201
  end
200
202
 
201
203
  # Fetch status.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Isobib
4
- VERSION = '0.2.6'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -6,7 +6,8 @@ module Relaton
6
6
 
7
7
  def initialize
8
8
  @short = :isobib
9
- @prefix = %r{^(ISO|IEC)[ /]|^IEV($| )}
9
+ @prefix = "ISO"
10
+ @defaultprefix = %r{^(ISO)[ /]|^IEV($| )|^IEC 60050}
10
11
  end
11
12
 
12
13
  def get(code, date, opts)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isobib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
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-09-01 00:00:00.000000000 Z
11
+ date: 2018-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.2.4
131
+ version: 0.3.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.2.4
138
+ version: 0.3.0
139
139
  description: 'IsoBib: retrieve ISO Standards for bibliographic use using the BibliographicItem
140
140
  model'
141
141
  email: