dumbwaiter 0.3.7 → 0.3.8

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: ec68f942f090e118446193ea9e09a487b8ee9a28
4
- data.tar.gz: 320549f6150e7669651a360e85f3c95c2cdaa09f
3
+ metadata.gz: cc87b1fc30c12a2faa171507be7097579ec077dc
4
+ data.tar.gz: f7a84fbb84d7d2a5c8bf25293c33474066c2584f
5
5
  SHA512:
6
- metadata.gz: b8907d4f70064b119f597ac078ad0453ce3e2bfadec40b15062a69b254ea5d2515d3c40c4fb9b82f7988b1a30db93666ecd02079349f203c0aebd8e20b9d6dd6
7
- data.tar.gz: f3664d5fed012c8e7dd47458713deb03fd8f4ff7f40d4ad3bcc83fba17b0bf15eee76fea70088891cb525102e1dea0d0ecf01f1104e6502818a625e2297fdf91
6
+ metadata.gz: dd91d3446ecd0fffc7aa82d1647c304ad6d654f54d427c2e79cd39ccb32b97d8d7f54f3e96dd413d2d24aebbe5187cc184ce1af43b54e01cb3bfcbefcbce6303
7
+ data.tar.gz: 828d4537a6ad2758c77c2027ab6ec880878a1bde305137ce7c922a4bbc23e23b6928dd6d875cd60dac0388f0fe10d34b060fbb4944572407946e92a2aed685a5
@@ -12,11 +12,17 @@ class Dumbwaiter::Stack
12
12
  end
13
13
 
14
14
  def self.find(stack_name, opsworks = Aws::OpsWorks.new(region: "us-east-1"))
15
- stack = all(opsworks).detect { |stack| stack.name == stack_name}
15
+ stack = all(opsworks).detect { |stack| stack.name == stack_name }
16
16
  raise NotFound.new("No stack found with name #{stack_name}") if stack.nil?
17
17
  stack
18
18
  end
19
19
 
20
+ def self.find_by_id(stack_id, opsworks = Aws::OpsWorks.new(region: "us-east-1"))
21
+ stack = all(opsworks).detect { |stack| stack.id == stack_id }
22
+ raise NotFound.new("No stack found with id #{stack_id}") if stack.nil?
23
+ stack
24
+ end
25
+
20
26
  def initialize(opsworks_stack, opsworks = Aws::OpsWorks.new(region: "us-east-1"))
21
27
  @opsworks = opsworks
22
28
  @opsworks_stack = opsworks_stack
@@ -1,3 +1,3 @@
1
1
  module Dumbwaiter
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
@@ -47,6 +47,22 @@ describe Dumbwaiter::Stack do
47
47
  end
48
48
  end
49
49
 
50
+ describe ".find_by_id" do
51
+ context "when the stack exists" do
52
+ it "finds the stack by name" do
53
+ Dumbwaiter::Stack.find_by_id("cool", fake_opsworks).name.should == "ducks"
54
+ end
55
+ end
56
+
57
+ context "when the stack does not exist" do
58
+ it "blows up" do
59
+ expect {
60
+ Dumbwaiter::Stack.find_by_id("teeth", fake_opsworks)
61
+ }.to raise_error(Dumbwaiter::Stack::NotFound)
62
+ end
63
+ end
64
+ end
65
+
50
66
  describe "#rechef" do
51
67
  it "creates a deployment" do
52
68
  fake_opsworks.should_receive(:create_deployment) do |params|
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.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doc Ritezel