serrano 0.5.0 → 1.0.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: e329983c57815e197e683e64cf0a55300ede36bec3ada9a58612d4abd209f02a
4
- data.tar.gz: 25dbce2ee336448219f50ea8e669da1bab787ccdd535f86d59c3aece3798fc71
3
+ metadata.gz: 75729f32a4cfabb79a33d78638a91c253fb76a8ec3abc8d9ecc743056464d38d
4
+ data.tar.gz: 8e47227794125651a8c35450a8f7f5aaa5c377ac461ea2433836d00b76fdb699
5
5
  SHA512:
6
- metadata.gz: ffaf70de61b00919b7418125f73e23b34195445de5fcb23d9b32793e30d5d4971ba266e1d8421c76cef6f1e824b6ee87e6235f23a7fb3945f2c5447eea351f8d
7
- data.tar.gz: ab93cece3c5e5661bedcf06812ff28276e192fc54a648b0e97902799cabc333ea5d14d51f67a60ef6b83555aabade56a19b5b664152ca1eef0bc2d4667ba217f
6
+ metadata.gz: a1be1549ce95a4fa7bac8d417f28f9c2d70e800b48f1f7b8c4471cf8461ca37288dd9a2f06c5c15376364e3af4f8d4e61589ad0b4e0f8cdbbd6c1bf46fc170db
7
+ data.tar.gz: d21603574250c471ea20c3fe7f433d5ef56715307442d8067814757b522306afdca717bbcd612eda4055c1e1b41fc2a8a3f9d340d45dd57127c9a3950b24f70a
@@ -0,0 +1,30 @@
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
+ env:
18
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+ - name: Setup Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby }}
25
+ - name: Install dependencies
26
+ run: bundle install
27
+ - name: Run tests
28
+ run: |
29
+ bundle exec rake install
30
+ bundle exec rake test TESTOPTS="-v"
data/.gitignore CHANGED
@@ -26,7 +26,7 @@ build/
26
26
 
27
27
  # for a library or gem, you might want to ignore these files since the code is
28
28
  # intended to run in multiple environments; otherwise, check them in:
29
- #Gemfile.lock
29
+ Gemfile.lock
30
30
  .ruby-version
31
31
  .ruby-gemset
32
32
 
@@ -36,3 +36,5 @@ build/
36
36
  cache/
37
37
 
38
38
  lib/serrano/response.rb
