serrano 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +28 -0
- data/.rubocop.yml +21 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +28 -28
- data/README.md +5 -5
- data/lib/serrano.rb +1 -1
- data/lib/serrano/cn.rb +1 -1
- data/lib/serrano/cnrequest.rb +1 -1
- data/lib/serrano/version.rb +1 -1
- data/serrano.gemspec +8 -7
- metadata +29 -34
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53cd7acc47b07971aa23568ba4abb703eb1f7ac4d73483c9b74efc97e9245234
|
4
|
+
data.tar.gz: 6307728ec83729a96377ac3a3b7a1c3642f19b746e7eb1d69e6805e9cfbe3d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b322cef9465854069679385525b296b9cdfcdba1b8b2b3b1a831bbeabc4e4b77f3686845619898d8809e02bf0079cebe23c9eb1c95908eeaa7df4b4de80d1a03
|
7
|
+
data.tar.gz: f511e386ab6c92b1e3f7984de2ca6e044fac87e7d824b7f8360c3165b7e9d7591b5d93b5af283f3c0e128c1a301146a7e8aedf5777ed9ceac5e34f4cd1e898ee
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
matrix:
|
14
|
+
os: [ ubuntu-latest, macos-latest ]
|
15
|
+
ruby: [ 2.5, 2.6, 2.7 ]
|
16
|
+
runs-on: ${{ matrix.os }}
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- name: Setup Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
- name: Install dependencies
|
24
|
+
run: bundle install
|
25
|
+
- name: Run tests
|
26
|
+
run: bundle exec rake test TESTOPTS="-v"
|
27
|
+
- name: Run rubocop
|
28
|
+
run: bundle exec rubocop
|
data/.rubocop.yml
CHANGED
@@ -16,6 +16,12 @@ Lint/UselessAssignment:
|
|
16
16
|
Exclude:
|
17
17
|
- 'lib/serrano/filters.rb'
|
18
18
|
|
19
|
+
Lint/RaiseException:
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
Lint/StructNewOverride:
|
23
|
+
Enabled: true
|
24
|
+
|
19
25
|
Style/HashEachMethods:
|
20
26
|
Enabled: true
|
21
27
|
|
@@ -27,4 +33,18 @@ Style/HashTransformValues:
|
|
27
33
|
|
28
34
|
Layout/LineLength:
|
29
35
|
Max: 525
|
30
|
-
|
36
|
+
|
37
|
+
Layout/SpaceAroundMethodCallOperator:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
Style/ExponentialNotation:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
44
|
+
Enabled: true
|
45
|
+
|
46
|
+
Style/SlicingWithRange:
|
47
|
+
Enabled: true
|
48
|
+
|
49
|
+
Lint/DeprecatedOpenSSLConstant:
|
50
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
serrano (0.6.
|
5
|
-
faraday (
|
6
|
-
faraday_middleware (
|
4
|
+
serrano (0.6.2)
|
5
|
+
faraday (~> 1.0, >= 1.0.1)
|
6
|
+
faraday_middleware (~> 1.0)
|
7
7
|
multi_json (~> 1.13, >= 1.13.1)
|
8
8
|
thor (>= 0.20, < 1.1)
|
9
9
|
|
@@ -20,45 +20,45 @@ GEM
|
|
20
20
|
crack (0.4.3)
|
21
21
|
safe_yaml (~> 1.0.0)
|
22
22
|
docile (1.3.2)
|
23
|
-
faraday (0.
|
23
|
+
faraday (1.0.1)
|
24
24
|
multipart-post (>= 1.2, < 3)
|
25
|
-
faraday_middleware (0.
|
26
|
-
faraday (
|
27
|
-
hashdiff (1.0.
|
28
|
-
jaro_winkler (1.5.4)
|
25
|
+
faraday_middleware (1.0.0)
|
26
|
+
faraday (~> 1.0)
|
27
|
+
hashdiff (1.0.1)
|
29
28
|
json (2.3.0)
|
30
29
|
multi_json (1.14.1)
|
31
30
|
multipart-post (2.1.1)
|
32
31
|
parallel (1.19.1)
|
33
|
-
parser (2.7.
|
32
|
+
parser (2.7.1.2)
|
34
33
|
ast (~> 2.4.0)
|
35
|
-
power_assert (1.1.
|
36
|
-
public_suffix (
|
34
|
+
power_assert (1.1.7)
|
35
|
+
public_suffix (4.0.4)
|
37
36
|
rainbow (3.0.0)
|
38
|
-
rake (
|
37
|
+
rake (13.0.1)
|
39
38
|
rexml (3.2.4)
|
40
|
-
rubocop (0.
|
41
|
-
jaro_winkler (~> 1.5.1)
|
39
|
+
rubocop (0.84.0)
|
42
40
|
parallel (~> 1.10)
|
43
41
|
parser (>= 2.7.0.1)
|
44
42
|
rainbow (>= 2.2.2, < 4.0)
|
45
43
|
rexml
|
44
|
+
rubocop-ast (>= 0.0.3)
|
46
45
|
ruby-progressbar (~> 1.7)
|
47
|
-
unicode-display_width (>= 1.4.0, <
|
46
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
47
|
+
rubocop-ast (0.0.3)
|
48
|
+
parser (>= 2.7.0.1)
|
48
49
|
ruby-progressbar (1.10.1)
|
49
50
|
safe_yaml (1.0.5)
|
50
|
-
simplecov (0.
|
51
|
+
simplecov (0.18.5)
|
51
52
|
docile (~> 1.1)
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
test-unit (3.3.4)
|
53
|
+
simplecov-html (~> 0.11)
|
54
|
+
simplecov-html (0.12.2)
|
55
|
+
test-unit (3.3.5)
|
56
56
|
power_assert
|
57
57
|
thor (1.0.1)
|
58
|
-
unicode-display_width (1.
|
58
|
+
unicode-display_width (1.7.0)
|
59
59
|
url (0.3.2)
|
60
|
-
vcr (
|
61
|
-
webmock (3.8.
|
60
|
+
vcr (6.0.0)
|
61
|
+
webmock (3.8.3)
|
62
62
|
addressable (>= 2.3.6)
|
63
63
|
crack (>= 0.3.2)
|
64
64
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -70,13 +70,13 @@ DEPENDENCIES
|
|
70
70
|
bundler (~> 2.0, >= 2.0.2)
|
71
71
|
codecov (~> 0.1.10)
|
72
72
|
json (~> 2.1)
|
73
|
-
rake (~>
|
74
|
-
rubocop (~> 0.
|
73
|
+
rake (~> 13.0, >= 12.3.1)
|
74
|
+
rubocop (~> 0.84.0)
|
75
75
|
serrano!
|
76
|
-
simplecov (~> 0.
|
76
|
+
simplecov (~> 0.18.5)
|
77
77
|
test-unit (~> 3.2, >= 3.2.7)
|
78
|
-
vcr (~>
|
78
|
+
vcr (~> 6.0)
|
79
79
|
webmock (~> 3.4, >= 3.4.1)
|
80
80
|
|
81
81
|
BUNDLED WITH
|
82
|
-
2.1.
|
82
|
+
2.1.4
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@ serrano
|
|
2
2
|
=========
|
3
3
|
|
4
4
|
[![gem version](https://img.shields.io/gem/v/serrano.svg)](https://rubygems.org/gems/serrano)
|
5
|
-
[![
|
6
|
-
[![codecov.io](
|
5
|
+
[![Ruby](https://github.com/sckott/serrano/workflows/Ruby/badge.svg)](https://github.com/sckott/serrano/actions)
|
6
|
+
[![codecov.io](https://codecov.io/github/sckott/serrano/coverage.svg?branch=master)](https://codecov.io/github/sckott/serrano?branch=master)
|
7
7
|
[![DOI](https://zenodo.org/badge/2600/sckott/serrano.svg)](https://zenodo.org/badge/latestdoi/2600/sckott/serrano)
|
8
8
|
|
9
9
|
`serrano` is a low level client for Crossref APIs
|
@@ -194,8 +194,8 @@ Commands:
|
|
194
194
|
* License: MIT
|
195
195
|
|
196
196
|
[crapi]: https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md
|
197
|
-
[cn]:
|
198
|
-
[tdm]:
|
199
|
-
[ccount]:
|
197
|
+
[cn]: https://citation.crosscite.org/docs.html
|
198
|
+
[tdm]: https://www.crossref.org/education/retrieve-metadata/rest-api/text-and-data-mining/
|
199
|
+
[ccount]: https://labs.crossref.org/openurl/
|
200
200
|
[csl]: https://github.com/citation-style-language/styles
|
201
201
|
[changelog]: https://github.com/sckott/serrano/blob/master/CHANGELOG.md
|
data/lib/serrano.rb
CHANGED
@@ -651,7 +651,7 @@ module Serrano
|
|
651
651
|
# Serrano.citation_count(doi: "10.1016/j.fbr.2012.01.001")
|
652
652
|
# # DOI not found
|
653
653
|
# Serrano.citation_count(doi: "10.1016/j.fbr.2012")
|
654
|
-
def self.citation_count(doi:, url: '
|
654
|
+
def self.citation_count(doi:, url: 'https://www.crossref.org/openurl/',
|
655
655
|
key: 'cboettig@ropensci.org', options: nil)
|
656
656
|
|
657
657
|
args = { id: 'doi:' + doi, pid: key, noredirect: true }
|
data/lib/serrano/cn.rb
CHANGED
@@ -6,7 +6,7 @@ require 'serrano/cnrequest'
|
|
6
6
|
##
|
7
7
|
# ContentNegotiation - Content Negotiation class
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see https://citation.crosscite.org/docs.html for details
|
10
10
|
module Serrano
|
11
11
|
class ContentNegotiation
|
12
12
|
attr_accessor :ids
|
data/lib/serrano/cnrequest.rb
CHANGED
@@ -69,7 +69,7 @@ def make_request(conn, ids, format, style, locale)
|
|
69
69
|
type = CN_FORMAT_HEADERS.select { |x, _| x.include? format }.values[0]
|
70
70
|
|
71
71
|
if format == 'citeproc-json'
|
72
|
-
endpt = '
|
72
|
+
endpt = 'https://api.crossref.org/works/' + ids + '/' + type
|
73
73
|
cr_works = Faraday.new(url: endpt)
|
74
74
|
cr_works.headers[:user_agent] = make_ua
|
75
75
|
cr_works.headers['X-USER-AGENT'] = make_ua
|
data/lib/serrano/version.rb
CHANGED
data/serrano.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.version = Serrano::VERSION
|
10
10
|
s.platform = Gem::Platform::RUBY
|
11
11
|
s.required_ruby_version = '>= 2.1'
|
12
|
-
s.date = '2020-
|
12
|
+
s.date = '2020-05-29'
|
13
13
|
s.summary = 'Crossref Client'
|
14
14
|
s.description = 'Low Level Ruby Client for the Crossref Search API'
|
15
15
|
s.authors = 'Scott Chamberlain'
|
@@ -28,20 +28,21 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
|
29
29
|
s.add_development_dependency 'codecov', '~> 0.1.10'
|
30
30
|
s.add_development_dependency 'json', '~> 2.1'
|
31
|
-
s.add_development_dependency 'rake', '
|
32
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
33
|
-
s.add_development_dependency 'simplecov', '~> 0.
|
31
|
+
s.add_development_dependency 'rake', '>= 12.3.1', '~> 13.0'
|
32
|
+
s.add_development_dependency 'rubocop', '~> 0.84.0'
|
33
|
+
s.add_development_dependency 'simplecov', '~> 0.18.5'
|
34
34
|
s.add_development_dependency 'test-unit', '~> 3.2', '>= 3.2.7'
|
35
|
-
s.add_development_dependency 'vcr', '~>
|
35
|
+
s.add_development_dependency 'vcr', '~> 6.0'
|
36
36
|
s.add_development_dependency 'webmock', '~> 3.4', '>= 3.4.1'
|
37
37
|
|
38
|
-
s.add_runtime_dependency 'faraday', '
|
39
|
-
s.add_runtime_dependency 'faraday_middleware', '
|
38
|
+
s.add_runtime_dependency 'faraday', '~> 1.0', '>= 1.0.1'
|
39
|
+
s.add_runtime_dependency 'faraday_middleware', '~> 1.0'
|
40
40
|
s.add_runtime_dependency 'multi_json', '~> 1.13', '>= 1.13.1'
|
41
41
|
s.add_runtime_dependency 'thor', '>= 0.20', '< 1.1'
|
42
42
|
|
43
43
|
s.metadata = {
|
44
44
|
'homepage_uri' => 'https://github.com/sckott/serrano',
|
45
|
+
'documentation_uri' => 'https://www.rubydoc.info/gems/serrano',
|
45
46
|
'changelog_uri' =>
|
46
47
|
"https://github.com/sckott/serrano/releases/tag/v#{s.version}",
|
47
48
|
'source_code_uri' => 'https://github.com/sckott/serrano',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Chamberlain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -62,50 +62,50 @@ dependencies:
|
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '12.3'
|
68
65
|
- - ">="
|
69
66
|
- !ruby/object:Gem::Version
|
70
67
|
version: 12.3.1
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '13.0'
|
71
71
|
type: :development
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- - "~>"
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '12.3'
|
78
75
|
- - ">="
|
79
76
|
- !ruby/object:Gem::Version
|
80
77
|
version: 12.3.1
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '13.0'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rubocop
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: 0.
|
87
|
+
version: 0.84.0
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: 0.
|
94
|
+
version: 0.84.0
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: simplecov
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
99
|
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.
|
101
|
+
version: 0.18.5
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: 0.
|
108
|
+
version: 0.18.5
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: test-unit
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,14 +132,14 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: '
|
135
|
+
version: '6.0'
|
136
136
|
type: :development
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
140
|
- - "~>"
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: '
|
142
|
+
version: '6.0'
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: webmock
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,42 +164,36 @@ dependencies:
|
|
164
164
|
name: faraday
|
165
165
|
requirement: !ruby/object:Gem::Requirement
|
166
166
|
requirements:
|
167
|
-
- - "
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
version: '0.15'
|
170
|
-
- - "<"
|
167
|
+
- - "~>"
|
171
168
|
- !ruby/object:Gem::Version
|
172
169
|
version: '1.0'
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: 1.0.1
|
173
173
|
type: :runtime
|
174
174
|
prerelease: false
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
|
-
- - "
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '0.15'
|
180
|
-
- - "<"
|
177
|
+
- - "~>"
|
181
178
|
- !ruby/object:Gem::Version
|
182
179
|
version: '1.0'
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: 1.0.1
|
183
183
|
- !ruby/object:Gem::Dependency
|
184
184
|
name: faraday_middleware
|
185
185
|
requirement: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- - "
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
version: 0.12.2
|
190
|
-
- - "<"
|
187
|
+
- - "~>"
|
191
188
|
- !ruby/object:Gem::Version
|
192
|
-
version:
|
189
|
+
version: '1.0'
|
193
190
|
type: :runtime
|
194
191
|
prerelease: false
|
195
192
|
version_requirements: !ruby/object:Gem::Requirement
|
196
193
|
requirements:
|
197
|
-
- - "
|
198
|
-
- !ruby/object:Gem::Version
|
199
|
-
version: 0.12.2
|
200
|
-
- - "<"
|
194
|
+
- - "~>"
|
201
195
|
- !ruby/object:Gem::Version
|
202
|
-
version:
|
196
|
+
version: '1.0'
|
203
197
|
- !ruby/object:Gem::Dependency
|
204
198
|
name: multi_json
|
205
199
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,10 +241,10 @@ executables:
|
|
247
241
|
extensions: []
|
248
242
|
extra_rdoc_files: []
|
249
243
|
files:
|
244
|
+
- ".github/workflows/ruby.yml"
|
250
245
|
- ".gitignore"
|
251
246
|
- ".rubocop.yml"
|
252
247
|
- ".rubocop_todo.yml"
|
253
|
-
- ".travis.yml"
|
254
248
|
- CHANGELOG.md
|
255
249
|
- CODE_OF_CONDUCT.md
|
256
250
|
- Gemfile
|
@@ -278,7 +272,8 @@ licenses:
|
|
278
272
|
- MIT
|
279
273
|
metadata:
|
280
274
|
homepage_uri: https://github.com/sckott/serrano
|
281
|
-
|
275
|
+
documentation_uri: https://www.rubydoc.info/gems/serrano
|
276
|
+
changelog_uri: https://github.com/sckott/serrano/releases/tag/v0.6.2
|
282
277
|
source_code_uri: https://github.com/sckott/serrano
|
283
278
|
bug_tracker_uri: https://github.com/sckott/serrano/issues
|
284
279
|
post_install_message:
|