Class: Briard::CLI
Constant Summary
Constants included
from Utils
Utils::BIB_TO_CR_TRANSLATIONS, Utils::BIB_TO_DC_TRANSLATIONS, Utils::CP_TO_DC_TRANSLATIONS, Utils::CR_TO_BIB_TRANSLATIONS, Utils::CR_TO_CP_TRANSLATIONS, Utils::CR_TO_DC_TRANSLATIONS, Utils::CR_TO_JATS_TRANSLATIONS, Utils::CR_TO_RIS_TRANSLATIONS, Utils::CR_TO_SO_TRANSLATIONS, Utils::DC_TO_CP_TRANSLATIONS, Utils::DC_TO_RIS_TRANSLATIONS, Utils::DC_TO_SO_TRANSLATIONS, Utils::NORMALIZED_LICENSES, Utils::RIS_TO_DC_TRANSLATIONS, Utils::SO_TO_BIB_TRANSLATIONS, Utils::SO_TO_CP_TRANSLATIONS, Utils::SO_TO_DC_TRANSLATIONS, Utils::SO_TO_JATS_TRANSLATIONS, Utils::SO_TO_RIS_TRANSLATIONS, Utils::UNKNOWN_INFORMATION
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Utils
#decode_doi, #encode_doi, #find_from_format, #find_from_format_by_ext, #find_from_format_by_filename, #find_from_format_by_id, #find_from_format_by_string, #from_citeproc, #from_datacite_json, #from_schema_org, #from_schema_org_contributors, #from_schema_org_creators, #get_contributor, #get_date, #get_date_from_date_parts, #get_date_from_parts, #get_date_parts, #get_date_parts_from_parts, #get_datetime_from_iso8601, #get_datetime_from_time, #get_identifier, #get_identifier_type, #get_iso8601_date, #get_series_information, #get_year_month, #get_year_month_day, #github_as_cff_url, #github_as_codemeta_url, #github_as_owner_url, #github_as_release_url, #github_as_repo_url, #github_from_url, #github_owner_from_url, #github_release_from_url, #github_repo_from_url, #hsh_to_fos, #hsh_to_spdx, #jsonlint, #map_hash_keys, #name_to_fos, #name_to_spdx, #normalize_cc_url, #normalize_id, #normalize_ids, #normalize_issn, #normalize_licenses, #normalize_orcid, #normalize_url, #orcid_as_url, #orcid_from_url, #parse_attributes, #sanitize, #strip_milliseconds, #to_citeproc, #to_datacite_json, #to_identifier, #to_ris, #to_schema_org, #to_schema_org_container, #to_schema_org_contributors, #to_schema_org_creators, #to_schema_org_funder, #to_schema_org_identifiers, #to_schema_org_relation, #to_schema_org_spatial_coverage, #validate_orcid, #validate_orcid_scheme, #validate_url
Methods included from DoiUtils
#crossref_api_url, #datacite_api_url, #doi_as_url, #doi_from_url, #doi_resolver, #get_doi_ra, #normalize_doi, #validate_doi, #validate_funder_doi, #validate_prefix
Class Method Details
.exit_on_failure? ⇒ Boolean
13
14
15
|
# File 'lib/briard/cli.rb', line 13
def self.exit_on_failure?
true
end
|
Instance Method Details
#__print_version ⇒ Object
21
22
23
|
# File 'lib/briard/cli.rb', line 21
def __print_version
puts Briard::VERSION
end
|
#convert(input) ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/briard/cli.rb', line 36
def convert(input)
metadata = Metadata.new(input: input,
from: options[:from],
regenerate: options[:regenerate],
style: options[:style],
locale: options[:locale],
show_errors: options[:show_errors],
depositor: options[:depositor],
email: options[:email],
registrant: options[:registrant])
to = options[:to] || 'schema_org'
if options[:show_errors] && !metadata.valid?
warn metadata.errors
else
puts metadata.send(to)
end
end
|
#decode(doi) ⇒ Object
61
62
63
|
# File 'lib/briard/cli.rb', line 61
def decode(doi)
puts decode_doi(doi)
end
|
#encode(prefix) ⇒ Object
56
57
58
|
# File 'lib/briard/cli.rb', line 56
def encode(prefix)
puts encode_doi(prefix)
end
|