diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl/app.rb | 3 | ||||
| -rw-r--r-- | lib/hcl/harvest_middleware.rb | 2 | ||||
| -rw-r--r-- | lib/hcl/net.rb | 5 |
3 files changed, 4 insertions, 6 deletions
diff --git a/lib/hcl/app.rb b/lib/hcl/app.rb index 0585dac..0cda7b4 100644 --- a/lib/hcl/app.rb +++ b/lib/hcl/app.rb @@ -169,7 +169,6 @@ EOM config['login'] = ask("Email Address: ").to_s config['password'] = ask("Password: ") { |q| q.echo = false }.to_s config['subdomain'] = ask("Subdomain: ").to_s - config['ssl'] = /^y/.match(ask("Use SSL? (y/n): ").downcase) @http = HCl::Net.new config write_config config end @@ -209,7 +208,7 @@ EOM end def has_security_command? - if @has_security.nil? + if @has_security.nil? @has_security = File.exists?('/usr/bin/security') && (`/usr/bin/security error 1` =~ /CSSM_ERRCODE_INTERNAL_ERROR/) else diff --git a/lib/hcl/harvest_middleware.rb b/lib/hcl/harvest_middleware.rb index 5129c55..da728e4 100644 --- a/lib/hcl/harvest_middleware.rb +++ b/lib/hcl/harvest_middleware.rb @@ -25,7 +25,7 @@ class HCl::HarvestMiddleware < Faraday::Request::BasicAuthentication env[:body] end when 300..399 - raise Failure, "Redirected! Perhaps your ssl configuration variable is set incorrectly?" + raise Failure, "Redirected!" when 400..499 raise AuthFailure, "Login failed." when 503 diff --git a/lib/hcl/net.rb b/lib/hcl/net.rb index dd73528..730e5b4 100644 --- a/lib/hcl/net.rb +++ b/lib/hcl/net.rb @@ -4,7 +4,7 @@ require 'faraday' module HCl class Net # configuration accessors - CONFIG_VARS = [ :login, :password, :subdomain, :ssl ].freeze. + CONFIG_VARS = [ :login, :password, :subdomain ].freeze. each { |config_var| attr_reader config_var } def config_hash @@ -15,9 +15,8 @@ module HCl @login = opts['login'].freeze @password = opts['password'].freeze @subdomain = opts['subdomain'].freeze - @ssl = !!opts['ssl'] @http = Faraday.new( - "http#{ssl ? 's' : '' }://#{subdomain}.harvestapp.com" + "https://#{subdomain}.harvestapp.com" ) do |f| f.use :harvest, login, password f.adapter Faraday.default_adapter |
