serrano 0.5.4 → 0.6.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: 2534dbe1c8771066e2263d50eb52287e2dc0ac3e968097839a8b05c31be35fdc
4
- data.tar.gz: 3723eb652195fcb93ad1c08ab40616b78725509bb8d7ab7f69eeda77773fb573
3
+ metadata.gz: 7115cc1e655085ff2114f8f5a9a7c093b4b6b53b0292264ba83336d6299f4f21
4
+ data.tar.gz: 352701f211ca40a431cc4ccbb01d9431dc12484ce1c2efc2fbe27f145e29cf52
5
5
  SHA512:
6
- metadata.gz: 2fa11879521f6bf6895323b177f70de75b72daee2b841f46c658f95c12afe72672b80a747290740bddb0bde900e03cc3595c9d00c899709070b29e15b3785b5d
7
- data.tar.gz: e58e6ed19721fc8188375bb96a5a6a690f6c72b7e026040427207729f661e22f13171fbf858ccf7ea1cfa1c17fecb1d7feba2a62ac442e27c0d62942c05566d5
6
+ metadata.gz: 3b66d48e05bc4233a426154d142004f59a26272f043e56cb384c03045b896dee82ed1b9fc9c3dedf74e64a524676206e86ce8b7694f0e48fe751dc6a235e65af
7
+ data.tar.gz: 94a984d7d49ecea0623e546bdf99cdc26ec279ff45f7f88e2c5f0b76e2b9a42b5cb7bfd145fa079c53c8b460b3a0d3b57436d7643fb2f9685c48695ccbe73d51
@@ -7,8 +7,24 @@ Naming/FileName:
7
7
  Metrics/ParameterLists:
8
8
  Max: 18
9
9
 
10
+ Metrics/ModuleLength:
11
+ Max: 800
12
+
10
13
  # Offense count: 22
11
14
  # Configuration parameters: AllowedVariables.
12
15
  Lint/UselessAssignment:
13
16
  Exclude:
14
17
  - 'lib/serrano/filters.rb'
18
+
19
+ Style/HashEachMethods:
20
+ Enabled: true
21
+
22
+ Style/HashTransformKeys:
23
+ Enabled: true
24
+
25
+ Style/HashTransformValues:
26
+ Enabled: true
27
+
28
+ Layout/LineLength:
29
+ Max: 525
30
+
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-12-18 19:46:09 -0800 using RuboCop version 0.61.1.
3
+ # on 2020-02-18 08:24:37 -0800 using RuboCop version 0.80.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -17,12 +17,6 @@ Gemspec/RequiredRubyVersion:
17
17
  Metrics/AbcSize:
18
18
  Max: 91
19
19
 
20
- # Offense count: 1
21
- # Configuration parameters: CountComments, ExcludedMethods.
22
- # ExcludedMethods: refine
23
- Metrics/BlockLength:
24
- Max: 28
25
-
26
20
  # Offense count: 1
27
21
  # Configuration parameters: CountBlocks.
28
22
  Metrics/BlockNesting:
@@ -37,7 +31,7 @@ Metrics/ClassLength:
37
31
  Metrics/CyclomaticComplexity:
38
32
  Max: 11
39
33
 
40
- # Offense count: 20
34
+ # Offense count: 21
41
35
  # Configuration parameters: CountComments, ExcludedMethods.
42
36
  Metrics/MethodLength:
43
37
  Max: 54
@@ -48,8 +42,8 @@ Metrics/PerceivedComplexity:
48
42
 
49
43
  # Offense count: 7
50
44
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
51
- # AllowedNames: io, id, to, by, on, in, at, ip, db
52
- Naming/UncommunicativeMethodParamName:
45
+ # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
46
+ Naming/MethodParameterName:
53
47
  Exclude:
54
48
  - 'lib/serrano/filterhandler.rb'
55
49
  - 'lib/serrano/request_cursor.rb'
@@ -83,16 +77,11 @@ Style/FormatString:
83
77
  - 'lib/serrano/utils.rb'
84
78
 
85
79
  # Offense count: 1
86
- # Configuration parameters: .
80
+ # Configuration parameters: EnforcedStyle.
87
81
  # SupportedStyles: annotated, template, unannotated
88
82
  Style/FormatStringToken:
89
- EnforcedStyle: unannotated
90
-
91
- # Offense count: 1
92
- # Configuration parameters: MinBodyLength.
93
- Style/GuardClause:
94
83
  Exclude:
95
- - 'lib/serrano/response.rb'
84
+ - 'lib/serrano/utils.rb'
96
85
 
97
86
  # Offense count: 3
98
87
  # Cop supports --auto-correct.
