lib/embedly/command_line.rb in embedly-1.2.0 vs lib/embedly/command_line.rb in embedly-1.3.0
- old
+ new
@@ -30,11 +30,12 @@
def default
{
:key => ENV['EMBEDLY_KEY'],
:secret => ENV['EMBEDLY_SECRET'],
:headers => {},
- :query => {}
+ :query => {},
+ :typhoeus => true
}
end
def reject_nil!
options.reject! { |_, opt| opt.nil? }
@@ -83,10 +84,14 @@
parser.on("-o", "--option NAME=VALUE", "Set option to be passed as query param.") do |option|
key, value = option.split('=')
options[:query][key.to_sym] = value
end
+ parser.on("--no-typhoeus", "Don't use typhoeus.") do
+ Embedly.configuration.typhoeus = false
+ end
+
parser.separator ""
parser.separator "Common Options:"
parser.on("-v", "--[no-]verbose", "Run verbosely") do |verbose|
Embedly.configuration.debug = verbose
@@ -119,8 +124,9 @@
Embedly::API.new(api_options).send(endpoint, query)
end
def options
@options = Parser.parse!(@args.dup)
+ @options
end
end
end