tugboat 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/tugboat/cli.rb CHANGED
@@ -101,11 +101,11 @@ module Tugboat
101
101
  :aliases => "-n",
102
102
  :desc => "The exact name of the droplet"
103
103
  def destroy(name=nil)
104
- Middleware.sequence_destroy_droplet.call({
105
- "user_droplet_id" => options[:id],
106
- "user_droplet_name" => options[:name],
107
- "user_droplet_fuzzy_name" => name
108
- })
104
+ Middleware.sequence_destroy_droplet.call({
105
+ "user_droplet_id" => options[:id],
106
+ "user_droplet_name" => options[:name],
107
+ "user_droplet_fuzzy_name" => name
108
+ })
109
109
  end
110
110
 
111
111
  desc "restart FUZZY_NAME", "Restart a droplet"
@@ -135,11 +135,11 @@ module Tugboat
135
135
  :aliases => "-n",
136
136
  :desc => "The exact name of the droplet"
137
137
  def halt(name=nil)
138
- Middleware.sequence_halt_droplet.call({
139
- "user_droplet_id" => options[:id],
140
- "user_droplet_name" => options[:name],
141
- "user_droplet_fuzzy_name" => name
142
- })
138
+ Middleware.sequence_halt_droplet.call({
139
+ "user_droplet_id" => options[:id],
140
+ "user_droplet_name" => options[:name],
141
+ "user_droplet_fuzzy_name" => name
142
+ })
143
143
  end
144
144
 
145
145
  desc "info FUZZY_NAME [OPTIONS]", "Show a droplet's information"
@@ -152,11 +152,11 @@ module Tugboat
152
152
  :aliases => "-n",
153
153
  :desc => "The exact name of the droplet"
154
154
  def info(name=nil)
155
- Middleware.sequence_info_droplet.call({
156
- "user_droplet_id" => options[:id],
157
- "user_droplet_name" => options[:name],
158
- "user_droplet_fuzzy_name" => name
159
- })
155
+ Middleware.sequence_info_droplet.call({
156
+ "user_droplet_id" => options[:id],
157
+ "user_droplet_name" => options[:name],
158
+ "user_droplet_fuzzy_name" => name
159
+ })
160
160
  end
161
161
 
162
162
  desc "snapshot FUZZY_NAME [OPTIONS]", "Queue a snapshot of the droplet."
@@ -173,12 +173,12 @@ module Tugboat
173
173
  :aliases => "-s",
174
174
  :desc => "The name of the snapshot"
175
175
  def snapshot(name=nil, snapshot_name)
176
- Middleware.sequence_snapshot_droplet.call({
177
- "user_droplet_id" => options[:id],
178
- "user_droplet_name" => options[:name],
179
- "user_droplet_fuzzy_name" => name,
180
- "user_snapshot_name" => snapshot_name
181
- })
176
+ Middleware.sequence_snapshot_droplet.call({
177
+ "user_droplet_id" => options[:id],
178
+ "user_droplet_name" => options[:name],
179
+ "user_droplet_fuzzy_name" => name,
180
+ "user_snapshot_name" => snapshot_name
181
+ })
182
182
  end
183
183
  end
184
184
  end
@@ -23,11 +23,16 @@ module Tugboat
23
23
  # Easy for us if they provide an id. Just set it to the droplet_id
24
24
  if user_droplet_id
25
25
  say "Droplet id provided. Finding Droplet...", nil, false
26
- droplet = ocean.droplets.show user_droplet_id
26
+ req = ocean.droplets.show user_droplet_id
27
27
 
28
- env["droplet_id"] = droplet.id
29
- env["droplet_name"] = "(#{droplet.name})"
30
- env["droplet_ip"] = droplet.ip_address
28
+ if req.status == "ERROR"
29
+ say "#{req.status}: #{req.error_message}", :red
30
+ return
31
+ end
32
+
33
+ env["droplet_id"] = req.droplet.id
34
+ env["droplet_name"] = "(#{req.droplet.name})"
35
+ env["droplet_ip"] = req.droplet.ip_address
31
36
  end
32
37
 
33
38
  # If they provide a name, we need to get the ID for it.
@@ -1,3 +1,3 @@
1
1
  module Tugboat
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tugboat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-14 00:00:00.000000000 Z
12
+ date: 2013-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor