rfcbib 0.2.2 → 0.2.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.lock +14 -14
- data/LICENSE.txt +21 -17
- data/README.adoc +4 -0
- data/lib/rfcbib/scrapper.rb +7 -5
- data/lib/rfcbib/version.rb +1 -1
- data/rfcbib.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e21e2f90cfe142b28809bb2f54b99c58cb9221b6d1e47dcf15cf6a0d4b8038b4
|
|
4
|
+
data.tar.gz: 16cbb242630b0541c63a7b2c5db5c11adbcbd2a992d229e4ae3ba55d2fd6ee38
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 478643da005f8bede163284cd838820a50b37d88bd6d932d5652d9379d8d3b75207a293789ec33ec822d0831c0f5eaead44c8f698bc8eadb7395edaa111eebe7
|
|
7
|
+
data.tar.gz: d1e0e72605031865e2bce5162b00029fe76d2a37f4c366e130d8839ba767cf98097e9713af275f155aabe0f6c09f7a5e963ac93aaad8596f5bedd52f224ca442
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rfcbib (0.2.
|
|
4
|
+
rfcbib (0.2.3)
|
|
5
5
|
iso-bib-item (~> 0.2.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -13,11 +13,11 @@ GEM
|
|
|
13
13
|
docile (1.3.1)
|
|
14
14
|
equivalent-xml (0.6.0)
|
|
15
15
|
nokogiri (>= 1.4.3)
|
|
16
|
-
iso-bib-item (0.2.
|
|
16
|
+
iso-bib-item (0.2.5)
|
|
17
17
|
isoics (~> 0.1.6)
|
|
18
18
|
nokogiri (~> 1.8.4)
|
|
19
19
|
ruby_deep_clone (~> 0.8.0)
|
|
20
|
-
isoics (0.1.
|
|
20
|
+
isoics (0.1.7)
|
|
21
21
|
json (2.1.0)
|
|
22
22
|
method_source (0.9.0)
|
|
23
23
|
mini_portile2 (2.3.0)
|
|
@@ -30,19 +30,19 @@ GEM
|
|
|
30
30
|
byebug (~> 10.0)
|
|
31
31
|
pry (~> 0.10)
|
|
32
32
|
rake (10.5.0)
|
|
33
|
-
rspec (3.
|
|
34
|
-
rspec-core (~> 3.
|
|
35
|
-
rspec-expectations (~> 3.
|
|
36
|
-
rspec-mocks (~> 3.
|
|
37
|
-
rspec-core (3.
|
|
38
|
-
rspec-support (~> 3.
|
|
39
|
-
rspec-expectations (3.
|
|
33
|
+
rspec (3.8.0)
|
|
34
|
+
rspec-core (~> 3.8.0)
|
|
35
|
+
rspec-expectations (~> 3.8.0)
|
|
36
|
+
rspec-mocks (~> 3.8.0)
|
|
37
|
+
rspec-core (3.8.0)
|
|
38
|
+
rspec-support (~> 3.8.0)
|
|
39
|
+
rspec-expectations (3.8.1)
|
|
40
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
41
|
-
rspec-support (~> 3.
|
|
42
|
-
rspec-mocks (3.
|
|
41
|
+
rspec-support (~> 3.8.0)
|
|
42
|
+
rspec-mocks (3.8.0)
|
|
43
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
44
|
-
rspec-support (~> 3.
|
|
45
|
-
rspec-support (3.
|
|
44
|
+
rspec-support (~> 3.8.0)
|
|
45
|
+
rspec-support (3.8.0)
|
|
46
46
|
ruby_deep_clone (0.8.0)
|
|
47
47
|
simplecov (0.16.1)
|
|
48
48
|
docile (~> 1.1)
|
data/LICENSE.txt
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
BSD 2-Clause License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018
|
|
3
|
+
Copyright (c) 2018, Ribose
|
|
4
|
+
All rights reserved.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.adoc
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
= Rfcbib
|
|
2
2
|
|
|
3
|
+
image:https://img.shields.io/gem/v/rfcbib.svg["Gem Version", link="https://rubygems.org/gems/rfcbib"]
|
|
4
|
+
image:https://img.shields.io/travis/riboseinc/rfcbib/master.svg["Build Status", link="https://travis-ci.org/riboseinc/rfcbib"]
|
|
5
|
+
image:https://codeclimate.com/github/riboseinc/rfcbib/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/rfcbib"]
|
|
6
|
+
|
|
3
7
|
RFCBib is a Ruby gem that search and fetch RFC standards.
|
|
4
8
|
The standards scrape form https://www.rfc-editor.org/search/rfc_search.php
|
|
5
9
|
|
data/lib/rfcbib/scrapper.rb
CHANGED
|
@@ -66,7 +66,7 @@ module RfcBib
|
|
|
66
66
|
@reference.xpath('//front/author').map do |author|
|
|
67
67
|
entity = IsoBibItem::Person.new(
|
|
68
68
|
name: full_name(author),
|
|
69
|
-
|
|
69
|
+
affiliation: [affiliation(author)],
|
|
70
70
|
contacts: contacts(author.at('//address'))
|
|
71
71
|
)
|
|
72
72
|
{ entity: entity, roles: [contributor_role(author)] }
|
|
@@ -132,7 +132,7 @@ module RfcBib
|
|
|
132
132
|
|
|
133
133
|
# @param author [Nokogiri::XML::Document]
|
|
134
134
|
# @return [IsoBibItem::Affilation]
|
|
135
|
-
def
|
|
135
|
+
def affiliation(author)
|
|
136
136
|
organization = author.at('//organization')
|
|
137
137
|
IsoBibItem::Affilation.new IsoBibItem::Organization.new(
|
|
138
138
|
name: organization.text.empty? ? 'IETF' : organization.text,
|
|
@@ -164,14 +164,15 @@ module RfcBib
|
|
|
164
164
|
# @return [Array<IsoBibItem::DocumentIdentifier>]
|
|
165
165
|
#
|
|
166
166
|
def docids(id)
|
|
167
|
-
ret =
|
|
167
|
+
ret = []
|
|
168
|
+
ret << IsoBibItem::DocumentIdentifier.new(type: "IETF", id: id)
|
|
169
|
+
ret = ret + @reference.xpath('//seriesinfo').map do |si|
|
|
168
170
|
next unless si[:name] == 'DOI'
|
|
169
171
|
IsoBibItem::DocumentIdentifier.new(
|
|
170
172
|
id: si[:value],
|
|
171
173
|
type: si[:name]
|
|
172
174
|
)
|
|
173
175
|
end.compact
|
|
174
|
-
ret << IsoBibItem::DocumentIdentifier.new(type: "IETF", id: id)
|
|
175
176
|
end
|
|
176
177
|
|
|
177
178
|
#
|
|
@@ -186,7 +187,8 @@ module RfcBib
|
|
|
186
187
|
title: IsoBibItem::FormattedString.new(
|
|
187
188
|
content: si[:name], language: language, script: 'Latn'
|
|
188
189
|
),
|
|
189
|
-
number: si[:value]
|
|
190
|
+
number: si[:value],
|
|
191
|
+
type: "main"
|
|
190
192
|
)
|
|
191
193
|
end.compact
|
|
192
194
|
end
|
data/lib/rfcbib/version.rb
CHANGED
data/rfcbib.gemspec
CHANGED
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
|
15
15
|
spec.description = 'RfcBib: retrieve RFC Standards for bibliographic use '\
|
|
16
16
|
'using the BibliographicItem model'
|
|
17
17
|
spec.homepage = 'https://github.com/riboseinc/rfcbib'
|
|
18
|
-
spec.license = '
|
|
18
|
+
spec.license = 'BSD-2-Clause'
|
|
19
19
|
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
21
21
|
f.match(%r{^(test|spec|features)/})
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rfcbib
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
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-
|
|
11
|
+
date: 2018-08-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -135,7 +135,7 @@ files:
|
|
|
135
135
|
- rfcbib.gemspec
|
|
136
136
|
homepage: https://github.com/riboseinc/rfcbib
|
|
137
137
|
licenses:
|
|
138
|
-
-
|
|
138
|
+
- BSD-2-Clause
|
|
139
139
|
metadata: {}
|
|
140
140
|
post_install_message:
|
|
141
141
|
rdoc_options: []
|