diff options
| author | Zack Hobson | 2014-04-21 12:00:32 -0700 |
|---|---|---|
| committer | Zack Hobson | 2014-04-21 12:05:02 -0700 |
| commit | 4a26eafea9d3bf396d57b7fc79dcb02039a1dbfe (patch) | |
| tree | 5aebadcc488be0d47ffd767798635c3a25925d22 | |
| parent | 29400e82a6ac792a8b47bc567c7b57997718f8e1 (diff) | |
| download | hcl-4a26eafea9d3bf396d57b7fc79dcb02039a1dbfe.tar.bz2 | |
remove ssl option, fixes #57
| -rw-r--r-- | CHANGELOG.markdown | 4 | ||||
| -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 | ||||
| -rw-r--r-- | test/app_test.rb | 2 | ||||
| -rw-r--r-- | test/net_test.rb | 1 | ||||
| -rw-r--r-- | test/test_helper.rb | 3 |
7 files changed, 10 insertions, 10 deletions
diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index f4491dd..917f4cd 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,5 +1,9 @@ # Recent Changes in HCl +## next + +* remove the non-SSL option as it's no longer needed, closes #57 + ## v0.4.13 2014-02-04 * oops, fixed a syntax error that was accidentally committed before release! 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 diff --git a/test/app_test.rb b/test/app_test.rb index e6dbc3d..de10989 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -50,7 +50,7 @@ class AppTest < HCl::TestCase app = HCl::App.new configured = states('configured').starts_as(false) app.expects(:show).raises(HCl::HarvestMiddleware::AuthFailure).when(configured.is(false)) - app.expects(:ask).returns('xxx').times(4).when(configured.is(false)) + app.expects(:ask).returns('xxx').times(3).when(configured.is(false)) app.expects(:write_config).then(configured.is(true)) app.expects(:show).when(configured.is(true)) app.process_args('show').run diff --git a/test/net_test.rb b/test/net_test.rb index 94e5ad4..8d967e5 100644 --- a/test/net_test.rb +++ b/test/net_test.rb @@ -6,7 +6,6 @@ class NetTest < HCl::TestCase assert_equal 'bob', http.login assert_equal 'secret', http.password assert_equal 'bobclock', http.subdomain - assert_equal true, http.ssl end def test_http_deep_unescape diff --git a/test/test_helper.rb b/test/test_helper.rb index 273c5c4..95cb0b4 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -35,8 +35,7 @@ class HCl::TestCase < MiniTest::Test @http = HCl::Net.new \ 'login' => 'bob', 'password' => 'secret', - 'subdomain' => 'bobclock', - 'ssl' => true + 'subdomain' => 'bobclock' end def register_uri method, path, data={} |
