cloudformer 0.0.11 → 0.0.12
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.
- checksums.yaml +4 -4
- data/cloudformer.gemspec +1 -0
- data/lib/cloudformer/stack.rb +4 -3
- data/lib/cloudformer/version.rb +1 -1
- data/spec/stack_spec.rb +42 -0
- metadata +20 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1a3ea4d7e5a5d60b004184dea02fa6f7b59647a5
         | 
| 4 | 
            +
              data.tar.gz: a8a98dabb72b72f68f4fdb2cd0596acd8472af97
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e612cfe8276f8a1a7e50a73bc900a7801de0a35f35341d57806bc566efcd497feca88ffbc3e0a43ad5bae5e5aab12c28f41080057d69629a6a4d98c375936b34
         | 
| 7 | 
            +
              data.tar.gz: 7678c2787bcc2c423285c0261a9293f8bc4f368a4e78a57b96697cea5eefb4d8e27832a018e717e6f8e5f1b475ddf52b1627278ab2f7e2be3e605c6e6f2736fa
         | 
    
        data/cloudformer.gemspec
    CHANGED
    
    
    
        data/lib/cloudformer/stack.rb
    CHANGED
    
    | @@ -76,7 +76,7 @@ class Stack | |
| 76 76 | 
             
                    return
         | 
| 77 77 | 
             
                  end
         | 
| 78 78 | 
             
                  stack.events.sort_by {|a| a.timestamp}.each do |event|
         | 
| 79 | 
            -
                    puts "#{event.timestamp} - #{event.logical_resource_id} - #{event.resource_type} - #{event.resource_status} - #{event.resource_status_reason.to_s}"
         | 
| 79 | 
            +
                    puts "#{event.timestamp} - #{event.physical_resource_id.to_s} - #{event.logical_resource_id} - #{event.resource_type} - #{event.resource_status} - #{event.resource_status_reason.to_s}"
         | 
| 80 80 | 
             
                  end
         | 
| 81 81 | 
             
                end
         | 
| 82 82 | 
             
              end
         | 
| @@ -105,14 +105,15 @@ class Stack | |
| 105 105 | 
             
              private
         | 
| 106 106 | 
             
              def wait_until_end
         | 
| 107 107 | 
             
                printed = []
         | 
| 108 | 
            +
                current_time = Time.now
         | 
| 108 109 | 
             
                with_highlight do
         | 
| 109 110 | 
             
                  if !deployed
         | 
| 110 111 | 
             
                    puts "Stack not up."
         | 
| 111 112 | 
             
                    return
         | 
| 112 113 | 
             
                  end
         | 
| 113 114 | 
             
                  loop do
         | 
| 114 | 
            -
                    printable_events = stack.events.sort_by {|a| a.timestamp}.reject {|a| a if printed.include?(a.event_id)}
         | 
| 115 | 
            -
                    printable_events.each { |event| puts "#{event.timestamp} - #{event.resource_type} - #{event.resource_status} - #{event.resource_status_reason.to_s}" }
         | 
| 115 | 
            +
                    printable_events = stack.events.reject{|a| (a.timestamp < current_time)}.sort_by {|a| a.timestamp}.reject {|a| a if printed.include?(a.event_id)}
         | 
| 116 | 
            +
                    printable_events.each { |event| puts "#{event.timestamp} - #{event.physical_resource_id.to_s} - #{event.resource_type} - #{event.resource_status} - #{event.resource_status_reason.to_s}" }
         | 
| 116 117 | 
             
                    printed.concat(printable_events.map(&:event_id))
         | 
| 117 118 | 
             
                    break if END_STATES.include?(stack.status)
         | 
| 118 119 | 
             
                    sleep(30)
         | 
    
        data/lib/cloudformer/version.rb
    CHANGED
    
    
    
        data/spec/stack_spec.rb
    ADDED
    
    | @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            require 'cloudformer/stack'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe Stack do
         | 
