Sha256: cce8efd84e0f1be80775036db5237c5d4f8082c8731b214008050d8ccc052603

Contents?: true

Size: 998 Bytes

Versions: 15

Compression:

Stored size: 998 Bytes

Contents

# encoding: UTF-8

require "thor"

require_relative 'doi'
require_relative 'media'
require_relative 'metadata'

module Cirneco
  class CLI < Thor
    include Cirneco::Base
    include Cirneco::Api
    include Cirneco::Utils

    # load ENV variables from .env file if it exists
    env_file = File.expand_path("../../.env", __FILE__)
    if File.exist?(env_file)
      require 'dotenv'
      Dotenv.overload env_file
    end

    def self.exit_on_failure?
      true
    end

    # from http://stackoverflow.com/questions/22809972/adding-a-version-option-to-a-ruby-thor-cli
    map %w[--version -v] => :__print_version

    desc "--version, -v", "print the version"
    def __print_version
      puts Cirneco::VERSION
    end

    desc "doi SUBCOMMAND", "doi commands"
    subcommand "doi", Cirneco::Doi

    desc "metadata SUBCOMMAND", "metadata commands"
    subcommand "metadata", Cirneco::Metadata

    desc "media SUBCOMMAND", "media commands"
    subcommand "media", Cirneco::Media
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cirneco-0.9.27 lib/cirneco/cli.rb
cirneco-0.9.26 lib/cirneco/cli.rb
cirneco-0.9.25 lib/cirneco/cli.rb
cirneco-0.9.24 lib/cirneco/cli.rb
cirneco-0.9.23 lib/cirneco/cli.rb
cirneco-0.9.22 lib/cirneco/cli.rb
cirneco-0.9.21 lib/cirneco/cli.rb
cirneco-0.9.20 lib/cirneco/cli.rb
cirneco-0.9.19 lib/cirneco/cli.rb
cirneco-0.9.18 lib/cirneco/cli.rb
cirneco-0.9.17 lib/cirneco/cli.rb
cirneco-0.9.16 lib/cirneco/cli.rb
cirneco-0.9.15 lib/cirneco/cli.rb
cirneco-0.9.14 lib/cirneco/cli.rb
cirneco-0.9.13 lib/cirneco/cli.rb