serrano
Advanced tools
+6
-23
| # This configuration was generated by | ||
| # `rubocop --auto-gen-config` | ||
| # on 2018-12-18 19:46:09 -0800 using RuboCop version 0.61.1. | ||
| # on 2020-02-18 08:24:37 -0800 using RuboCop version 0.80.0. | ||
| # The point is for the user to remove these configuration records | ||
@@ -21,8 +21,2 @@ # one by one as the offenses are removed from the code base. | ||
| # Offense count: 1 | ||
| # Configuration parameters: CountComments, ExcludedMethods. | ||
| # ExcludedMethods: refine | ||
| Metrics/BlockLength: | ||
| Max: 28 | ||
| # Offense count: 1 | ||
| # Configuration parameters: CountBlocks. | ||
@@ -41,3 +35,3 @@ Metrics/BlockNesting: | ||
| # Offense count: 20 | ||
| # Offense count: 21 | ||
| # Configuration parameters: CountComments, ExcludedMethods. | ||
@@ -53,4 +47,4 @@ Metrics/MethodLength: | ||
| # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. | ||
| # AllowedNames: io, id, to, by, on, in, at, ip, db | ||
| Naming/UncommunicativeMethodParamName: | ||
| # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp | ||
| Naming/MethodParameterName: | ||
| Exclude: | ||
@@ -89,12 +83,7 @@ - 'lib/serrano/filterhandler.rb' | ||
| # Offense count: 1 | ||
| # Configuration parameters: . | ||
| # Configuration parameters: EnforcedStyle. | ||
| # SupportedStyles: annotated, template, unannotated | ||
| Style/FormatStringToken: | ||
| EnforcedStyle: unannotated | ||
| # Offense count: 1 | ||
| # Configuration parameters: MinBodyLength. | ||
| Style/GuardClause: | ||
| Exclude: | ||
| - 'lib/serrano/response.rb' | ||
| - 'lib/serrano/utils.rb' | ||
@@ -121,7 +110,1 @@ # Offense count: 3 | ||
| - 'lib/serrano/utils.rb' | ||
| # Offense count: 198 | ||
| # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. | ||
| # URISchemes: http, https | ||
| Metrics/LineLength: | ||
| Max: 525 |
+16
-0
@@ -10,2 +10,5 @@ inherit_from: .rubocop_todo.yml | ||
| Metrics/ModuleLength: | ||
| Max: 800 | ||
| # Offense count: 22 | ||
@@ -16,1 +19,14 @@ # Configuration parameters: AllowedVariables. | ||
| - 'lib/serrano/filters.rb' | ||
| Style/HashEachMethods: | ||
| Enabled: true | ||
| Style/HashTransformKeys: | ||
| Enabled: true | ||
| Style/HashTransformValues: | ||
| Enabled: true | ||
| Layout/LineLength: | ||
| Max: 525 | ||
+2
-3
| language: ruby | ||
| cache: bundler | ||
| rvm: | ||
| - 2.5.0 | ||
| - 2.6.0 | ||
| - 2.6.5 | ||
| - 2.7.0 | ||
| before_install: | ||
| - gem update --system | ||
| - gem install bundler | ||
| - gem --version | ||
| script: | ||
| - bundle exec rake test TESTOPTS="-v" | ||
| - bundle exec rubocop |
+8
-0
@@ -0,1 +1,9 @@ | ||
| ## 0.6.0 (2020-02-18) | ||
| * query.title (`query_title` query filter as used here) has been removed; use `query_bibliographic` instead (#111) | ||
| * bump `faraday` to version 0.17.1 from 0.17.0 (via dependabot) (#107) | ||
| * bump `json` to version 2.3 from 2.2 (via dependabot) (#109) | ||
| * bump `thor` minimum version (via dependabot) (#110) | ||
| * 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 | ||
| ## 0.5.4 (2019-11-27) | ||
@@ -2,0 +10,0 @@ |
@@ -24,3 +24,3 @@ # Contributor Code of Conduct | ||
| This Code of Conduct is adapted from the Contributor Covenant | ||
| (http:contributor-covenant.org), version 1.0.0, available at | ||
| http://contributor-covenant.org/version/1/0/0/ | ||
| (https://contributor-covenant.org), version 1.0.0, available at | ||
| https://contributor-covenant.org/version/1/0/0/ |
+19
-17
| PATH | ||
| remote: . | ||
| specs: | ||
| serrano (0.5.4) | ||
| faraday (>= 0.15, < 0.18) | ||
| faraday_middleware (>= 0.12.2, < 0.14.0) | ||
| serrano (0.6.0) | ||
| faraday (>= 0.15, < 1.0) | ||
| faraday_middleware (>= 0.12.2, < 0.15.0) | ||
| multi_json (~> 1.13, >= 1.13.1) | ||
| thor (~> 0.20.0) | ||
| thor (>= 0.20, < 1.1) | ||
@@ -23,23 +23,25 @@ GEM | ||
| docile (1.3.2) | ||
| faraday (0.17.0) | ||
| faraday (0.17.3) | ||
| multipart-post (>= 1.2, < 3) | ||
| faraday_middleware (0.13.1) | ||
| faraday_middleware (0.14.0) | ||
| faraday (>= 0.7.4, < 1.0) | ||
| hashdiff (1.0.0) | ||
| jaro_winkler (1.5.4) | ||
| json (2.2.0) | ||
| json (2.3.0) | ||
| multi_json (1.14.1) | ||
| multipart-post (2.1.1) | ||
| parallel (1.19.1) | ||
| parser (2.6.5.0) | ||
| parser (2.7.0.2) | ||
| ast (~> 2.4.0) | ||
| power_assert (1.1.5) | ||
| public_suffix (4.0.1) | ||
| public_suffix (3.1.1) | ||
| rainbow (3.0.0) | ||
| rake (12.3.3) | ||
| rubocop (0.76.0) | ||
| rexml (3.2.4) | ||
| rubocop (0.80.0) | ||
| jaro_winkler (~> 1.5.1) | ||
| parallel (~> 1.10) | ||
| parser (>= 2.6) | ||
| parser (>= 2.7.0.1) | ||
| rainbow (>= 2.2.2, < 4.0) | ||
| rexml | ||
| ruby-progressbar (~> 1.7) | ||
@@ -56,7 +58,7 @@ unicode-display_width (>= 1.4.0, < 1.7) | ||
| power_assert | ||
| thor (0.20.3) | ||
| unicode-display_width (1.6.0) | ||
| thor (1.0.1) | ||
| unicode-display_width (1.6.1) | ||
| url (0.3.2) | ||
| vcr (5.0.0) | ||
| webmock (3.7.6) | ||
| vcr (5.1.0) | ||
| webmock (3.8.2) | ||
| addressable (>= 2.3.6) | ||
@@ -74,3 +76,3 @@ crack (>= 0.3.2) | ||
| rake (~> 12.3, >= 12.3.1) | ||
| rubocop (~> 0.76.0) | ||
| rubocop (~> 0.80.0) | ||
| serrano! | ||
@@ -83,2 +85,2 @@ simplecov (~> 0.17.0) | ||
| BUNDLED WITH | ||
| 2.0.2 | ||
| 2.1.3 |
+26
-3
@@ -70,3 +70,2 @@ # frozen_string_literal: true | ||
| # periods should be replaced with underscores. The options include: | ||
| # - query_title: Query title and subtitle | ||
| # - query_container_title: Query container-title aka. publication name | ||
@@ -238,2 +237,3 @@ # - query_author: Query author given and family names | ||
| assert_valid_filters(filter) if filter | ||
| RequestCursor.new('works', ids, query, filter, offset, | ||
@@ -295,2 +295,3 @@ limit, sample, sort, order, facet, select, nil, nil, options, | ||
| assert_valid_filters(filter) if filter | ||
| RequestCursor.new('members', ids, query, filter, offset, | ||
@@ -332,4 +333,4 @@ limit, sample, sort, order, facet, select, works, nil, | ||
| # # field queries | ||
| # ## query.title | ||
| # res = Serrano.prefixes(ids: "10.1016", works: true, query_title: 'cell biology') | ||
| # ## query.bibliographic | ||
| # res = Serrano.prefixes(ids: "10.1016", works: true, query_bibliographic: 'cell biology') | ||
| # res[0]['message']['items'].collect { |x| x['title'] } | ||
@@ -344,2 +345,3 @@ # | ||
| assert_valid_filters(filter) if filter | ||
| RequestCursor.new('prefixes', ids, nil, filter, offset, | ||
@@ -397,2 +399,3 @@ limit, sample, sort, order, facet, select, works, nil, | ||
| assert_valid_filters(filter) if filter | ||
| RequestCursor.new('funders', ids, query, filter, offset, | ||
@@ -450,2 +453,3 @@ limit, sample, sort, order, facet, select, works, nil, options, | ||
| assert_valid_filters(filter) if filter | ||
| RequestCursor.new('journals', ids, query, filter, offset, | ||
@@ -679,2 +683,21 @@ limit, sample, sort, order, facet, select, works, nil, options, | ||
| end | ||
| def self.assert_valid_filters(filters) | ||
| unless filters.is_a? Hash | ||
| raise ArgumentError, <<~ERR | ||
| Filters must be provided as a hash, like: | ||
| Serrano.works(query: "something", filters: { has_abstract: true }) | ||
| ERR | ||
| end | ||
| filters.each do |name, _| | ||
| filter_strings = Filters.names.map(&:to_s) | ||
| next if filter_strings.include?(name.to_s) | ||
| raise ArgumentError, <<~ERR | ||
| The filter "#{name}" is not a valid filter. Please run `Serrano.filters.filters` to see all valid filters. | ||
| ERR | ||
| end | ||
| end | ||
| end |
@@ -56,3 +56,3 @@ # frozen_string_literal: true | ||
| self.ids = ids[0] if ids.class == Array | ||
| return make_request(conn, ids, format, style, locale) | ||
| make_request(conn, ids, format, style, locale) | ||
| else | ||
@@ -63,3 +63,3 @@ coll = [] | ||
| end | ||
| return coll | ||
| coll | ||
| end | ||
@@ -66,0 +66,0 @@ end |
+89
-85
| # frozen_string_literal: true | ||
| ## | ||
| # Serrano::Filters | ||
| # | ||
| # Information on Crossref API filters | ||
| # | ||
| # @example | ||
| # require 'serrano' | ||
| # # List filter names | ||
| # Serrano::Filters.names | ||
| # # List filter values and description | ||
| # Serrano::Filters.filters | ||
| # Serrano::Filters.filters['has_funder'] | ||
| # Serrano::Filters.filters['has_funder']['description'] | ||
| module Serrano | ||
| def self.filters | ||
| Filters | ||
| end | ||
| ## | ||
| # Serrano::Filters | ||
| # | ||
| # Information on Crossref API filters | ||
| # | ||
| # @example | ||
| # require 'serrano' | ||
| # # List filter names | ||
| # Serrano::Filters.names | ||
| # # List filter values and description | ||
| # Serrano::Filters.filters | ||
| # Serrano::Filters.filters['has_funder'] | ||
| # Serrano::Filters.filters['has_funder']['description'] | ||
| module Filters | ||
| def self.names | ||
| filter_details.keys | ||
| FILTER_DETAILS.keys | ||
| end | ||
| def self.filters | ||
| filter_details | ||
| FILTER_DETAILS | ||
| end | ||
| FILTER_DETAILS = { | ||
| 'has_funder' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more funder entry' }, | ||
| 'funder' => { 'possible_values' => '{funder_id}', 'description' => 'metadata which include the {funder_id} in FundRef data' }, | ||
| 'location' => { 'possible_values' => '{country_name}', 'description' => 'funder records where location = {country name}. Only works on /funders route' }, | ||
| 'prefix' => { 'possible_values' => '{owner_prefix}', 'description' => "metadata belonging to a DOI owner prefix {owner_prefix} (e.g. '10.1016' )" }, | ||
| 'member' => { 'possible_values' => '{member_id}', 'description' => 'metadata belonging to a CrossRef member' }, | ||
| 'from_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed since (inclusive) {date}' }, | ||
| 'until_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed before (inclusive) {date}' }, | ||
| 'from_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited since (inclusive) {date}' }, | ||
| 'until_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited before (inclusive) {date}' }, | ||
| 'from_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated since (inclusive) {date} Currently the same as 'from_deposit_date'" }, | ||
| 'until_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated before (inclusive) {date} Currently the same as 'until_deposit_date'" }, | ||
| 'from_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited since (inclusive) {date}' }, | ||
| 'until_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited before (inclusive) {date}' }, | ||
| 'from_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is since (inclusive) {date}' }, | ||
| 'until_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is before (inclusive) {date}' }, | ||
| 'from_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is since (inclusive) {date}' }, | ||
| 'until_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is before (inclusive) {date}' }, | ||
| 'from_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is since (inclusive) {date}' }, | ||
| 'until_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is before (inclusive) {date}' }, | ||
| 'from_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is since (inclusive) {date}' }, | ||
| 'until_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is before (inclusive) {date}' }, | ||
| 'from_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is since (inclusive) {date}' }, | ||
| 'until_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is before (inclusive) {date}' }, | ||
| 'has_license' => { 'possible_values' => nil, 'description' => "metadata that includes any '<license_ref>' elements" }, | ||
| 'license_url' => { 'possible_values' => '{url}', 'description' => "metadata where '<license_ref>' value equals {url}" }, | ||
| 'license_version' => { 'possible_values' => '{string}', 'description' => "metadata where the '<license_ref>''s 'applies_to' attribute is '{string}'" }, | ||
| 'license_delay' => { 'possible_values' => '{integer}', 'description' => "metadata where difference between publication date and the '<license_ref>''s 'start_date' attribute is <= '{integer}' (in days" }, | ||
| 'has_full_text' => { 'possible_values' => nil, 'description' => "metadata that includes any full text '<resource>' elements_" }, | ||
| 'full_text_version' => { 'possible_values' => '{string}', 'description' => "metadata where '<resource>' element's 'content_version' attribute is '{string}'" }, | ||
| 'full_text_type' => { 'possible_values' => '{mime_type}', 'description' => "metadata where '<resource>' element's 'content_type' attribute is '{mime_type}' (e.g. 'application/pdf')" }, | ||
| 'full_text_application' => { 'possible_values' => '{string}', 'description' => 'metadata where <resource> link has one of the following intended applications: text-mining, similarity-checking or unspecified' }, | ||
| 'has_references' => { 'possible_values' => nil, 'description' => 'metadata for works that have a list of references' }, | ||
| 'has_archive' => { 'possible_values' => nil, 'description' => 'metadata which include name of archive partner' }, | ||
| 'archive' => { 'possible_values' => '{string}', 'description' => "metadata which where value of archive partner is '{string}'" }, | ||
| 'has_orcid' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more ORCIDs' }, | ||
| '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' }, | ||
| 'orcid' => { 'possible_values' => '{orcid}', 'description' => "metadata where '<orcid>' element's value = '{orcid}'" }, | ||
| 'issn' => { 'possible_values' => '{issn}', 'description' => "metadata where record has an ISSN = '{issn}' Format is 'xxxx_xxxx'." }, | ||
| 'directory' => { 'possible_values' => '{directory}', 'description' => "metadata records whose article or serial are mentioned in the given '{directory}'. Currently the only supported value is 'doaj'" }, | ||
| 'doi' => { 'possible_values' => '{doi}', 'description' => "metadata describing the DOI '{doi}'" }, | ||
| 'updates' => { 'possible_values' => '{doi}', 'description' => "metadata for records that represent editorial updates to the DOI '{doi}'" }, | ||
| 'is_update' => { 'possible_values' => nil, 'description' => 'metadata for records that represent editorial updates' }, | ||
| 'has_update_policy' => { 'possible_values' => nil, 'description' => 'metadata for records that include a link to an editorial update policy' }, | ||
| 'container_title' => { 'possible_values' => nil, 'description' => 'metadata for records with a publication title exactly with an exact match' }, | ||
| 'category_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching category label' }, | ||
| '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" }, | ||
| 'type_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exacty matching type label' }, | ||
| 'award_number' => { 'possible_values' => '{award_number}', 'description' => "metadata for records with a matching award nunber_ Optionally combine with 'award_funder'" }, | ||
| 'award_funder' => { 'possible_values' => '{funder doi or id}', 'description' => "metadata for records with an award with matching funder. Optionally combine with 'award_number'" }, | ||
| 'has_assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with any assertions' }, | ||
| 'assertion_group' => { 'possible_values' => nil, 'description' => 'metadata for records with an assertion in a particular group' }, | ||
| 'assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with a particular named assertion' }, | ||
| 'has_affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records that have any affiliation information' }, | ||
| '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' }, | ||
| 'article_number' => { 'possible_values' => nil, 'description' => 'metadata for records with a given article number' }, | ||
| 'has_abstract' => { 'possible_values' => nil, 'description' => 'metadata for records which include an abstract' }, | ||
| 'has_clinical_trial_number' => { 'possible_values' => nil, 'description' => 'metadata for records which include a clinical trial number' }, | ||
| 'content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a particular domain name as the location Crossmark content will appear' }, | ||
| 'has_content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a domain name location for Crossmark content' }, | ||
| 'has_crossmark_restriction' => { 'possible_values' => nil, 'description' => 'metadata where the publisher restricts Crossmark usage to content domains' }, | ||
| 'has_relation' => { 'possible_values' => nil, 'description' => 'metadata for records that either assert or are the object of a relation' }, | ||
| '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)' }, | ||
| 'relation_object' => { 'possible_values' => nil, 'description' => 'Relations where the object identifier matches the identifier provided' }, | ||
| 'relation_object_type' => { 'possible_values' => nil, 'description' => 'One of the identifier types from the Crossref relations schema (e.g. doi, issn)' }, | ||
| 'public_references' => { 'possible_values' => nil, 'description' => 'metadata where publishers allow references to be distributed publically' }, | ||
| 'publisher_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching publisher name' }, | ||
| 'affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records with at least one contributor with the given affiliation' } | ||
| }.freeze | ||
| end | ||
| end | ||
| filter_details = { | ||
| 'has_funder' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more funder entry' }, | ||
| 'funder' => { 'possible_values' => '{funder_id}', 'description' => 'metadata which include the {funder_id} in FundRef data' }, | ||
| 'location' => { 'possible_values' => '{country_name}', 'description' => 'funder records where location = {country name}. Only works on /funders route' }, | ||
| 'prefix' => { 'possible_values' => '{owner_prefix}', 'description' => "metadata belonging to a DOI owner prefix {owner_prefix} (e.g. '10.1016' )" }, | ||
| 'member' => { 'possible_values' => '{member_id}', 'description' => 'metadata belonging to a CrossRef member' }, | ||
| 'from_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed since (inclusive) {date}' }, | ||
| 'until_index_date' => { 'possible_values' => '{date}', 'description' => 'metadata indexed before (inclusive) {date}' }, | ||
| 'from_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited since (inclusive) {date}' }, | ||
| 'until_deposit_date' => { 'possible_values' => '{date}', 'description' => 'metadata last (re)deposited before (inclusive) {date}' }, | ||
| 'from_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated since (inclusive) {date} Currently the same as 'from_deposit_date'" }, | ||
| 'until_update_date' => { 'possible_values' => '{date}', 'description' => "Metadata updated before (inclusive) {date} Currently the same as 'until_deposit_date'" }, | ||
| 'from_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited since (inclusive) {date}' }, | ||
| 'until_created_date' => { 'possible_values' => '{date}', 'description' => 'metadata first deposited before (inclusive) {date}' }, | ||
| 'from_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is since (inclusive) {date}' }, | ||
| 'until_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where published date is before (inclusive) {date}' }, | ||
| 'from_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is since (inclusive) {date}' }, | ||
| 'until_online_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where online published date is before (inclusive) {date}' }, | ||
| 'from_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is since (inclusive) {date}' }, | ||
| 'until_print_pub_date' => { 'possible_values' => '{date}', 'description' => 'metadata where print published date is before (inclusive) {date}' }, | ||
| 'from_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is since (inclusive) {date}' }, | ||
| 'until_posted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where posted date is before (inclusive) {date}' }, | ||
| 'from_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is since (inclusive) {date}' }, | ||
| 'until_accepted_date' => { 'possible_values' => '{date}', 'description' => 'metadata where accepted date is before (inclusive) {date}' }, | ||
| 'has_license' => { 'possible_values' => nil, 'description' => "metadata that includes any '<license_ref>' elements" }, | ||
| 'license_url' => { 'possible_values' => '{url}', 'description' => "metadata where '<license_ref>' value equals {url}" }, | ||
| 'license_version' => { 'possible_values' => '{string}', 'description' => "metadata where the '<license_ref>''s 'applies_to' attribute is '{string}'" }, | ||
| 'license_delay' => { 'possible_values' => '{integer}', 'description' => "metadata where difference between publication date and the '<license_ref>''s 'start_date' attribute is <= '{integer}' (in days" }, | ||
| 'has_full_text' => { 'possible_values' => nil, 'description' => "metadata that includes any full text '<resource>' elements_" }, | ||
| 'full_text_version' => { 'possible_values' => '{string}', 'description' => "metadata where '<resource>' element's 'content_version' attribute is '{string}'" }, | ||
| 'full_text_type' => { 'possible_values' => '{mime_type}', 'description' => "metadata where '<resource>' element's 'content_type' attribute is '{mime_type}' (e.g. 'application/pdf')" }, | ||
| 'full_text_application' => { 'possible_values' => '{string}', 'description' => 'metadata where <resource> link has one of the following intended applications: text-mining, similarity-checking or unspecified' }, | ||
| 'has_references' => { 'possible_values' => nil, 'description' => 'metadata for works that have a list of references' }, | ||
| 'has_archive' => { 'possible_values' => nil, 'description' => 'metadata which include name of archive partner' }, | ||
| 'archive' => { 'possible_values' => '{string}', 'description' => "metadata which where value of archive partner is '{string}'" }, | ||
| 'has_orcid' => { 'possible_values' => nil, 'description' => 'metadata which includes one or more ORCIDs' }, | ||
| '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' }, | ||
| 'orcid' => { 'possible_values' => '{orcid}', 'description' => "metadata where '<orcid>' element's value = '{orcid}'" }, | ||
| 'issn' => { 'possible_values' => '{issn}', 'description' => "metadata where record has an ISSN = '{issn}' Format is 'xxxx_xxxx'." }, | ||
| 'directory' => { 'possible_values' => '{directory}', 'description' => "metadata records whose article or serial are mentioned in the given '{directory}'. Currently the only supported value is 'doaj'" }, | ||
| 'doi' => { 'possible_values' => '{doi}', 'description' => "metadata describing the DOI '{doi}'" }, | ||
| 'updates' => { 'possible_values' => '{doi}', 'description' => "metadata for records that represent editorial updates to the DOI '{doi}'" }, | ||
| 'is_update' => { 'possible_values' => nil, 'description' => 'metadata for records that represent editorial updates' }, | ||
| 'has_update_policy' => { 'possible_values' => nil, 'description' => 'metadata for records that include a link to an editorial update policy' }, | ||
| 'container_title' => { 'possible_values' => nil, 'description' => 'metadata for records with a publication title exactly with an exact match' }, | ||
| 'category_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching category label' }, | ||
| '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" }, | ||
| 'type_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exacty matching type label' }, | ||
| 'award_number' => { 'possible_values' => '{award_number}', 'description' => "metadata for records with a matching award nunber_ Optionally combine with 'award_funder'" }, | ||
| 'award_funder' => { 'possible_values' => '{funder doi or id}', 'description' => "metadata for records with an award with matching funder. Optionally combine with 'award_number'" }, | ||
| 'has_assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with any assertions' }, | ||
| 'assertion_group' => { 'possible_values' => nil, 'description' => 'metadata for records with an assertion in a particular group' }, | ||
| 'assertion' => { 'possible_values' => nil, 'description' => 'metadata for records with a particular named assertion' }, | ||
| 'has_affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records that have any affiliation information' }, | ||
| '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' }, | ||
| 'article_number' => { 'possible_values' => nil, 'description' => 'metadata for records with a given article number' }, | ||
| 'has_abstract' => { 'possible_values' => nil, 'description' => 'metadata for records which include an abstract' }, | ||
| 'has_clinical_trial_number' => { 'possible_values' => nil, 'description' => 'metadata for records which include a clinical trial number' }, | ||
| 'content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a particular domain name as the location Crossmark content will appear' }, | ||
| 'has_content_domain' => { 'possible_values' => nil, 'description' => 'metadata where the publisher records a domain name location for Crossmark content' }, | ||
| 'has_crossmark_restriction' => { 'possible_values' => nil, 'description' => 'metadata where the publisher restricts Crossmark usage to content domains' }, | ||
| 'has_relation' => { 'possible_values' => nil, 'description' => 'metadata for records that either assert or are the object of a relation' }, | ||
| '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)' }, | ||
| 'relation_object' => { 'possible_values' => nil, 'description' => 'Relations where the object identifier matches the identifier provided' }, | ||
| 'relation_object_type' => { 'possible_values' => nil, 'description' => 'One of the identifier types from the Crossref relations schema (e.g. doi, issn)' }, | ||
| 'public_references' => { 'possible_values' => nil, 'description' => 'metadata where publishers allow references to be distributed publically' }, | ||
| 'publisher_name' => { 'possible_values' => nil, 'description' => 'metadata for records with an exact matching publisher name' }, | ||
| 'affiliation' => { 'possible_values' => nil, 'description' => 'metadata for records with at least one contributor with the given affiliation' } | ||
| } |
@@ -102,3 +102,3 @@ # frozen_string_literal: true | ||
| res = _redo_req(conn, js, opts, cu, max_avail) | ||
| return res | ||
| res | ||
| else | ||
@@ -125,3 +125,3 @@ self.id = Array(id) | ||
| end | ||
| return coll | ||
| coll | ||
| end | ||
@@ -128,0 +128,0 @@ end |
@@ -82,3 +82,3 @@ # frozen_string_literal: true | ||
| res = conn.get endpt, opts | ||
| return MultiJson.load(res.body) | ||
| MultiJson.load(res.body) | ||
| else | ||
@@ -101,3 +101,3 @@ self.id = Array(id) | ||
| end | ||
| return coll | ||
| coll | ||
| end | ||
@@ -104,0 +104,0 @@ end |
| # frozen_string_literal: true | ||
| module Serrano | ||
| VERSION = '0.5.4' | ||
| VERSION = '0.6.0' | ||
| end |
+1
-1
@@ -1,2 +0,2 @@ | ||
| Copyright (C) 2019 Scott Chamberlain | ||
| Copyright (C) 2020 Scott Chamberlain | ||
@@ -3,0 +3,0 @@ 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: |
+6
-0
@@ -125,2 +125,8 @@ serrano | ||
| Search works using metadata filters. See [CrossRef filter docs](https://github.com/CrossRef/rest-api-doc#filter-names). | ||
| ```ruby | ||
| Serrano.works(query: "ecology", filter: { has_abstract: true }) | ||
| ``` | ||
| Search journals by publisher name | ||
@@ -127,0 +133,0 @@ |
+16
-6
@@ -12,3 +12,3 @@ # frozen_string_literal: true | ||
| s.required_ruby_version = '>= 2.1' | ||
| s.date = '2019-11-27' | ||
| s.date = '2020-02-18' | ||
| s.summary = 'Crossref Client' | ||
@@ -21,3 +21,5 @@ s.description = 'Low Level Ruby Client for the Crossref Search API' | ||
| s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
| s.files = `git ls-files -z`.split("\x0").reject do |f| | ||
| f.match(%r{^(test|spec|features)/}) | ||
| end | ||
| s.require_paths = ['lib'] | ||
@@ -32,3 +34,3 @@ | ||
| s.add_development_dependency 'rake', '~> 12.3', '>= 12.3.1' | ||
| s.add_development_dependency 'rubocop', '~> 0.76.0' | ||
| s.add_development_dependency 'rubocop', '~> 0.80.0' | ||
| s.add_development_dependency 'simplecov', '~> 0.17.0' | ||
@@ -39,6 +41,14 @@ s.add_development_dependency 'test-unit', '~> 3.2', '>= 3.2.7' | ||
| s.add_runtime_dependency 'faraday', '>= 0.15', '< 0.18' | ||
| s.add_runtime_dependency 'faraday_middleware', '>= 0.12.2', '< 0.14.0' | ||
| s.add_runtime_dependency 'faraday', '>= 0.15', '< 1.0' | ||
| s.add_runtime_dependency 'faraday_middleware', '>= 0.12.2', '< 0.15.0' | ||
| s.add_runtime_dependency 'multi_json', '~> 1.13', '>= 1.13.1' | ||
| s.add_runtime_dependency 'thor', '~> 0.20.0' | ||
| s.add_runtime_dependency 'thor', '>= 0.20', '< 1.1' | ||
| s.metadata = { | ||
| 'homepage_uri' => 'https://github.com/sckott/serrano', | ||
| 'changelog_uri' => | ||
| "https://github.com/sckott/serrano/releases/tag/v#{s.version}", | ||
| 'source_code_uri' => 'https://github.com/sckott/serrano', | ||
| 'bug_tracker_uri' => 'https://github.com/sckott/serrano/issues' | ||
| } | ||
| end |