Class: Bolognese::CLI
- Inherits:
-
Thor
- Object
- Thor
- Bolognese::CLI
- Defined in:
- lib/bolognese/cli.rb
Constant Summary
Constants included from Utils
Utils::CR_TO_CP_TRANSLATIONS, Utils::CR_TO_JATS_TRANSLATIONS, Utils::CR_TO_RIS_TRANSLATIONS, Utils::DC_TO_CP_TRANSLATIONS, Utils::DC_TO_RIS_TRANSLATIONS, Utils::DC_TO_SO_TRANSLATIONS, Utils::LICENSE_NAMES, 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
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Utils
#find_from_format, #find_from_format_by_ext, #find_from_format_by_id, #find_from_format_by_string, #from_citeproc, #from_schema_org, #get_date_from_date_parts, #get_date_from_parts, #get_date_parts, #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, #jsonlint, #map_hash_keys, #normalize_id, #normalize_ids, #normalize_licenses, #normalize_orcid, #normalize_url, #orcid_as_url, #orcid_from_url, #parse_attributes, #sanitize, #to_citeproc, #to_ris, #to_schema_org, #validate_orcid, #validate_orcid_scheme, #validate_url
Methods included from DoiUtils
#doi_as_url, #doi_from_url, #doi_resolver, #doi_search, #get_doi_ra, #normalize_doi, #validate_doi, #validate_prefix
Class Method Details
.exit_on_failure? ⇒ Boolean
13 14 15 |
# File 'lib/bolognese/cli.rb', line 13 def self.exit_on_failure? true end |
Instance Method Details
#__print_version ⇒ Object
21 22 23 |
# File 'lib/bolognese/cli.rb', line 21 def __print_version puts Bolognese::VERSION end |
#convert(input) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bolognese/cli.rb', line 31 def convert(input) = Metadata.new(input: input, from: [:from], regenerate: [:regenerate], style: [:style], locale: [:locale]) to = [:to] || "schema_org" if .valid? puts .send(to) else $stderr.puts .errors end end |