lib/cloudstack-cli/base.rb in cloudstack-cli-1.3.0 vs lib/cloudstack-cli/base.rb in cloudstack-cli-1.3.1

- old
+ new

@@ -34,20 +34,10 @@ # exit with return code 1 in case of a error def self.exit_on_failure? true end - # fix for subcommand help issues - # see https://github.com/erikhuda/thor/issues/261 - # def self.banner(command, namespace = nil, subcommand = false) - # "#{basename} #{subcommand_prefix} #{command.usage}" - # end - # - # def self.subcommand_prefix - # self.name.gsub(%r{.*::}, '').gsub(%r{^[A-Z]}) { |match| match[0].downcase }.gsub(%r{[A-Z]}) { |match| "-#{match[0].downcase}" } - # end - no_commands do def client @config ||= load_configuration @client ||= CloudstackClient::Client.new( @config[:url], @@ -80,11 +70,11 @@ end end unless config.key?(:url) && config.key?(:api_key) && config.key?(:secret_key) say "The environment #{env || '\'-\''} contains no valid data.", :red - say "Please check with 'cs environment list' and set a valid default environment." + say "Please check with 'cloudstack-cli environment list' and set a valid default environment." exit 1 end config end @@ -93,10 +83,10 @@ end def parse_file(file, extensions = %w(.json .yaml .yml)) handler = case File.extname(file) when ".json" - Object.const_get "JSON" + Object.const_get "MultiJson" when ".yaml", ".yml" Object.const_get "YAML" else say "File extension #{File.extname(file)} not supported. Supported extensions are #{extensions.join(', ')}", :red exit