tddium-preview 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tddium-preview (0.6.4)
4
+ tddium-preview (0.6.6)
5
5
  bundler
6
6
  highline
7
7
  json
@@ -3,5 +3,5 @@ Copyright (c) 2011 Solano Labs All Rights Reserved
3
3
  =end
4
4
 
5
5
  module TddiumVersion
6
- VERSION = "0.6.5"
6
+ VERSION = "0.6.6"
7
7
  end
data/lib/tddium.rb CHANGED
@@ -448,10 +448,10 @@ class Tddium < Thor
448
448
  def handle_heroku_user(options, heroku_config)
449
449
  api_key = heroku_config['TDDIUM_API_KEY']
450
450
  user = tddium_client.call_api(:get, Api::Path::USERS, {}, api_key) rescue nil
451
- if user && user["user"]["heroku_needs_activation"] != true
452
- say Text::Status::HEROKU_CONFIG
453
- elsif user
454
- say Text::Process::HEROKU_WELCOME % heroku_config['TDDIUM_USER_NAME']
451
+ exit_failure Text::Error::HEROKU_MISCONFIGURED % "Unrecognized user" unless user
452
+ say Text::Process::HEROKU_WELCOME % heroku_config['TDDIUM_USER_NAME']
453
+
454
+ if user["user"]["heroku_needs_activation"] == true
455
455
  params = get_user_credentials(:email => heroku_config['TDDIUM_USER_NAME'])
456
456
  params.delete(:email)
457
457
  params[:password_confirmation] = HighLine.ask(Text::Prompt::PASSWORD_CONFIRMATION) { |q| q.echo = "*" }
@@ -460,16 +460,15 @@ class Tddium < Thor
460
460
  begin
461
461
  user_id = user["user"]["id"]
462
462
  result = tddium_client.call_api(:put, "#{Api::Path::USERS}/#{user_id}/", {:user=>params, :heroku_activation=>true}, api_key)
463
- write_api_key(user["user"]["api_key"])
464
- say Text::Status::HEROKU_CONFIG
465
463
  rescue TddiumClient::Error::API => e
466
464
  exit_failure Text::Error::HEROKU_MISCONFIGURED % e
467
465
  rescue TddiumClient::Error::Base => e
468
466
  exit_failure Text::Error::HEROKU_MISCONFIGURED % e
469
467
  end
470
- else
471
- exit_failure Text::Error::HEROKU_MISCONFIGURED % "Unrecognized user"
472
468
  end
469
+
470
+ write_api_key(user["user"]["api_key"])
471
+ say Text::Status::HEROKU_CONFIG
473
472
  end
474
473
 
475
474
  def login_user(options = {})
data/spec/tddium_spec.rb CHANGED
@@ -591,6 +591,8 @@ describe Tddium do
591
591
  tddium.should_receive(:say).with(Tddium::Text::Status::HEROKU_CONFIG)
592
592
  run_heroku(tddium)
593
593
  end
594
+
595
+ it_should_behave_like "writing the api key to the .tddium file"
594
596
  end
595
597
  end
596
598
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: tddium-preview
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.5
5
+ version: 0.6.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Solano Labs