serrano 1.4 → 1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cfcf7f23380a97af986d90644b8ab541f89c14e5df46485ad84fbcff437a361
4
- data.tar.gz: ff3571fbbe79b62cb203e54887c09a0f5af81838a7e0e7aec8c2cb3fa1376890
3
+ metadata.gz: 8b5e125bb4a2745b6dbf520ad692df6817c0e2dc7d6db1ed307bdee243e9c501
4
+ data.tar.gz: 680c37e478abc9c5213ea7a6db288a3afa9e9f71140e796a7fc5cdb88ef27517
5
5
  SHA512:
6
- metadata.gz: 057e9ff07332d37fcd6711695ddd2648d7fd76f74a87585c795a9412883ee4346cf0868b5819f6025e8fee3ef687ac1da035f8ecbfb07424450f5a161daa88a2
7
- data.tar.gz: a47b838e2812df16d600df5530175d31682679e2070e78ad0c8c6250f6b65c1e67d71d6a9cc31fefc055caa59de40148f842ec607b68264845eca55ab1a9cfab
6
+ metadata.gz: 82e9496fa1a0737ef3f491f199792c9b8e99a7c90d285a340108014e4a877ab8e38f79bde1d9a95f9999cef262e642a099f433a1ec2441537d677c6ec4ab1b58
7
+ data.tar.gz: 5ab1e3c2900d546894d0798014cd649b6b5d35e07c69b16565158fa7a4492c8dbdc13be81a7414517395be42b409875b309e232e95d80571398e7f0c0e597873
@@ -1,22 +1,22 @@
1
1
  version: 2
2
2
  updates:
3
- - package-ecosystem: bundler
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- time: "13:00"
8
- open-pull-requests-limit: 10
9
- ignore:
10
- - dependency-name: codecov
11
- versions:
12
- - "> 0.1.17, < 0.2"
13
- - dependency-name: codecov
14
- versions:
15
- - "> 0.2.1, < 0.3"
16
- - dependency-name: codecov
17
- versions:
18
- - 0.4.2
19
- - 0.4.3
20
- - dependency-name: simplecov
21
- versions:
22
- - 0.20.0
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ time: "13:00"
8
+ open-pull-requests-limit: 10
9
+ ignore:
10
+ - dependency-name: codecov
11
+ versions:
12
+ - "> 0.1.17, < 0.2"
13
+ - dependency-name: codecov
14
+ versions:
15
+ - "> 0.2.1, < 0.3"
16
+ - dependency-name: codecov
17
+ versions:
18
+ - 0.4.2
19
+ - 0.4.3
20
+ - dependency-name: simplecov
21
+ versions:
22
+ - 0.20.0
@@ -2,29 +2,29 @@ name: Ruby
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ main ]
5
+ branches: [main]
6
6
  pull_request:
7
- branches: [ main ]
7
+ branches: [main]
8
8
 
9
9
  jobs:
10
10
  test:
11
11
  strategy:
12
12
  fail-fast: false
13
13
  matrix:
14
- os: [ ubuntu-latest, macos-11 ]
15
- ruby: [ 2.6, 2.7, 3.0, 3.1 ]
16
- runs-on: ${{ matrix.os }}
14
+ ruby: [3.0, 3.1, 3.2, 3.3, 3.4]
15
+ runs-on: ubuntu-latest
17
16
  env:
18
17
  CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
19
18
  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"