@@ -114,9 +103,3 @@ Style/SelfAssignment:
114
103
  Style/StringLiterals:
115
104
  Exclude:
116
105
  - 'lib/serrano/utils.rb'
117
-
118
- # Offense count: 198
119
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
120
- # URISchemes: http, https
121
- Metrics/LineLength:
122
- Max: 525
@@ -1,12 +1,11 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.5.0
5
4
  - 2.6.0
5
+ - 2.6.5
6
+ - 2.7.0
6
7
  before_install:
7
- - gem update --system
8
8
  - gem install bundler
9
- - gem --version
10
9
  script:
11
10
  - bundle exec rake test TESTOPTS="-v"
12
11
  - bundle exec rubocop
@@ -1,3 +1,11 @@
1
+ ## 0.6.0 (2020-02-18)
2
+
3
+ * query.title (`query_title` query filter as used here) has been removed; use `query_bibliographic` instead (#111)
4
+ * bump `faraday` to version 0.17.1 from 0.17.0 (via dependabot) (#107)
5
+ * bump `json` to version 2.3 from 2.2 (via dependabot) (#109)
6
+ * bump `thor` minimum version (via dependabot) (#110)
7
+ * 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
8
+
1
9
  ## 0.5.4 (2019-11-27)
2
10
 
3
11
  * `Serrano.registration_agency` fixed: a change in an internal function caused this function to fail; tests added to prevent this in the future (#106)
@@ -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/
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- serrano (0.5.4)
5
- faraday (>= 0.15, < 0.18)
6
- faraday_middleware (>= 0.12.2, < 0.14.0)
4
+ serrano (0.6.0)
5
+ faraday (>= 0.15, < 1.0)
6
+ faraday_middleware (>= 0.12.2, < 0.15.0)
7
7
  multi_json (~> 1.13, >= 1.13.1)
8
- thor (~> 0.20.0)
8
+ thor (>= 0.20, < 1.1)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
@@ -20,27 +20,29 @@ GEM
20
20
  crack (0.4.3)
21
21
  safe_yaml (~> 1.0.0)
22
22
  docile (1.3.2)
23
- faraday (0.17.0)
23
+ faraday (0.17.3)
24
24
  multipart-post (>= 1.2, < 3)
25
- faraday_middleware (0.13.1)
25
+ faraday_middleware (0.14.0)
26
26
  faraday (>= 0.7.4, < 1.0)
27
27
  hashdiff (1.0.0)
28
28
  jaro_winkler (1.5.4)
29
- json (2.2.0)
29
+ json (2.3.0)
30
30
  multi_json (1.14.1)
31
31
  multipart-post (2.1.1)
32
32
  parallel (1.19.1)
33
- parser (2.6.5.0)
33
+ parser (2.7.0.2)
34
34
  ast (~> 2.4.0)
35
35
  power_assert (1.1.5)
36
- public_suffix (4.0.1)
36
+ public_suffix (3.1.1)
37
37
  rainbow (3.0.0)
38
38
  rake (12.3.3)
39
- rubocop (0.76.0)
39
+ rexml (3.2.4)
40
+ rubocop (0.80.0)
40
41
  jaro_winkler (~> 1.5.1)
41
42
  parallel (~> 1.10)
42
- parser (>= 2.6)
43
+ parser (>= 2.7.0.1)
43
44
  rainbow (>= 2.2.2, < 4.0)
45
+ rexml
44
46
  ruby-progressbar (~> 1.7)
45
47
  unicode-display_width (>= 1.4.0, < 1.7)
46
48
  ruby-progressbar (1.10.1)
@@ -52,11 +54,11 @@ GEM
52
54
  simplecov-html (0.10.2)
53
55
  test-unit (3.3.4)
54
56
  power_assert
55
- thor (0.20.3)
56
- unicode-display_width (1.6.0)
57
+ thor (1.0.1)
58
+ unicode-display_width (1.6.1)
57
59
  url (0.3.2)
58
- vcr (5.0.0)
59
- webmock (3.7.6)
60
+ vcr (5.1.0)
61
+ webmock (3.8.2)
60
62
  addressable (>= 2.3.6)
61
63
  crack (>= 0.3.2)
62
64
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -69,7 +71,7 @@ DEPENDENCIES
69
71
  codecov (~> 0.1.10)
70
72
  json (~> 2.1)
71
73
  rake (~> 12.3, >= 12.3.1)
72
- rubocop (~> 0.76.0)
74
+ rubocop (~> 0.80.0)
73
75
  serrano!
74
76
  simplecov (~> 0.17.0)
75
77
  test-unit (~> 3.2, >= 3.2.7)
@@ -77,4 +79,4 @@ DEPENDENCIES
77
79
  webmock (~> 3.4, >= 3.4.1)
78
80
 
79
81
  BUNDLED WITH
80
- 2.0.2
82
+ 2.1.3
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2019 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
@@ -122,6 +122,12 @@ Search works by query string
122
122
  Serrano.works(query: "ecology")
123
123
  ```
124
124
 
125
+ Search works using metadata filters. See [CrossRef filter docs](https://github.com/CrossRef/rest-api-doc#filter-names).
126
+
127
+ ```ruby
128
+ Serrano.works(query: "ecology", filter: { has_abstract: true })
129
+ ```
130
+
125
131
  Search journals by publisher name
126
132
 
127
133
  ```ruby
@@ -67,7 +67,6 @@ require 'rexml/xpath'
67
67
  # https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md#field-queries
68
68
  # Field query parameters mut be named, and must start with `query_`. Any dashes or
69
69
  # periods should be replaced with underscores. The options include:
70
- # - query_title: Query title and subtitle
71
70
  # - query_container_title: Query container-title aka. publication name
72
71
  # - query_author: Query author given and family names
73
72
  # - query_editor: Query editor given and family names
@@ -234,6 +233,7 @@ module Serrano
234
233
  select: nil, options: nil, verbose: false, cursor: nil,
235
234
  cursor_max: 5000, **args)
236
235
 
236
+ assert_valid_filters(filter) if filter
237
237
  RequestCursor.new('works', ids, query, filter, offset,
238
238
  limit, sample, sort, order, facet, select, nil, nil, options,
239
239
  verbose, cursor, cursor_max, args).perform
@@ -290,6 +290,7 @@ module Serrano
290
290
  select: nil, works: false, options: nil, verbose: false,
291
291
  cursor: nil, cursor_max: 5000, **args)
292
292
 
293
+ assert_valid_filters(filter) if filter
293
294
  RequestCursor.new('members', ids, query, filter, offset,
294
295
  limit, sample, sort, order, facet, select, works, nil,
295
296
  options, verbose, cursor, cursor_max, args).perform
@@ -326,8 +327,8 @@ module Serrano
326
327
  # items.collect{ |z| z['DOI'] }[0,50]
327
328
  #
328
329
  # # field queries
329
- # ## query.title
330
- # res = Serrano.prefixes(ids: "10.1016", works: true, query_title: 'cell biology')
330
+ # ## query.bibliographic
331
+ # res = Serrano.prefixes(ids: "10.1016", works: true, query_bibliographic: 'cell biology')
331
332
  # res[0]['message']['items'].collect { |x| x['title'] }
332
333
  #
333
334
  # # select certain fields
@@ -337,6 +338,7 @@ module Serrano
337
338
  select: nil, works: false, options: nil, verbose: false,
338
339
  cursor: nil, cursor_max: 5000, **args)
339
340
 
341
+ assert_valid_filters(filter) if filter
340
342
  RequestCursor.new('prefixes', ids, nil, filter, offset,
341
343
  limit, sample, sort, order, facet, select, works, nil,
342
344
  options, verbose, cursor, cursor_max, args).perform
@@ -389,6 +391,7 @@ module Serrano
389
391
  select: nil, works: false, options: nil, verbose: false,
390
392
  cursor: nil, cursor_max: 5000, **args)
391
393
 
394
+ assert_valid_filters(filter) if filter
392
395
  RequestCursor.new('funders', ids, query, filter, offset,
393
396
  limit, sample, sort, order, facet, select, works, nil, options,
394
397
  verbose, cursor, cursor_max, args).perform
@@ -441,6 +444,7 @@ module Serrano
441
444
  select: nil, works: false, options: nil, verbose: false,
442
445
  cursor: nil, cursor_max: 5000, **args)