| 4 | 
            +
              before :each do
         | 
| 5 | 
            +
                @cf = double(AWS::CloudFormation)
         | 
| 6 | 
            +
                @cf_stack = double(AWS::CloudFormation::Stack)
         | 
| 7 | 
            +
                @collection = double(AWS::CloudFormation::StackCollection)
         | 
| 8 | 
            +
                AWS::CloudFormation.should_receive(:new).and_return(@cf)
         | 
| 9 | 
            +
                @collection.should_receive(:[]).and_return(@cf_stack)
         | 
| 10 | 
            +
                @cf.should_receive(:stacks).and_return(@collection)
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
              describe "when deployed" do
         | 
| 13 | 
            +
                before :each do
         | 
| 14 | 
            +
                  @stack = Stack.new("stack")
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                it "should report as the stack being deployed" do
         | 
| 18 | 
            +
                  @cf_stack.should_receive(:exists?).and_return(true)
         | 
| 19 | 
            +
                  @stack.deployed.should be
         | 
| 20 | 
            +
                end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                describe "#delete" do
         | 
| 23 | 
            +
                  it "should return a true if delete fails" do
         | 
| 24 | 
            +
                    pending
         | 
| 25 | 
            +
                    @cf_stack.should_receive(:exists?).and_return(false)
         | 
| 26 | 
            +
                    @cf_stack.should_receive(:status)
         | 
| 27 | 
            +
                    @stack.delete.should be
         | 
| 28 | 
            +
                  end
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
              describe "when stack is not deployed" do
         | 
| 33 | 
            +
                before :each do
         | 
| 34 | 
            +
                  @stack = Stack.new("stack")
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                it "should report as the stack not being deployed" do
         | 
| 38 | 
            +
                  @cf_stack.should_receive(:exists?).and_return(false)
         | 
| 39 | 
            +
                  @stack.deployed.should_not be
         | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
              end
         | 
| 42 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cloudformer
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.12
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Arvind Kunday
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2014-08-16 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -38,6 +38,20 @@ dependencies: | |
| 38 38 | 
             
                - - '>='
         | 
| 39 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 40 | 
             
                    version: '0'
         | 
| 41 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              name: rspec
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - '>='
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: '0'
         | 
| 48 | 
            +
              type: :development
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - '>='
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '0'
         | 
| 41 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 56 | 
             
              name: rake
         | 
| 43 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -86,6 +100,7 @@ files: | |
| 86 100 | 
             
            - lib/cloudformer/version.rb
         | 
| 87 101 | 
             
            - samples/Rakefile
         | 
| 88 102 | 
             
            - samples/basic_template.json
         | 
| 103 | 
            +
            - spec/stack_spec.rb
         | 
| 89 104 | 
             
            homepage: https://github.com/kunday/cloudformer
         | 
| 90 105 | 
             
            licenses:
         | 
| 91 106 | 
             
            - MIT
         | 
| @@ -106,10 +121,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 106 121 | 
             
                  version: '0'
         | 
| 107 122 | 
             
            requirements: []
         | 
| 108 123 | 
             
            rubyforge_project: 
         | 
| 109 | 
            -
            rubygems_version: 2. | 
| 124 | 
            +
            rubygems_version: 2.2.2
         | 
| 110 125 | 
             
            signing_key: 
         | 
| 111 126 | 
             
            specification_version: 4
         | 
| 112 127 | 
             
            summary: Cloudformer attempts to simplify AWS Cloudformation stack creation process
         | 
| 113 128 | 
             
              in ruby projects by providing reusable rake tasks to perform common operations such
         | 
| 114 129 | 
             
              as apply(create/update), delete, recreate on stack along with validations on templates.
         | 
| 115 | 
            -
            test_files: | 
| 130 | 
            +
            test_files:
         | 
| 131 | 
            +
            - spec/stack_spec.rb
         |