aptible-cli 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbd1a99a074329111416cc6042119a612e96c1fd
4
- data.tar.gz: 46878ca824d93febc861413bc6056cd5e6c3f192
3
+ metadata.gz: 02cb684565a0efb38b9a81bfe8e528288db946d8
4
+ data.tar.gz: 5cbc7f790a2a8049c74a44a95761e5d5eb42b68b
5
5
  SHA512:
6
- metadata.gz: ee9758afa9efc13d889335e8eb2b0a1af14bd1ab7b46173a50747704f7704308ad4f8b945603ffc438ba1f6b895ca206ccc792dbc193c3f24406b1a7dc69c55c
7
- data.tar.gz: ceac32714758bd087b689c684a1924a46e391a559cd711e27ccfeb626d4b487a8215c23af1ed6e29f703b93c8d4093bde0804f5208188b1519414344afce0a5f
6
+ metadata.gz: 77f9d47520ffcdc4c2bec46a6691eda79cd8236f503b5488923217e66b147e8591f6edab81bc174c8ed7681b864a6acee3595344746494ca91acafb55aa5689e
7
+ data.tar.gz: a3fc0f4e2808a7d7bd96eebb7dcef1805df1a2f4d194116d9dadb14447dd07daba76797cf855301cedeade3fab33c4d1177ee080b949e56596eba8fe59ee8e20
@@ -24,9 +24,11 @@ module Aptible
24
24
  end
25
25
 
26
26
  desc 'login', 'Log in to Aptible'
27
+ option :email
28
+ option :password
27
29
  def login
28
- email = ask('Email: ')
29
- password = ask('Password: ', echo: false)
30
+ email = options[:email] || ask('Email: ')
31
+ password = options[:password] || ask('Password: ', echo: false)
30
32
  puts ''
31
33
 
32
34
  begin
@@ -9,9 +9,8 @@ module Aptible
9
9
  def poll_for_success(operation)
10
10
  puts 'Updating configuration and restarting app...'
11
11
  wait_for_completion operation
12
- unless operation.status == 'succeeded'
13
- fail Thor::Error, 'Operation failed: please check logs'
14
- end
12
+ return if operation.status == 'succeeded'
13
+ fail Thor::Error, 'Operation failed: please check logs'
15
14
  end
16
15
 
17
16
  def wait_for_completion(operation)
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module CLI
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
5
5
  end
@@ -29,5 +29,12 @@ describe Aptible::CLI::Agent do
29
29
  subject.login
30
30
  end.to raise_error 'Could not authenticate with given credentials'
31
31
  end
32
+
33
+ it 'should use command line arguments if passed' do
34
+ options = { email: 'test@example.com', password: 'password' }
35
+ subject.stub(:options) { options }
36
+ expect(Aptible::Auth::Token).to receive(:create).with(options) { token }
37
+ subject.login
38
+ end
32
39
  end
33
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-api