19
+ - uses: actions/checkout@v4
20
+ - name: Setup Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ bundler-cache: true
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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.6 (2025-06-17)
2
+
3
+ * Fixed filter handling so that the same filter can be used multiple times (#176)
4
+
1
5
  ## 1.4 (2022-03-26)
2
6
 
3
7
  * Moved to faraday > v2. There's no user facing changes here, but let me know if any issues arise (#172)
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2022 Scott Chamberlain
1
+ Copyright (C) 2025 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,21 +2,21 @@ serrano
2
2
  =========
3
3
 
4
4
  [![gem version](https://img.shields.io/gem/v/serrano.svg)](https://rubygems.org/gems/serrano)
5
- [![Ruby](https://github.com/sckott/serrano/workflows/Ruby/badge.svg)](https://github.com/sckott/serrano/actions)
5
+ [![Ruby](https://github.com/sckott/serrano/actions/workflows/ruby.yml/badge.svg)](https://github.com/sckott/serrano/actions/workflows/ruby.yml)
6
6
  [![codecov.io](https://codecov.io/github/sckott/serrano/coverage.svg?branch=main)](https://codecov.io/github/sckott/serrano?branch=main)
7
- [![DOI](https://zenodo.org/badge/2600/sckott/serrano.svg)](https://zenodo.org/badge/latestdoi/2600/sckott/serrano)
7
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6386581.svg)](https://zenodo.org/badge/latestdoi/2600/sckott/serrano)
8
8
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
9
9
 
10
10
  `serrano` is a low level client for Crossref APIs
11
11
 
12
- Docs: https://www.rubydoc.info/gems/serrano
12
+ Docs: <https://www.rubydoc.info/gems/serrano>
13
13
 
14
14
  Other Crossref API clients:
15
15
 
16
16
  - Python: [habanero](https://github.com/sckott/habanero)
17
17
  - R: [rcrossref](https://github.com/ropensci/rcrossref)
18
18
 
19
- Crossref's API issue tracker: https://gitlab.com/crossref/issues
19
+ Crossref's API issue tracker: <https://crossref.atlassian.net/jira/software/c/projects/CR/issues>
20
20
 
21
21
  ## Changes
22
22
 
@@ -184,7 +184,7 @@ Commands:
184
184
 
185
185
  # Many DOIs
186
186
  ~$ serrano works "10.1007/12080.1874-1746,10.1007/10452.1573-5125"
187
- ## if above two dois in a file called dois.txt
187
+ ## if above two dois in a file called dois.txt
188
188
  ~$ cat dois.txt | xargs -I{} serrano works {}
189
189
 
190
190
  # output JSON, then parse with e.g., jq
@@ -28,7 +28,7 @@ module Faraday
28
28
  end
29
29
 
30
30
  def initialize(app)
31
- super app
31
+ super
32
32
  @parser = nil
33
33
  end
34
34
 
@@ -37,8 +37,13 @@ module Helpers
37
37
 
38
38
  newnn = nn.collect { |m| m.tr("_", "-") }
39
39
  x = rename_keys(x, newnn)
40
- x.collect { |k, v| [k, v].join(":") }.join(",")
41
-
40
+ x.collect { |k, v|
41
+ if v.is_a?(Array)
42
+ v.map { |val| [k, val].join(":") }
43
+ else
44
+ [k, v].join(":")
45
+ end
46
+ }.join(",")
42
47
  end
43
48
  end
44
49
 
@@ -32,7 +32,6 @@ module Serrano
32
32
  def initialize(endpt, id, query, filter, offset,
33
33
  limit, sample, sort, order, facet, select,
34
34
  works, agency, options, verbose)
35
-
36
35
  self.endpt = endpt
37
36
  self.id = id
38
37
  self.query = query
@@ -38,7 +38,6 @@ module Serrano
38
38
  limit, sample, sort, order, facet, select,
39
39
  works, agency, options, verbose, cursor,
40
40
  cursor_max, args)
41
-
42
41
  self.endpt = endpt
43
42
  self.id = id
44
43
  self.query = query
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Serrano
4
- VERSION = "1.4"
4
+ VERSION = "1.6"
5
5
  end
data/lib/serrano.rb CHANGED
@@ -228,7 +228,6 @@ module Serrano
228
228
  limit: nil, sample: nil, sort: nil, order: nil, facet: nil,
229
229
  select: nil, options: nil, verbose: false, cursor: nil,
230
230
  cursor_max: 5000, **args)
231
-
232
231
  assert_valid_filters(filter) if filter
233
232
  RequestCursor.new("works", ids, query, filter, offset,
234
233
  limit, sample, sort, order, facet, select, nil, nil, options,
@@ -285,7 +284,6 @@ module Serrano
285
284
  limit: nil, sample: nil, sort: nil, order: nil, facet: nil,
286
285
  select: nil, works: false, options: nil, verbose: false,
287
286
  cursor: nil, cursor_max: 5000, **args)
288
-
289
287
  assert_valid_filters(filter) if filter
290
288
  RequestCursor.new("members", ids, query, filter, offset,
291
289
  limit, sample, sort, order, facet, select, works, nil,
@@ -333,7 +331,6 @@ module Serrano
333
331
  limit: nil, sample: nil, sort: nil, order: nil, facet: nil,
334
332
  select: nil, works: false, options: nil, verbose: false,
335
333
  cursor: nil, cursor_max: 5000, **args)
336
-
337
334
  assert_valid_filters(filter) if filter
338
335
  RequestCursor.new("prefixes", ids, nil, filter, offset,
339
336
  limit, sample, sort, order, facet, select, works, nil,
@@ -386,7 +383,6 @@ module Serrano
386
383
  limit: nil, sample: nil, sort: nil, order: nil, facet: nil,
387
384
  select: nil, works: false, options: nil, verbose: false,
388
385
  cursor: nil, cursor_max: 5000, **args)
389
-
390
386
  assert_valid_filters(filter) if filter
391
387
  RequestCursor.new("funders", ids, query, filter, offset,
392
388
  limit, sample, sort, order, facet, select, works, nil, options,
@@ -439,7 +435,6 @@ module Serrano
439
435
  limit: nil, sample: nil, sort: nil, order: nil, facet: nil,
440
436
  select: nil, works: false, options: nil, verbose: false,
441
437
  cursor: nil, cursor_max: 5000, **args)
442
-
443
438
  assert_valid_filters(filter) if filter
444
439
  RequestCursor.new("journals", ids, query, filter, offset,
445
440
  limit, sample, sort, order, facet, select, works, nil, options,
@@ -482,7 +477,6 @@ module Serrano
482
477
  # Serrano.types(ids: "journal", works: true, select: ['DOI', 'title'], limit: 3)
483
478
  def self.types(ids: nil, offset: nil, limit: nil, select: nil, works: false,
484
479
  options: nil, verbose: false, cursor: nil, cursor_max: 5000, **args)
485
-
486
480
  RequestCursor.new("types", ids, nil, nil, offset,
487
481
  limit, nil, nil, nil, nil, select, works, nil, options,
488
482
  verbose, cursor, cursor_max, args).perform
@@ -523,7 +517,6 @@ module Serrano
523
517
  def self.licenses(query: nil, offset: nil,
524
518
  limit: nil, sample: nil, sort: nil, order: nil,
525
519
  facet: nil, options: nil, verbose: false)
526
-
527
520
  Request.new("licenses", nil, query, nil, offset,
528
521
  limit, sample, sort, order, facet, nil, nil, nil, options, verbose).perform
529
522
  end
@@ -650,7 +643,6 @@ module Serrano
650
643
  # Serrano.citation_count(doi: "10.1016/j.fbr.2012")
651
644
  def self.citation_count(doi:, url: "https://www.crossref.org/openurl/",
652
645
  key: "cboettig@ropensci.org", options: nil)
653
-
654
646
  args = {id: "doi:" + doi, pid: key, noredirect: true}
655
647
  opts = args.delete_if { |_k, v| v.nil? }
656
648
  conn = Faraday.new(url: url, request: options)
data/serrano.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.name = "serrano"
9
9
  s.version = Serrano::VERSION
10
10
  s.platform = Gem::Platform::RUBY
11
- s.required_ruby_version = ">= 2.1"
11
+ s.required_ruby_version = ">= 3.0"
12
12
  s.summary = "Crossref Client"
13
13
  s.description = "Low Level Ruby Client for the Crossref Search API"
14
14
  s.authors = "Scott Chamberlain"
@@ -31,11 +31,11 @@ Gem::Specification.new do |s|
31
31
  s.add_development_dependency "standard", "~> 1.0"
32
32
  s.add_development_dependency "simplecov", "~> 0.21.2"
33
33
  s.add_development_dependency "test-unit", "~> 3.3", ">= 3.3.6"
34
- s.add_development_dependency "vcr", "~> 6.1"
35
- s.add_development_dependency "webmock", "~> 3.14"
34
+ s.add_development_dependency "vcr", "~> 6.3", ">= 6.3.1"
35
+ s.add_development_dependency "webmock", "~> 3.25", ">= 3.25.1"
36
36
 
37
- s.add_runtime_dependency "faraday", "~> 2.2"
38
- s.add_runtime_dependency "faraday-follow_redirects", "~> 0.1.0"
37
+ s.add_runtime_dependency "faraday", "~> 2.13", ">= 2.13.1"
38
+ s.add_runtime_dependency "faraday-follow_redirects", ">= 0.1", "< 0.4"
39
39
  s.add_runtime_dependency "multi_json", "~> 1.15"
40
40
  s.add_runtime_dependency "rexml", "~> 3.2", ">= 3.2.5"
41
41
  s.add_runtime_dependency "thor", "~> 1.2", ">= 1.2.1"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serrano
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chamberlain
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-03-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -138,56 +137,80 @@ dependencies:
138
137
  requirements:
139
138
  - - "~>"
140
139
  - !ruby/object:Gem::Version
141
- version: '6.1'
140
+ version: '6.3'
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: 6.3.1
142
144
  type: :development
143
145
  prerelease: false
144
146
  version_requirements: !ruby/object:Gem::Requirement
145
147
  requirements:
146
148
  - - "~>"
147
149
  - !ruby/object:Gem::Version
148
- version: '6.1'
150
+ version: '6.3'
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: 6.3.1
149
154
  - !ruby/object:Gem::Dependency
150
155
  name: webmock
151
156
  requirement: !ruby/object:Gem::Requirement
152
157
  requirements:
153
158
  - - "~>"
154
159
  - !ruby/object:Gem::Version
155
- version: '3.14'
160
+ version: '3.25'
161
+ - - ">="
162
+ - !ruby/object:Gem::Version
163
+ version: 3.25.1
156
164
  type: :development
157
165
  prerelease: false
158
166
  version_requirements: !ruby/object:Gem::Requirement
159
167
  requirements:
160
168
  - - "~>"
161
169
  - !ruby/object:Gem::Version
162
- version: '3.14'
170
+ version: '3.25'
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: 3.25.1
163
174
  - !ruby/object:Gem::Dependency
164
175
  name: faraday
165
176
  requirement: !ruby/object:Gem::Requirement
166
177
  requirements:
167
178
  - - "~>"
168
179
  - !ruby/object:Gem::Version
169
- version: '2.2'
180
+ version: '2.13'
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: 2.13.1
170
184
  type: :runtime
171
185
  prerelease: false
172
186
  version_requirements: !ruby/object:Gem::Requirement
173
187
  requirements:
174
188
  - - "~>"
175
189
  - !ruby/object:Gem::Version
176
- version: '2.2'
190
+ version: '2.13'
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: 2.13.1
177
194
  - !ruby/object:Gem::Dependency
178
195
  name: faraday-follow_redirects
179
196
  requirement: !ruby/object:Gem::Requirement
180
197
  requirements:
181
- - - "~>"
198
+ - - ">="
182
199
  - !ruby/object:Gem::Version
183
- version: 0.1.0
200
+ version: '0.1'
201
+ - - "<"
202
+ - !ruby/object:Gem::Version
203
+ version: '0.4'
184
204
  type: :runtime
185
205
  prerelease: false
186
206
  version_requirements: !ruby/object:Gem::Requirement
187
207
  requirements:
188
- - - "~>"
208
+ - - ">="
209
+ - !ruby/object:Gem::Version
210
+ version: '0.1'
211
+ - - "<"
189
212
  - !ruby/object:Gem::Version
190
- version: 0.1.0
213
+ version: '0.4'
191
214
  - !ruby/object:Gem::Dependency
192
215
  name: multi_json
193
216
  requirement: !ruby/object:Gem::Requirement
@@ -279,10 +302,9 @@ licenses:
279
302
  metadata:
280
303
  homepage_uri: https://github.com/sckott/serrano
281
304
  documentation_uri: https://www.rubydoc.info/gems/serrano
282
- changelog_uri: https://github.com/sckott/serrano/releases/tag/v1.4
305
+ changelog_uri: https://github.com/sckott/serrano/releases/tag/v1.6
283
306
  source_code_uri: https://github.com/sckott/serrano
284
307
  bug_tracker_uri: https://github.com/sckott/serrano/issues
285
- post_install_message:
286
308
  rdoc_options: []
287
309
  require_paths:
288
310
  - lib
@@ -290,15 +312,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
290
312
  requirements:
291
313
  - - ">="
292
314
  - !ruby/object:Gem::Version
293
- version: '2.1'
315
+ version: '3.0'
294
316
  required_rubygems_version: !ruby/object:Gem::Requirement
295
317
  requirements:
296
318
  - - ">="
297
319
  - !ruby/object:Gem::Version
298
320
  version: '0'
299
321
  requirements: []
300
- rubygems_version: 3.3.3
301
- signing_key:
322
+ rubygems_version: 3.6.9
302
323
  specification_version: 4
303
324
  summary: Crossref Client
304
325
  test_files: []