lib/relish/commands/base.rb in relish-0.4.0 vs lib/relish/commands/base.rb in relish-0.5.0

- old
+ new

@@ -26,11 +26,11 @@ validate_cli_options end def url - "http://#{host}/api" + "https://#{host}/api" end def get_param @args.shift if @args.size.odd? end @@ -55,10 +55,11 @@ end def resource(options = {}) options[:user] ||= api_token options[:password] ||= 'X' + options[:headers] = { :client_version => Relish::Version::STRING } RestClient::Resource.new(url, options) end def clean_args(args) args.inject([]) {|cleaned, arg| cleaned << arg.sub('--', '') } @@ -68,11 +69,10 @@ Dsl::Option.names end def validate_cli_options cli_options.keys.each do |option| - unless valid_option_names.include?(option.to_s) error "'#{option}' is not a valid option." end end end @@ -105,6 +105,6 @@ CGI.escape(str) end end end -end \ No newline at end of file +end