Sha256: 4a8d3328d38960adb38d125797e486ab57c64f49bde94c5f10da1de5640b4314
Contents?: true
Size: 1.47 KB
Versions: 2
Compression:
Stored size: 1.47 KB
Contents
# -*- coding: utf-8 -*- module Gemirro # CLI mode module CLI ## # Hash containing the default Slop options. # # @return [Hash] # SLOP_OPTIONS = { strict: true, help: true, banner: 'Usage: gemirro [COMMAND] [OPTIONS]' }.freeze ## # @return [Slop] # def self.options @options ||= default_options end ## # Loads the specified configuration file or displays an error if it doesn't # exist. # # @param [String] config_file # @return [Gemirro::Configuration] # def self.load_configuration(config_file) config_file ||= Configuration.default_configuration_file config_file = File.expand_path(config_file, Dir.pwd) config_file += '/config.rb' unless config_file.end_with?('.rb') || !File.directory?(config_file) unless File.file?(config_file) abort "The configuration file #{config_file} does not exist" end require(config_file) end ## # @return [Slop] # def self.default_options Slop.new(SLOP_OPTIONS.dup) do separator "\nOptions:\n" on :v, :version, 'Shows the current version' do puts CLI.version_information end end end ## # Returns a String containing some platform/version related information. # # @return [String] # def self.version_information "gemirro v#{VERSION} on #{RUBY_DESCRIPTION}" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gemirro-0.13.5 | lib/gemirro/cli.rb |
gemirro-0.13.4 | lib/gemirro/cli.rb |