lib/embedly/command_line.rb in embedly-1.5.4 vs lib/embedly/command_line.rb in embedly-1.5.5
- old
+ new
@@ -1,8 +1,14 @@
require "optparse"
-Embedly.configuration.typhoeus = true
+begin
+ require "typhoeus"
+ Embedly.configuration.typhoeus = true
+rescue LoadError
+ Embedly.configuration.typhoeus = false
+end
+
module Embedly
class CommandLine
class Parser
attr_accessor :options
@@ -33,10 +39,10 @@
:key => ENV['EMBEDLY_KEY'],
:secret => ENV['EMBEDLY_SECRET'],
:timeout => nil,
:headers => {},
:query => {},
- :typhoeus => true
+ :typhoeus => Embedly.configuration.typhoeus
}
end
def reject_nil!
options.reject! { |_, opt| opt.nil? }