443
446
 
447
+ assert_valid_filters(filter) if filter
444
448
  RequestCursor.new('journals', ids, query, filter, offset,
445
449
  limit, sample, sort, order, facet, select, works, nil, options,
446
450
  verbose, cursor, cursor_max, args).perform
@@ -669,4 +673,23 @@ module Serrano
669
673
  def self.csl_styles
670
674
  fetch_styles
671
675
  end
676
+
677
+ def self.assert_valid_filters(filters)
678
+ unless filters.is_a? Hash
679
+ raise ArgumentError, <<~ERR
680
+ Filters must be provided as a hash, like:
681
+
682
+ Serrano.works(query: "something", filters: { has_abstract: true })
683
+ ERR
684
+ end
685
+
686
+ filters.each do |name, _|
687
+ filter_strings = Filters.names.map(&:to_s)
688
+ next if filter_strings.include?(name.to_s)
689
+
690
+ raise ArgumentError, <<~ERR
691
+ The filter "#{name}" is not a valid filter. Please run `Serrano.filters.filters` to see all valid filters.
692
+ ERR
693
+ end
694
+ end
672
695
  end
@@ -53,13 +53,13 @@ module Serrano
53
53
 
54
54
  if ids.length == 1
55
55
  self.ids = ids[0] if ids.class == Array
