Sha256: b3e54dcfc7cf5f2310f51b7fac865604c73cf39153060f44892cc7437c422791
Contents?: true
Size: 845 Bytes
Versions: 24
Compression:
Stored size: 845 Bytes
Contents
module Localeapp module CLI class Command def initialize(args = {}) initialize_config(args) @output = args[:output] || $stdout end # requires the Localeapp configuration def initialize_config(args = {}) Localeapp.configure # load defaults load_config_file set_command_line_arguments(args) end def set_command_line_arguments(args = {}) sanitized_args = {} if args[:k] sanitized_args[:api_key] = args[:k] end sanitized_args.each do |setting, value| Localeapp.configuration.send("#{setting}=", value) end end def load_config_file Localeapp.default_config_file_paths.each do |path| next unless File.exist? path require path end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems