dumbwaiter 0.2.0 → 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: 2b69c9d7f2e7d25bd322771b407638c70b5dccef
4
- data.tar.gz: 3a5d98c4fe4ddd7e8e3f59b8be15a8e8b94c948f
3
+ metadata.gz: a4577f08a2e6de50e816eb41d34df1a9cdf899ba
4
+ data.tar.gz: 851c7468dfbbf4a81496e1236b7ef0db84c238a3
5
5
  SHA512:
6
- metadata.gz: cf1781076eba107b32d03a11e278e03fb429c413ff639999f818ed99d2bee98c51d84f11871d12fd6bee13e403d3b45b50d95f53cd088e8a31ab4a8f1a4289de
7
- data.tar.gz: 4cf716ba54f720ac5670c4eec82cdcbbd97a3cba26d8db3eacb208be52a9a45477cad4a3f54970f8895a7e69c70f514f715bd599c2346e6450eb61e4fa2acfca
6
+ metadata.gz: 6f293f9c4c362a4b68a8d17bd2ea90c57862bf61ea844549dad0ee0b9b1f1e4e196d0a3242cd444c7acff393e4a7c410606fda097cad32ddac5d8a97d6720b8e
7
+ data.tar.gz: a31062467cee5a12324b454654774de259a99ab6ae0d28b55f7851f702f9fee8709e4aff21afeb32a5a8a0debe31a0b4e5d0833a7d38b28a9ddd06c13abea5ba
data/README.md CHANGED
@@ -36,6 +36,10 @@ List the deployments on the "Maniacal Checklist" stack:
36
36
 
37
37
  `dumbwaiter list "Maniacal Checklist"`
38
38
 
39
+ List the stacks and apps in your OpsWorks environment:
40
+
41
+ `dumbwaiter stacks`
42
+
39
43
 
40
44
  Contributing
41
45
  ------------
@@ -37,5 +37,10 @@ module Dumbwaiter
37
37
  rescue Dumbwaiter::Stack::NotFound => e
38
38
  raise Thor::Error.new(e.message)
39
39
  end
40
+
41
+ desc "stacks", "List all the stacks"
42
+ def stacks
43
+ Stack.all.each { |stack| Kernel.puts("#{stack.name}: #{stack.apps.map(&:name).join(', ')}") }
44
+ end
40
45
  end
41
46
  end
@@ -3,8 +3,8 @@ require "dumbwaiter/deployment_custom_json"
3
3
  class Dumbwaiter::Deployment
4
4
  attr_reader :opsworks_deployment
5
5
 
6
- def self.all(stack_id, opsworks = Aws::OpsWorks.new(region: "us-east-1"))
7
- opsworks.describe_deployments(stack_id: stack_id).deployments.map { |d| new(d) }
6
+ def self.all(stack, opsworks = Aws::OpsWorks.new(region: "us-east-1"))
7
+ opsworks.describe_deployments(stack_id: stack.id).deployments.map { |d| new(d) }
8
8
  end
9
9
 
10
10
  def initialize(opsworks_deployment)
@@ -30,10 +30,10 @@ class Dumbwaiter::Stack
30
30
  end
31
31
 
32
32
  def apps
33
- @apps ||= Dumbwaiter::App.all(id, opsworks)
33
+ @apps ||= Dumbwaiter::App.all(self, opsworks)
34
34
  end
35
35
 
36
36
  def deployments
37
- @deployments ||= Dumbwaiter::Deployment.all(id, opsworks)
37
+ @deployments ||= Dumbwaiter::Deployment.all(self, opsworks)
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module Dumbwaiter
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Dumbwaiter::Cli do
4
- let(:fake_stack) { double(:stack, name: "ducks", id: "wat") }
5
4
  let(:fake_app) { double(:app, name: "reifel") }
5
+ let(:fake_stack) { double(:stack, name: "ducks", id: "wat", apps: [fake_app]) }
6
6
 
7
7
  subject(:cli) { Dumbwaiter::Cli.new }
8
8
 
@@ -52,9 +52,7 @@ describe Dumbwaiter::Cli do
52
52
 
53
53
  context "when the stack does not exist" do
54
54
  it "blows up" do
55
- expect {
56
- cli.rollback("maple syrup", "reifel")
57
- }.to raise_error(Thor::Error)
55
+ expect { cli.rollback("maple syrup", "reifel") }.to raise_error(Thor::Error)
58
56
  end
59
57
  end
60
58
  end
@@ -93,10 +91,15 @@ describe Dumbwaiter::Cli do
93
91
 
94
92
  context "when the stack does not exist" do
95
93
  it "blows up" do
96
- expect {
97
- cli.list("wat")
98
- }.to raise_error(Thor::Error)
94
+ expect { cli.list("wat") }.to raise_error(Thor::Error)
99
95
  end
100
96
  end
101
97
  end
98
+
99
+ describe "#stacks" do
100
+ it "lists the stacks" do
101
+ Kernel.should_receive(:puts).with("ducks: reifel")
102
+ cli.stacks
103
+ end
104
+ end
102
105
  end
@@ -37,9 +37,10 @@ describe Dumbwaiter::Deployment do
37
37
  end
38
38
 
39
39
  describe ".all" do
40
+ let(:fake_stack) { double(:stack, id: "pancakes") }
40
41
  it "fetches all the deployments" do
41
42
  fake_opsworks.should_receive(:describe_deployments).with(stack_id: "pancakes")
42
- Dumbwaiter::Deployment.all("pancakes", fake_opsworks).should have(1).app
43
+ Dumbwaiter::Deployment.all(fake_stack, fake_opsworks).should have(1).app
43
44
  end
44
45
  end
45
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumbwaiter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doc Ritezel