56
- return make_request(conn, ids, format, style, locale)
56
+ make_request(conn, ids, format, style, locale)
57
57
  else
58
58
  coll = []
59
59
  Array(ids).each do |x|
60
60
  coll << make_request(conn, x, format, style, locale)
61
61
  end
62
- return coll
62
+ coll
63
63
  end
64
64
  end
65
65
  end
@@ -1,96 +1,100 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ##
4
- # Serrano::Filters
5
- #
6
- # Information on Crossref API filters
7
- #
8
- # @example
9
- # require 'serrano'
10
- # # List filter names
11
- # Serrano::Filters.names
12
- # # List filter values and description
13
- # Serrano::Filters.filters
14
- # Serrano::Filters.filters['has_funder']
15
- # Serrano::Filters.filters['has_funder']['description']
16
3
  module Serrano
4
+ def self.filters
5
+ Filters
6
+ end
7
+
8
+ ##
9
+ # Serrano::Filters
10
+ #
11
+ # Information on Crossref API filters
12
+ #
13
+ # @example
14
+ # require 'serrano'
15
+ # # List filter names
16
+ # Serrano::Filters.names
17
+ # # List filter values and description
18
+ # Serrano::Filters.filters
19
+ # Serrano::Filters.filters['has_funder']
20
+ # Serrano::Filters.filters['has_funder']['description']
17
21
  module Filters
18
22
  def self.names
19
- filter_details.keys
23
+ FILTER_DETAILS.keys
20
24
  end
21
25
 
22
26
  def self.filters
23
- filter_details
27
+ FILTER_DETAILS
24
28
  end