39
+
40
+ cursor_testing.rb
@@ -1,3 +1,29 @@
1
+ ## 1.0.0 (2020-10-19)
2
+
3
+ * updated dependency versions
4
+
5
+ ## 0.6.2 (2020-05-29)
6
+
7
+ * put documentation link back in rubygems page (#132)
8
+
9
+ ## 0.6.0 (2020-02-18)
10
+
11
+ * query.title (`query_title` query filter as used here) has been removed; use `query_bibliographic` instead (#111)
12
+ * bump `faraday` to version 0.17.1 from 0.17.0 (via dependabot) (#107)
13
+ * bump `json` to version 2.3 from 2.2 (via dependabot) (#109)
14
+ * bump `thor` minimum version (via dependabot) (#110)
15
+ * better checking of filters; always check filters for proper formatting and acceptable types; improve filter tests; link to information on filters (#105) via PR from @beechnut
16
+
17
+ ## 0.5.4 (2019-11-27)
18
+
19
+ * `Serrano.registration_agency` fixed: a change in an internal function caused this function to fail; tests added to prevent this in the future (#106)
20
+ * bundle update, changes in gemfile.lock
21
+
22
+ ## 0.5.2 (2019-08-07)
23
+
24
+ * fix url encoding (#51)
25
+ * started using Rubocop; many styling changes (#52)
26
+
1
27
  ## 0.5.0 (2018-04-08)
2
28
 
3
29
  * Updated dependency versions
@@ -21,5 +21,5 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be repor
21
21
  opening an issue or contacting one or more of the project maintainers.
22
22
 
23
23
  This Code of Conduct is adapted from the Contributor Covenant
24
- (http:contributor-covenant.org), version 1.0.0, available at
25
- http://contributor-covenant.org/version/1/0/0/
24
+ (https://contributor-covenant.org), version 1.0.0, available at
25
+ https://contributor-covenant.org/version/1/0/0/
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
2
4
 
3
5
  gemspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2018 Scott Chamberlain
1
+ Copyright (C) 2020 Scott Chamberlain
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.md CHANGED
@@ -2,19 +2,22 @@ serrano
2
2
  =========
3
3
 
4
4
  [![gem version](https://img.shields.io/gem/v/serrano.svg)](https://rubygems.org/gems/serrano)
5
- [![Build Status](https://api.travis-ci.org/sckott/serrano.png)](https://travis-ci.org/sckott/serrano)
6
- [![codecov.io](http://codecov.io/github/sckott/serrano/coverage.svg?branch=master)](http://codecov.io/github/sckott/serrano?branch=master)
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
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
8
9
 
9
10
  `serrano` is a low level client for Crossref APIs
10
11
 
11
- Docs: http://www.rubydoc.info/gems/serrano
12
+ Docs: https://www.rubydoc.info/gems/serrano
12
13
 
13
14
  Other Crossref API clients:
14
15
 
15
16
  - Python: [habanero](https://github.com/sckott/habanero)
16
17
  - R: [rcrossref](https://github.com/ropensci/rcrossref)
17
18
 
19
+ Crossref's API issue tracker: https://gitlab.com/crossref/issues
20
+
18
21
  ## Changes
19
22
 
20
23
  For changes see the [Changelog][changelog]
@@ -44,7 +47,7 @@ Other methods:
44
47
 
45
48
  Note about searching:
46
49
 
47
- You are using the Crossref search API described at https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md. When you search with query terms, on Crossref servers they are not searching full text, or even abstracts of articles, but only what is available in the data that is returned to you. That is, they search article titles, authors, etc. For some discussion on this, see https://github.com/CrossRef/rest-api-doc/issues/101
50
+ You are using the Crossref search API described at https://github.com/CrossRef/rest-api-doc When you search with query terms, on Crossref servers they are not searching full text, or even abstracts of articles, but only what is available in the data that is returned to you. That is, they search article titles, authors, etc. For some discussion on this, see https://gitlab.com/crossref/issues/issues/101
48
51
 
49
52
  Rate limits:
50
53
 
@@ -60,6 +63,11 @@ To get in the polite pool it's a good idea now to include a `mailto` email
60
63
  address. See docs for more information. TLDR: set your email in an env var `CROSSREF_EMAIL`.
61
64
 
62
65
 
66
+ URL Encoding:
67
+
68
+ We do URL encoding of DOIs for you for all methods except `Serrano.citation_count` which doesn't work if you encode DOIs beforehand. We use `ERB::Util.url_encode` to encode.
69
+
70
+
63
71
  ## Install
64
72
 
65
73
  ### Release version
@@ -115,6 +123,12 @@ Search works by query string
115
123
  Serrano.works(query: "ecology")
116
124
  ```
117
125
 
126
+ Search works using metadata filters. See [CrossRef filter docs](https://github.com/CrossRef/rest-api-doc#filter-names).
127
+
128
+ ```ruby
129
+ Serrano.works(query: "ecology", filter: { has_abstract: true })
130
+ ```
131
+
118
132
  Search journals by publisher name
119
133
 
120
134
  ```ruby
@@ -181,8 +195,8 @@ Commands:
181
195
  * License: MIT
182
196
 
183
197
  [crapi]: https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md
184
- [cn]: http://www.crosscite.org/cn/
185
- [tdm]: http://www.crossref.org/tdm/
186
- [ccount]: http://labs.crossref.org/openurl/
198
+ [cn]: https://citation.crosscite.org/docs.html
199
+ [tdm]: https://www.crossref.org/education/retrieve-metadata/rest-api/text-and-data-mining/
200
+ [ccount]: https://labs.crossref.org/openurl/
187
201
  [csl]: https://github.com/citation-style-language/styles
188
202
  [changelog]: https://github.com/sckott/serrano/blob/master/CHANGELOG.md
data/Rakefile CHANGED
@@ -1,19 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
- require 'rake/testtask'
4
+ require "rake/testtask"
5
+ require "standard"
6
+ require "standard/rake"
3
7
 
4
8
  Rake::TestTask.new do |t|
5
9
  t.libs << "test"
6
- t.test_files = FileList['test/test-*.rb']
10
+ t.test_files = FileList["test/test_*.rb"]
7
11
  t.verbose = true
8
12
  t.warning = false
9
13
  end
10
14
 
11
15
  desc "Run tests"
12
- task :default => :test
16
+ task default: :test
13
17
 
14
18
  desc "Build serrano docs"
15
19
  task :docs do
16
- system "yardoc"
20
+ system "yardoc"
17
21
  end
18
22
 
19
23
  desc "bundle install"
@@ -28,15 +32,15 @@ end
28
32
 
29
33
  desc "Build serrano"
30
34
  task :build do
31
- system "gem build serrano.gemspec"
35
+ system "gem build serrano.gemspec"
32
36
  end
33
37
 
34
38
  desc "Install serrano"
35
- task :install => [:bundle, :build] do
36
- system "gem install serrano-#{Serrano::VERSION}.gem"
39
+ task install: %i[bundle build] do
40
+ system "gem install serrano-#{Serrano::VERSION}.gem"
37
41
  end
38
42
 
39
43
  desc "Release to Rubygems"
40
- task :release => :build do
44
+ task release: :build do
41
45
  system "gem push serrano-#{Serrano::VERSION}.gem"
42
46
  end
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "thor"
4
- require "serrano"
5
- require "multi_json"
4
+ require 'thor'
5
+ require 'serrano'
6
+ require 'multi_json'
6
7
 
7
8
  class Sr < Thor
8
9
  include Thor::Actions
9
10
  # class_option :json, :type => :boolean, :default => false
10
11
 
11
- desc "works [DOIs]", "Get works by DOIs"
12
+ desc 'works [DOIs]', 'Get works by DOIs'
12
13
  long_desc <<-LONGDESC
13
14
  `serrano works` accepts one or more DOIs to search for works
14
15
 
@@ -47,17 +48,17 @@ class Sr < Thor
47
48
  \x5"http://orcid.org/0000-0003-4087-8021"
48
49
  \x5"http://orcid.org/0000-0002-2076-5452"
49
50
  LONGDESC
50
- option :json, :type => :boolean, :default => false
51
- option :filter, :type => :hash, :default => nil
52
- option :limit, :type => :numeric, :default => nil
53
- def works(ids=nil)
54
- if ids.nil?
55
- out = Serrano.works(filter: options[:filter], limit: options[:limit])
56
- else
57
- out = Serrano.works(ids: ids.split(","), filter: options[:filter])
58
- end
51
+ option :json, type: :boolean, default: false
52
+ option :filter, type: :hash, default: nil
53
+ option :limit, type: :numeric, default: nil
54
+ def works(ids = nil)
55
+ out = if ids.nil?
56
+ Serrano.works(filter: options[:filter], limit: options[:limit])
57
+ else
58
+ Serrano.works(ids: ids.split(','), filter: options[:filter])
59
+ end
59
60
  if !options[:json]
60
- out = out.collect { |x| x['message'].select { |k,v| k[/DOI|type|title/] } }
61
+ out = out.collect { |x| x['message'].select { |k, _v| k[/DOI|type|title/] } }
61
62
  out.each do |x|
62
63
  puts 'DOI: ' + x['DOI'].to_s
63
64
  puts 'type: ' + x['type']
@@ -69,7 +70,7 @@ class Sr < Thor
69
70
  end
70
71
  end
71
72
 
72
- desc "members [member IDs]", "Get members by id"
73
+ desc 'members [member IDs]', 'Get members by id'
73
74
  long_desc <<-LONGDESC
74
75
  `serrano members` accepts one or more Crossref member IDs
75
76
 
@@ -96,26 +97,26 @@ class Sr < Thor
96
97
 
97
98
  24 7 45 31 22 67 72 17 53 75 0 68 12 16 50 79 40 18 40 195
98
99
  LONGDESC
99
- option :json, :type => :boolean, :default => false
100
- option :query, :type => :string, :default => nil
101
- option :limit, :type => :numeric, :default => nil
102
- option :works, :type => :boolean, :default => false
103
- def members(ids=nil)
100
+ option :json, type: :boolean, default: false
101
+ option :query, type: :string, default: nil
102
+ option :limit, type: :numeric, default: nil
103
+ option :works, type: :boolean, default: false
104
+ def members(ids = nil)
104
105
  if ids.nil?
105
106
  out = Serrano.members(query: options[:query], limit: options[:limit],
106
- works: options[:works])
107
+ works: options[:works])
107
108
  else
108
- out = Serrano.members(ids: ids.split(","), query: options[:query], limit: options[:limit],
109
- works: options[:works])
109
+ out = Serrano.members(ids: ids.split(','), query: options[:query], limit: options[:limit],
110
+ works: options[:works])
110
111
  end
111
112
 
112
113
  if !options[:json]
113
114
  if !options[:works]
114
- if out.class == Hash
115
- out = out['message']['items']
116
- else
117
- out = out.collect { |x| x['message'] }
118
- end
115
+ out = if out.class == Hash
116
+ out['message']['items']
117
+ else
118
+ out.collect { |x| x['message'] }
119
+ end
119
120
 
120
121
  # out = out.collect { |x| x['message'].select { |k,v| k[/id|primary-name/] } }
121
122
  out.each do |x|
@@ -131,8 +132,7 @@ class Sr < Thor
131
132
  end
132
133
  end
133
134
 
134
-
135
- desc "prefixes [DOI prefixes]", "Search for prefixes by DOI prefix"
135
+ desc 'prefixes [DOI prefixes]', 'Search for prefixes by DOI prefix'
136
136
  long_desc <<-LONGDESC
137
137
  `serrano prefixes` accepts one or more Crossref member IDs
138
138
 
@@ -162,24 +162,24 @@ class Sr < Thor
162
162
  \x5"Co-Action Publishing"
163
163
  \x5"Oxford University Press (OUP)"
164
164
  LONGDESC
165
- option :json, :type => :boolean, :default => false
166
- option :limit, :type => :numeric, :default => nil
167
- option :works, :type => :boolean, :default => false
168
- def prefixes(ids=nil)
169
- if ids.nil?
170
- out = Serrano.prefixes(limit: options[:limit], works: options[:works])
171
- else
172
- out = Serrano.prefixes(ids: ids.split(","), limit: options[:limit],
173
- works: options[:works])
174
- end
165
+ option :json, type: :boolean, default: false
166
+ option :limit, type: :numeric, default: nil
167
+ option :works, type: :boolean, default: false
168
+ def prefixes(ids = nil)
169
+ out = if ids.nil?
170
+ Serrano.prefixes(limit: options[:limit], works: options[:works])
171
+ else
172
+ Serrano.prefixes(ids: ids.split(','), limit: options[:limit],
173
+ works: options[:works])
174
+ end
175
175
 
176
176
  if !options[:json]
177
177
  if !options[:works]
178
- if out.class == Hash
179
- out = out['message']['items']
180
- else
181
- out = out.collect { |x| x['message'] }
182
- end
178
+ out = if out.class == Hash
179
+ out['message']['items']
180
+ else
181
+ out.collect { |x| x['message'] }
182
+ end
183
183
 
184
184
  out.each do |x|
185
185
  puts 'member: ' + x['member']
@@ -195,7 +195,7 @@ class Sr < Thor
195
195
  end
196
196
  end
197
197
 
198
- desc "funders [funder IDs]", "Search for funders by DOI prefix"
198
+ desc 'funders [funder IDs]', 'Search for funders by DOI prefix'
199
199
  long_desc <<-LONGDESC
200
200
  `serrano funders` accepts one or more Crossref funder IDs
201
201
 
@@ -226,26 +226,26 @@ class Sr < Thor
226
226
 
227
227
  $ serrano funders 10.13039/100000001 --works=true --limit=2
228
228
  LONGDESC
229
- option :json, :type => :boolean, :default => false
230
- option :query, :type => :string, :default => nil
231
- option :limit, :type => :numeric, :default => nil
232
- option :works, :type => :boolean, :default => false
233
- def funders(ids=nil)
229
+ option :json, type: :boolean, default: false
230
+ option :query, type: :string, default: nil
231
+ option :limit, type: :numeric, default: nil
232
+ option :works, type: :boolean, default: false
233
+ def funders(ids = nil)
234
234
  if ids.nil?
235
235
  out = Serrano.funders(query: options[:query], limit: options[:limit],
236
- works: options[:works])
236
+ works: options[:works])
237
237
  else
238
- out = Serrano.funders(ids: ids.split(","), query: options[:query], limit: options[:limit],
239
- works: options[:works])
238
+ out = Serrano.funders(ids: ids.split(','), query: options[:query], limit: options[:limit],
239
+ works: options[:works])
240
240
  end
241
241
 
242
242
  if !options[:json]
243
243
  if !options[:works]
244
- if out.class == Hash
245
- out = out['message']['items']
246
- else
247
- out = out.collect { |x| x['message'] }
248
- end
244
+ out = if out.class == Hash
245
+ out['message']['items']
246
+ else
247
+ out.collect { |x| x['message'] }
248
+ end
249
249
 
250
250
  out.each do |x|
251
251
  puts 'id: ' + x['id']
@@ -261,8 +261,7 @@ class Sr < Thor
261
261
  end
262
262
  end
263
263
 
264
-
265
- desc "journals [journal ISSNs]", "Search for journals by ISSNs"
264
+ desc 'journals [journal ISSNs]', 'Search for journals by ISSNs'
266
265
  long_desc <<-LONGDESC
267
266
  `serrano journals` accepts one or more journal ISSNs
268
267
 
@@ -293,26 +292,26 @@ class Sr < Thor
293
292
 
294
293
  $ serrano journals 2167-8359 --query=ecology --works=true --limit=2
295
294
  LONGDESC
296
- option :json, :type => :boolean, :default => false
297
- option :query, :type => :string, :default => nil
298
- option :limit, :type => :numeric, :default => nil
299
- option :works, :type => :boolean, :default => false
300
- def journals(ids=nil)
295
+ option :json, type: :boolean, default: false
296
+ option :query, type: :string, default: nil
297
+ option :limit, type: :numeric, default: nil
298
+ option :works, type: :boolean, default: false
299
+ def journals(ids = nil)
301
300
  if ids.nil?
302
301
  out = Serrano.journals(query: options[:query], limit: options[:limit],
303
- works: options[:works])
302
+ works: options[:works])
304
303
  else
305
- out = Serrano.journals(ids: ids.split(","), query: options[:query], limit: options[:limit],
306
- works: options[:works])
304
+ out = Serrano.journals(ids: ids.split(','), query: options[:query], limit: options[:limit],
305
+ works: options[:works])
307
306
  end
308
307
 
309
308
  if !options[:json]
310
309
  if !options[:works]
311
- if out.class == Hash
312
- out = out['message']['items']
313
- else
314
- out = out.collect { |x| x['message'] }
315
- end
310
+ out = if out.class == Hash
311
+ out['message']['items']
312
+ else
313
+ out.collect { |x| x['message'] }
314
+ end
316
315
 
317
316
  out.each do |x|
318
317
  puts 'ISSN: ' + x['ISSN'][0]
@@ -328,7 +327,7 @@ class Sr < Thor
328
327
  end
329
328
  end
330
329
 
331
- desc "types [type name]", "Search for types by name"
330
+ desc 'types [type name]', 'Search for types by name'
332
331
  long_desc <<-LONGDESC
333
332
  `serrano types` accepts one or more type names
334
333
 
@@ -359,20 +358,20 @@ class Sr < Thor
359
358
 
360
359
  $ serrano types dissertation --works --limit=2
361
360
  LONGDESC
362
- option :json, :type => :boolean, :default => false
363
- option :works, :type => :boolean, :default => false
364
- option :limit, :type => :numeric, :default => nil
361
+ option :json, type: :boolean, default: false
362
+ option :works, type: :boolean, default: false
363
+ option :limit, type: :numeric, default: nil
365
364
  def types(*ids)
366
365
  out = Serrano.types(ids: ids, limit: options[:limit],
367
- works: options[:works])
366
+ works: options[:works])
368
367
 
369
368
  if !options[:json]
370
369
  if !options[:works]
371
- if out.class == Hash
372
- out = out['message']['items']
373
- else
374
- out = out.collect { |x| x['message'] }
375
- end
370
+ out = if out.class == Hash
371
+ out['message']['items']
372
+ else
373
+ out.collect { |x| x['message'] }
374
+ end
376
375
 
377
376
  out.each do |x|
378
377
  puts 'id: ' + x['id']
@@ -387,7 +386,7 @@ class Sr < Thor
387
386
  end
388
387
  end
389
388
 
390
- desc "licenses", "Search for licenses by name"
389
+ desc 'licenses', 'Search for licenses by name'
391
390
  long_desc <<-LONGDESC
392
391
  `serrano licenses` accepts one or more type names
393
392
 
@@ -416,8 +415,8 @@ class Sr < Thor
416
415
  "National Science Foundation"
417
416
  \x5"U.S. Department of Energy"
418
417
  LONGDESC
419
- option :json, :type => :boolean, :default => false
420
- option :query, :type => :string, :default => nil
418
+ option :json, type: :boolean, default: false
419
+ option :query, type: :string, default: nil
421
420
  def licenses
422
421
  out = Serrano.licenses(query: options[:query])
423
422
  if !options[:json]
@@ -432,7 +431,7 @@ class Sr < Thor
432
431
  end
433
432
  end
434
433
 
435
- desc "contneg", "Content negotiation"
434
+ desc 'contneg', 'Content negotiation'
436
435
  long_desc <<-LONGDESC
437
436
  `serrano contneg` accepts a DOI
438
437
 
@@ -444,15 +443,15 @@ class Sr < Thor
444
443
 
445
444
  Murtaugh PA (2014). In defense of P values . Ecology 95: 611–617.
446
445
  LONGDESC
447
- option :format, :type => :string, :default => "text"
448
- option :style, :type => :string, :default => "apa"
449
- option :locale, :type => :string, :default => "en-US"
446
+ option :format, type: :string, default: 'text'
447
+ option :style, type: :string, default: 'apa'
448
+ option :locale, type: :string, default: 'en-US'
450
449
  def contneg(ids)
451
450
  puts Serrano.content_negotiation(ids: ids, format: options[:format], style:
452
451
  options[:style], locale: options[:locale])
453
452
  end
454
453
 
455
- desc "version", "Get serrano version"
454
+ desc 'version', 'Get serrano version'
456
455
  def version
457
456
  puts Serrano::VERSION
458
457
  end
@@ -460,11 +459,11 @@ class Sr < Thor
460
459
  private
461
460
 
462
461
  def print_works(data)
463
- if data.is_a? Array
464
- data = data[0]['message']['items']
465
- else
466
- data = data.collect { |x| x['message'].select { |k,v| k[/DOI|type|title/] } }
467
- end
462
+ data = if data.is_a? Array
463
+ data[0]['message']['items']
464
+ else
465
+ data.collect { |x| x['message'].select { |k, _v| k[/DOI|type|title/] } }
466
+ end
468
467
  data.each do |x|
469
468
  puts 'DOI: ' + x['DOI']
470
469
  puts 'type: ' + x['type']
@@ -472,7 +471,6 @@ class Sr < Thor
472
471
  puts
473
472
  end
474
473
  end
475
-
476
474
  end
477
475
 
478
476
  Sr.start(ARGV)