ey-pro-cli 0.0.10 → 0.0.11

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: bdcb5d58754c356a886b61cfb4c76b206e2e2c37
4
- data.tar.gz: c46cd11202f0ece0718cf2c7e7a758c8bdf8e311
3
+ metadata.gz: defe6750674ddd946f92182eee60783585e8e50d
4
+ data.tar.gz: 968dab5bdcc881322578fc950f3dfe47769af676
5
5
  SHA512:
6
- metadata.gz: 7506c5287842faaf5bf52709799224c430879653302f78b77ea6898bca5011a28e7e30c18db31b88502f2a7ff77350bab2169b4945f5e909f2183ae69eec1283
7
- data.tar.gz: 71780323f597b33b4576fe2e09c0af720119cbf6184203bb075ae8ad69a959a4821fa6f5d7169394f7d4d1def975078856f4a2d7faea24f62dac6f739105e32d
6
+ metadata.gz: 400884f9613419bccb16c1c03296eaaee46817a1ef9971af11af12d288bb4999661bfc8322841b17cb54ec898e604d713ab9e30d52fbe5498b67945a25276c5a
7
+ data.tar.gz: e456158c4115f0f56ac3ec2a98956e0ac852b9967c21d737fd7f69e736a84c62158c62eafb9def4af1a5bb0bb0e21f1c56025c4569378051bd624eaaadde46ec
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ey-pro-cli (0.0.9)
4
+ ey-pro-cli (0.0.10)
5
5
  addressable (~> 2.2)
6
6
  cistern (~> 0.11, >= 0.11.1)
7
7
  colorize
@@ -12,8 +12,6 @@ require File.expand_path(File.dirname(__FILE__) + '/ey_pro_cli/version')
12
12
  require File.expand_path(File.dirname(__FILE__) + '/vendor/core/ey-core')
13
13
 
14
14
  class EyProCli < Thor
15
- class InvalidEnvironment < RuntimeError; end
16
-
17
15
  class << self
18
16
  attr_accessor :core_file
19
17
 
@@ -80,8 +78,18 @@ class EyProCli < Thor
80
78
 
81
79
  def deploy
82
80
  check_for_updates unless options["no-update-check"]
83
- unless environment = core_environment_for(options)
84
- abort "Unable to locate environment #{options[:environment]} in #{options[:account]}".red
81
+ operator, environment = core_operator_and_environment_for(options)
82
+ unless operator.is_a?(Ey::Core::Client)
83
+ abort <<-EOF
84
+ Found account #{operator.name} but requested account #{options[:account]}.
85
+ Use the ID of the account instead of the name.
86
+ This can be retrieved by running "ey-pro accounts".
87
+ EOF
88
+ .red unless operator.name == options[:account] || operator.id == options[:account]
89
+ end
90
+
91
+ unless environment
92
+ abort "Unable to locate environment #{options[:environment]} in #{operator.name}".red
85
93
  end
86
94
  app = core_application_for(options)
87
95
 
@@ -167,8 +175,8 @@ Current Version: #{current_version}
167
175
  options[:account] ? core_account_for(options) : core_client
168
176
  end
169
177
 
170
- def core_environment_for(options={})
171
- operator(options).environments.first(name: options[:environment])
178
+ def core_operator_and_environment_for(options={})
179
+ [operator(options), operator(options).environments.first(name: options[:environment])]
172
180
  end
173
181
 
174
182
  def core_application_for(options={})
@@ -1,3 +1,3 @@
1
1
  module EyProCliVersion
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey-pro-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Engine Yard Cloud Team