29
+
30
+ FILTER_DETAILS = {
31
+ 'has_funder' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more funder entry' },
32
+ 'funder' => { 'possible_values' => '{funder_id}', 'description' => 'metadata which include the {funder_id} in FundRef data' },
33
+ 'location' => { 'possible_values' => '{country_name}', 'description' => 'funder records where location = {country name}. Only works on /funders route' },
34
+ 'prefix' => { 'possible_values' => '{owner_prefix}', 'description' => "metadata belonging to a DOI owner prefix {owner_prefix} (e.g. '10.1016' )" },
35
+ 'member' => { 'possible_values' => '{member_id}', 'description' => 'metadata belonging to a CrossRef member' },
36
+ 'from_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed since (inclusive) {date}' },
37
+ 'until_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed before (inclusive) {date}' },
38
+ 'from_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited since (inclusive) {date}' },
39
+ 'until_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited before (inclusive) {date}' },
40
+ 'from_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated since (inclusive) {date} Currently the same as 'from_deposit_date'" },
41
+ 'until_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated before (inclusive) {date} Currently the same as 'until_deposit_date'" },
42
+ 'from_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited since (inclusive) {date}' },
43
+ 'until_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited before (inclusive) {date}' },
44
+ 'from_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is since (inclusive) {date}' },
45
+ 'until_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is before (inclusive) {date}' },
46
+ 'from_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is since (inclusive) {date}' },
47
+ 'until_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is before (inclusive) {date}' },
48
+ 'from_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is since (inclusive) {date}' },
49
+ 'until_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is before (inclusive) {date}' },
50
+ 'from_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is since (inclusive) {date}' },
51
+ 'until_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is before (inclusive) {date}' },
52
+ 'from_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is since (inclusive) {date}' },
53
+ 'until_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is before (inclusive) {date}' },
54
+ 'has_license' => { 'possible_values' => nil, 'description' => "metadata that includes any '<license_ref>' elements" },
55
+ 'license_url' => { 'possible_values' => '{url}', 'description' => "metadata where '<license_ref>' value equals {url}" },
56
+ 'license_version' => { 'possible_values' => '{string}', 'description' => "metadata where the '<license_ref>''s 'applies_to' attribute is '{string}'" },
57
+ 'license_delay' => { 'possible_values' => '{integer}', 'description' => "metadata where difference between publication date and the '<license_ref>''s 'start_date' attribute is <= '{integer}' (in days" },
58
+ 'has_full_text' => { 'possible_values' => nil, 'description' => "metadata that includes any full text '<resource>' elements_" },
59
+ 'full_text_version' => { 'possible_values' => '{string}', 'description' => "metadata where '<resource>' element's 'content_version' attribute is '{string}'" },
60
+ 'full_text_type' => { 'possible_values' => '{mime_type}', 'description' => "metadata where '<resource>' element's 'content_type' attribute is '{mime_type}' (e.g. 'application/pdf')" },
61
+ 'full_text_application' => { 'possible_values' => '{string}', 'description' => 'metadata where <resource> link has one of the following intended applications: text-mining, similarity-checking or unspecified' },
62
+ 'has_references' => { 'possible_values' => nil, 'description' => 'metadata for works that have a list of references' },
63
+ 'has_archive' => { 'possible_values' => nil, 'description' => 'metadata which include name of archive partner' },
64
+ 'archive' => { 'possible_values' => '{string}', 'description' => "metadata which where value of archive partner is '{string}'" },
65
+ 'has_orcid' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more ORCIDs' },
66
+ 'has_authenticated_orcid' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more ORCIDs where the depositing publisher claims to have witness the ORCID owner authenticate with ORCID' },
67
+ 'orcid' => { 'possible_values' => '{orcid}', 'description' => "metadata where '<orcid>' element's value = '{orcid}'" },
68
+ 'issn' => { 'possible_values' => '{issn}', 'description' => "metadata where record has an ISSN = '{issn}' Format is 'xxxx_xxxx'." },
69
+ 'directory' => { 'possible_values' => '{directory}', 'description' => "metadata records whose article or serial are mentioned in the given '{directory}'. Currently the only supported value is 'doaj'" },
70
+ 'doi' => { 'possible_values' => '{doi}', 'description' => "metadata describing the DOI '{doi}'" },
71
+ 'updates' => { 'possible_values' => '{doi}', 'description' => "metadata for records that represent editorial updates to the DOI '{doi}'" },
72
+ 'is_update' => { 'possible_values' => nil, 'description' => 'metadata for records that represent editorial updates' },
73
+ 'has_update_policy' => { 'possible_values' => nil, 'description' => 'metadata for records that include a link to an editorial update policy' },
74
+ 'container_title' => { 'possible_values' => nil, 'description' => 'metadata for records with a publication title exactly with an exact match' },
75
+ 'category_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching category label' },
76
+ 'type' => { 'possible_values' => '{type}', 'description' => "metadata records whose type = '{type}' Type must be an ID value from the list of types returned by the '/types' resource" },
77
+ 'type_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exacty matching type label' },
78
+ 'award_number' => { 'possible_values' => '{award_number}', 'description' => "metadata for records with a matching award nunber_ Optionally combine with 'award_funder'" },
79
+ 'award_funder' => { 'possible_values' => '{funder doi or id}', 'description' => "metadata for records with an award with matching funder. Optionally combine with 'award_number'" },
80
+ 'has_assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with any assertions' },
81
+ 'assertion_group' => { 'possible_values' => nil, 'description' => 'metadata for records with an assertion in a particular group' },
82
+ 'assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with a particular named assertion' },
83
+ 'has_affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records that have any affiliation information' },
84
+ 'alternative_id' => { 'possible_values' => nil, 'description' => 'metadata for records with the given alternative ID, which may be a publisher_specific ID, or any other identifier a publisher may have provided' },
85
+ 'article_number' => { 'possible_values' => nil, 'description' => 'metadata for records with a given article number' },
86
+ 'has_abstract' => { 'possible_values' => nil, 'description' => 'metadata for records which include an abstract' },
87
+ 'has_clinical_trial_number' => { 'possible_values' => nil, 'description' => 'metadata for records which include a clinical trial number' },
88
+ 'content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a particular domain name as the location Crossmark content will appear' },
89
+ 'has_content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a domain name location for Crossmark content' },
90
+ 'has_crossmark_restriction' => { 'possible_values' => nil, 'description' => 'metadata where the publisher restricts Crossmark usage to content domains' },
91
+ 'has_relation' => { 'possible_values' => nil, 'description' => 'metadata for records that either assert or are the object of a relation' },
92
+ 'relation_type' => { 'possible_values' => nil, 'description' => 'One of the relation types from the Crossref relations schema (e.g. is-referenced-by, is-parent-of, is-preprint-of)' },
93
+ 'relation_object' => { 'possible_values' => nil, 'description' => 'Relations where the object identifier matches the identifier provided' },
94
+ 'relation_object_type' => { 'possible_values' => nil, 'description' => 'One of the identifier types from the Crossref relations schema (e.g. doi, issn)' },
95
+ 'public_references' => { 'possible_values' => nil, 'description' => 'metadata where publishers allow references to be distributed publically' },
96
+ 'publisher_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching publisher name' },
97
+ 'affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records with at least one contributor with the given affiliation' }
98
+ }.freeze
25
99
  end
