ec2ctl 0.2.1 → 0.3.0

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: 0e4a046decad3ab2df808adaea9129e07346d845
4
- data.tar.gz: d528215a84ffd08f93b8291bedf25134a718bb43
3
+ metadata.gz: 4df29493cff643f1d82abd4a17966045b45711c8
4
+ data.tar.gz: d784a70c73241be6e1bae60da0618ae243f96e59
5
5
  SHA512:
6
- metadata.gz: dcbb012ad056a2722b2eddb464685445abdcc57818777ae4c9feeaa1bab16fbc819775a6be34a55302e5f5edd179ad9071ee97f4b223885b3d38b3438b3e90f7
7
- data.tar.gz: 40043510835deaa311fea57638458b676ab2747d126658927267b087ae4a14cf78c3b486d9775520f2fe2c7f9d1690d5e362a5ae88c9c1d9a9f46956fe955176
6
+ metadata.gz: a59cf5b83691524bc9fd3fdadb89be06abd848eff5ebfaafd6c200df387118430ad246f5ed6d967ea357c62880646d86a09c831b60b3759f8ebfae81c1d43c03
7
+ data.tar.gz: 064507a78bc569a4832e6467b2cb55a4b46296934571c5b70948772bdd5e9b998996a291bc18a634101571f2cb79b98981d43da31eca0018c267b6a7fe247453
data/ec2ctl.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "colorize"
25
25
  spec.add_dependency "terminal-table"
26
26
  spec.add_dependency "unindent"
27
+ spec.add_dependency "aws_config"
27
28
 
28
29
  spec.add_development_dependency "bundler", "~> 1.5"
29
30
  spec.add_development_dependency "rake"
@@ -1,3 +1,3 @@
1
1
  module Ec2ctl
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/ec2ctl.rb CHANGED
@@ -8,6 +8,7 @@ require "colorize"
8
8
  require "terminal-table"
9
9
  require "timeout"
10
10
  require "unindent"
11
+ require "aws_config"
11
12
 
12
13
  module Ec2ctl
13
14
  class CLI < Thor
@@ -162,10 +163,17 @@ module Ec2ctl
162
163
  hash = {}
163
164
 
164
165
  if options[:profile]
165
- provider = AWS::Core::CredentialProviders::SharedCredentialFileProvider.new profile_name: options[:profile]
166
- hash.update credential_provider: provider
166
+ config = AWSConfig.profiles[options[:profile]]
167
+
168
+ if config
169
+ hash.update config.config_hash
170
+ else
171
+ provider = AWS::Core::CredentialProviders::SharedCredentialFileProvider.new profile_name: options[:profile]
172
+ hash.update credential_provider: provider
173
+ end
167
174
  else
168
- hash.update access_key_id: options[:access_key_id], secret_access_key: options[:secret_access_key] if options[:access_key_id] && options[:secret_access_key]
175
+ hash.update access_key_id: options[:access_key_id] if options[:access_key_id]
176
+ hash.update secret_access_key: options[:secret_access_key] if options[:secret_access_key]
169
177
  end
170
178
 
171
179
  hash.update region: options[:region] if options[:region]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2ctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - y13i
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-08 00:00:00.000000000 Z
11
+ date: 2014-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: aws_config
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: bundler
99
113
  requirement: !ruby/object:Gem::Requirement