26
100
  end
27
-
28
- filter_details = {
29
- 'has_funder' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more funder entry' },
30
- 'funder' => { 'possible_values' => '{funder_id}', 'description' => 'metadata which include the {funder_id} in FundRef data' },
31
- 'location' => { 'possible_values' => '{country_name}', 'description' => 'funder records where location = {country name}. Only works on /funders route' },
32
- 'prefix' => { 'possible_values' => '{owner_prefix}', 'description' => "metadata belonging to a DOI owner prefix {owner_prefix} (e.g. '10.1016' )" },
33
- 'member' => { 'possible_values' => '{member_id}', 'description' => 'metadata belonging to a CrossRef member' },
34
- 'from_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed since (inclusive) {date}' },
35
- 'until_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed before (inclusive) {date}' },
36
- 'from_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited since (inclusive) {date}' },
37
- 'until_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited before (inclusive) {date}' },
38
- 'from_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated since (inclusive) {date} Currently the same as 'from_deposit_date'" },
39
- 'until_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated before (inclusive) {date} Currently the same as 'until_deposit_date'" },
40
- 'from_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited since (inclusive) {date}' },
41
- 'until_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited before (inclusive) {date}' },
42
- 'from_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is since (inclusive) {date}' },
43
- 'until_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is before (inclusive) {date}' },
44
- 'from_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is since (inclusive) {date}' },
45
- 'until_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is before (inclusive) {date}' },
46
- 'from_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is since (inclusive) {date}' },
47
- 'until_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is before (inclusive) {date}' },
48
- 'from_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is since (inclusive) {date}' },
49
- 'until_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is before (inclusive) {date}' },
50
- 'from_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is since (inclusive) {date}' },
51
- 'until_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is before (inclusive) {date}' },
52
- 'has_license' => { 'possible_values' => nil, 'description' => "metadata that includes any '<license_ref>' elements" },
53
- 'license_url' => { 'possible_values' => '{url}', 'description' => "metadata where '<license_ref>' value equals {url}" },
54
- 'license_version' => { 'possible_values' => '{string}', 'description' => "metadata where the '<license_ref>''s 'applies_to' attribute is '{string}'" },
55
- 'license_delay' => { 'possible_values' => '{integer}', 'description' => "metadata where difference between publication date and the '<license_ref>''s 'start_date' attribute is <= '{integer}' (in days" },
56
- 'has_full_text' => { 'possible_values' => nil, 'description' => "metadata that includes any full text '<resource>' elements_" },
57
- 'full_text_version' => { 'possible_values' => '{string}', 'description' => "metadata where '<resource>' element's 'content_version' attribute is '{string}'" },
58
- 'full_text_type' => { 'possible_values' => '{mime_type}', 'description' => "metadata where '<resource>' element's 'content_type' attribute is '{mime_type}' (e.g. 'application/pdf')" },
59
- 'full_text_application' => { 'possible_values' => '{string}', 'description' => 'metadata where <resource> link has one of the following intended applications: text-mining, similarity-checking or unspecified' },
60
- 'has_references' => { 'possible_values' => nil, 'description' => 'metadata for works that have a list of references' },
61
- 'has_archive' => { 'possible_values' => nil, 'description' => 'metadata which include name of archive partner' },
62
- 'archive' => { 'possible_values' => '{string}', 'description' => "metadata which where value of archive partner is '{string}'" },
63
- 'has_orcid' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more ORCIDs' },
64
- 'has_authenticated_orcid' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more ORCIDs where the depositing publisher claims to have witness the ORCID owner authenticate with ORCID' },
65
- 'orcid' => { 'possible_values' => '{orcid}', 'description' => "metadata where '<orcid>' element's value = '{orcid}'" },
66
- 'issn' => { 'possible_values' => '{issn}', 'description' => "metadata where record has an ISSN = '{issn}' Format is 'xxxx_xxxx'." },
67
- 'directory' => { 'possible_values' => '{directory}', 'description' => "metadata records whose article or serial are mentioned in the given '{directory}'. Currently the only supported value is 'doaj'" },
68
- 'doi' => { 'possible_values' => '{doi}', 'description' => "metadata describing the DOI '{doi}'" },
69
- 'updates' => { 'possible_values' => '{doi}', 'description' => "metadata for records that represent editorial updates to the DOI '{doi}'" },
70
- 'is_update' => { 'possible_values' => nil, 'description' => 'metadata for records that represent editorial updates' },
71
- 'has_update_policy' => { 'possible_values' => nil, 'description' => 'metadata for records that include a link to an editorial update policy' },
72
- 'container_title' => { 'possible_values' => nil, 'description' => 'metadata for records with a publication title exactly with an exact match' },
73
- 'category_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching category label' },
74
- 'type' => { 'possible_values' => '{type}', 'description' => "metadata records whose type = '{type}' Type must be an ID value from the list of types returned by the '/types' resource" },
75
- 'type_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exacty matching type label' },
76
- 'award_number' => { 'possible_values' => '{award_number}', 'description' => "metadata for records with a matching award nunber_ Optionally combine with 'award_funder'" },
77
- 'award_funder' => { 'possible_values' => '{funder doi or id}', 'description' => "metadata for records with an award with matching funder. Optionally combine with 'award_number'" },
78
- 'has_assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with any assertions' },
79
- 'assertion_group' => { 'possible_values' => nil, 'description' => 'metadata for records with an assertion in a particular group' },
80
- 'assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with a particular named assertion' },
81
- 'has_affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records that have any affiliation information' },
82
- 'alternative_id' => { 'possible_values' => nil, 'description' => 'metadata for records with the given alternative ID, which may be a publisher_specific ID, or any other identifier a publisher may have provided' },
83
- 'article_number' => { 'possible_values' => nil, 'description' => 'metadata for records with a given article number' },
84
- 'has_abstract' => { 'possible_values' => nil, 'description' => 'metadata for records which include an abstract' },
85
- 'has_clinical_trial_number' => { 'possible_values' => nil, 'description' => 'metadata for records which include a clinical trial number' },
86
- 'content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a particular domain name as the location Crossmark content will appear' },
87
- 'has_content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a domain name location for Crossmark content' },
88
- 'has_crossmark_restriction' => { 'possible_values' => nil, 'description' => 'metadata where the publisher restricts Crossmark usage to content domains' },
89
- 'has_relation' => { 'possible_values' => nil, 'description' => 'metadata for records that either assert or are the object of a relation' },
90
- 'relation_type' => { 'possible_values' => nil, 'description' => 'One of the relation types from the Crossref relations schema (e.g. is-referenced-by, is-parent-of, is-preprint-of)' },
91
- 'relation_object' => { 'possible_values' => nil, 'description' => 'Relations where the object identifier matches the identifier provided' },
92
- 'relation_object_type' => { 'possible_values' => nil, 'description' => 'One of the identifier types from the Crossref relations schema (e.g. doi, issn)' },
93
- 'public_references' => { 'possible_values' => nil, 'description' => 'metadata where publishers allow references to be distributed publically' },
94
- 'publisher_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching publisher name' },
95
- 'affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records with at least one contributor with the given affiliation' }
96
- }
@@ -79,7 +79,7 @@ module Serrano
79
79
 
80
80
  if id.nil?
81
81
  res = conn.get endpt, opts
82
- return MultiJson.load(res.body)
82
+ MultiJson.load(res.body)
83
83
  else
84
84
  self.id = Array(id)
85
85
  # url encoding
@@ -97,7 +97,7 @@ module Serrano
97
97
  res = conn.get endpt, opts
98
98
  coll << MultiJson.load(res.body)
99
99
  end
100
- return coll
100
+ coll
101
101
  end
102
102
  end
103
103
  end
@@ -99,7 +99,7 @@ module Serrano
99
99
  cu = js['message']['next-cursor']
100
100
  max_avail = js['message']['total-results']
101
101
  res = _redo_req(conn, js, opts, cu, max_avail)
102
- return res
102
+ res
103
103
  else
104
104
  self.id = Array(id)
105
105
  # url encoding
@@ -121,7 +121,7 @@ module Serrano
121
121
  max_avail = js['message']['total-results']
122
122
  coll << _redo_req(conn, js, opts, cu, max_avail)
123
123
  end
124
- return coll
124
+ coll
125
125
  end
126
126
  end
127
127
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Serrano
4
- VERSION = '0.5.4'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -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 = '2019-11-27'
12
+ s.date = '2020-02-18'
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'
@@ -17,7 +17,9 @@ Gem::Specification.new do |s|
17
17
  s.homepage = 'https://github.com/sckott/serrano'
18
18
  s.licenses = 'MIT'
19
19
 
20
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
21
23
  s.require_paths = ['lib']
22
24
 
23
25
  s.bindir = 'bin'
@@ -27,14 +29,22 @@ Gem::Specification.new do |s|
27
29
  s.add_development_dependency 'codecov', '~> 0.1.10'
28
30
  s.add_development_dependency 'json', '~> 2.1'
29
31
  s.add_development_dependency 'rake', '~> 12.3', '>= 12.3.1'
30
- s.add_development_dependency 'rubocop', '~> 0.76.0'
32
+ s.add_development_dependency 'rubocop', '~> 0.80.0'
31
33
  s.add_development_dependency 'simplecov', '~> 0.17.0'
32
34
  s.add_development_dependency 'test-unit', '~> 3.2', '>= 3.2.7'
33
35
  s.add_development_dependency 'vcr', '~> 5.0'
34
36
  s.add_development_dependency 'webmock', '~> 3.4', '>= 3.4.1'
35
37
 
36
- s.add_runtime_dependency 'faraday', '>= 0.15', '< 0.18'
37
- s.add_runtime_dependency 'faraday_middleware', '>= 0.12.2', '< 0.14.0'
38
+ s.add_runtime_dependency 'faraday', '>= 0.15', '< 1.0'
39
+ s.add_runtime_dependency 'faraday_middleware', '>= 0.12.2', '< 0.15.0'
38
40
  s.add_runtime_dependency 'multi_json', '~> 1.13', '>= 1.13.1'
39
- s.add_runtime_dependency 'thor', '~> 0.20.0'
41
+ s.add_runtime_dependency 'thor', '>= 0.20', '< 1.1'
42
+
43
+ s.metadata = {
44
+ 'homepage_uri' => 'https://github.com/sckott/serrano',
45
+ 'changelog_uri' =>
46
+ "https://github.com/sckott/serrano/releases/tag/v#{s.version}",
47
+ 'source_code_uri' => 'https://github.com/sckott/serrano',
48
+ 'bug_tracker_uri' => 'https://github.com/sckott/serrano/issues'
49
+ }
40
50
  end
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.5.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chamberlain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-27 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,14 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 0.76.0
87
+ version: 0.80.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.76.0
94
+ version: 0.80.0
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: simplecov
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -169,7 +169,7 @@ dependencies:
169
169
  version: '0.15'
170
170
  - - "<"
171
171
  - !ruby/object:Gem::Version
172
- version: '0.18'
172
+ version: '1.0'
173
173
  type: :runtime
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
@@ -179,7 +179,7 @@ dependencies:
179
179
  version: '0.15'
180
180
  - - "<"
181
181
  - !ruby/object:Gem::Version
182
- version: '0.18'
182
+ version: '1.0'
183
183
  - !ruby/object:Gem::Dependency
184
184
  name: faraday_middleware
185
185
  requirement: !ruby/object:Gem::Requirement
@@ -189,7 +189,7 @@ dependencies:
189
189
  version: 0.12.2
190
190
  - - "<"
191
191
  - !ruby/object:Gem::Version
192
- version: 0.14.0
192
+ version: 0.15.0
193
193
  type: :runtime
194
194
  prerelease: false
195
195
  version_requirements: !ruby/object:Gem::Requirement
@@ -199,7 +199,7 @@ dependencies:
199
199
  version: 0.12.2
200
200
  - - "<"
201
201
  - !ruby/object:Gem::Version
202
- version: 0.14.0
202
+ version: 0.15.0
203
203
  - !ruby/object:Gem::Dependency
204
204
  name: multi_json
205
205
  requirement: !ruby/object:Gem::Requirement
@@ -224,16 +224,22 @@ dependencies:
224
224
  name: thor
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - "~>"
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0.20'
230
+ - - "<"
228
231
  - !ruby/object:Gem::Version
229
- version: 0.20.0
232
+ version: '1.1'
230
233
  type: :runtime
231
234
  prerelease: false
232
235
  version_requirements: !ruby/object:Gem::Requirement
233
236
  requirements:
234
- - - "~>"
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ version: '0.20'
240
+ - - "<"
235
241
  - !ruby/object:Gem::Version
236
- version: 0.20.0
242
+ version: '1.1'
237
243
  description: Low Level Ruby Client for the Crossref Search API
238
244
  email: myrmecocystus@gmail.com
239
245
  executables:
@@ -270,7 +276,11 @@ files:
270
276
  homepage: https://github.com/sckott/serrano
271
277
  licenses:
272
278
  - MIT
273
- metadata: {}
279
+ metadata:
280
+ homepage_uri: https://github.com/sckott/serrano
281
+ changelog_uri: https://github.com/sckott/serrano/releases/tag/v0.6.0
282
+ source_code_uri: https://github.com/sckott/serrano
283
+ bug_tracker_uri: https://github.com/sckott/serrano/issues
274
284
  post_install_message:
275
285
  rdoc_options: []
276
286
  require_paths:
@@ -286,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
296
  - !ruby/object:Gem::Version
287
297
  version: '0'
288
298
  requirements: []
289
- rubygems_version: 3.0.4
299
+ rubygems_version: 3.1.2
290
300
  signing_key:
291
301
  specification_version: 4
292
302
  summary: Crossref Client