bora 0.4.0 → 0.5.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: a349da3ebed4f64052d4a5b74892d4feb71e7eb6
4
- data.tar.gz: 5296d29a1a94ea5f06e074a371b92d9a8ab4a573
3
+ metadata.gz: 901afe63c123cadd7b17d88b366c08562c409be8
4
+ data.tar.gz: 2c8fc06901e2b08b06963e5a40fcd80bafb2f4be
5
5
  SHA512:
6
- metadata.gz: 8b796073ac1b278b8bca0f566e58a257b6bd237666098afae5db59ed7b2b98c2f037ad937ad4298a1eb333a837a1212e40c1ec43d7cb0091d37f65b1a5d5c15f
7
- data.tar.gz: 325690df797b3c33366ba289fcb2a73a388f1d7f441ae7c8f7c139daa0a19816cbfa4ae6f7430284c74070f479efb9e6fc320f6c723fddce2f4cf9b22ae6321e
6
+ metadata.gz: 610ef15f8900ae1fefde24a898e11beb7443e82f20aecb89492615b000a41dc0534893987442e82d2a7efaf5def54efcf5d2677973e044e308bcdd257326b7b1
7
+ data.tar.gz: 0ffffcd3bedc51a9ba1e246cb7546e4ff29f7c2d38ba5a92f82e779123e5767e886ec15f4895d04de8ce9cf5d501c6415c34717299033ac663e86de0cf5e1f22
data/README.md CHANGED
@@ -45,7 +45,7 @@ rake stack:example:delete # Deletes the 'example' stack
45
45
  rake stack:example:diff # Diffs the new template with the 'example' stack's current template
46
46
  rake stack:example:events # Outputs the latest events from the 'example' stack
47
47
  rake stack:example:new_template # Shows the new template for 'example' stack
48
- rake stack:test:outputs # Shows the outputs from the 'example' stack
48
+ rake stack:example:outputs # Shows the outputs from the 'example' stack
49
49
  rake stack:example:recreate # Recreates (deletes then creates) the 'example' stack
50
50
  rake stack:example:status # Displays the current status of the 'example' stack
51
51
  rake stack:example:validate # Checks the 'example' stack's template for validity
data/lib/bora/event.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'colorize'
2
1
  require 'bora/status'
3
2
 
4
3
  module Bora
@@ -24,9 +23,9 @@ module Bora
24
23
  status_success? || status_failure?
25
24
  end
26
25
 
27
- def to_s(colorize = true)
26
+ def to_s
28
27
  status_reason = @event.resource_status_reason ? " - #{@event.resource_status_reason}" : ""
29
- "#{@event.timestamp.getlocal} - #{@event.resource_type} - #{@event.logical_resource_id} - #{@status.to_s(colorize)}#{status_reason}"
28
+ "#{@event.timestamp.getlocal} - #{@event.resource_type} - #{@event.logical_resource_id} - #{@status}#{status_reason}"
30
29
  end
31
30
  end
32
31
  end
@@ -17,10 +17,10 @@ module Bora
17
17
  @status && @status.success?
18
18
  end
19
19
 
20
- def to_s(colorize = true)
20
+ def to_s
21
21
  if @stack
22
22
  status_reason = @stack.stack_status_reason ? " - #{@stack.stack_status_reason}" : ""
23
- "#{@stack.stack_name} - #{@status.to_s(colorize)}#{status_reason}"
23
+ "#{@stack.stack_name} - #{@status}#{status_reason}"
24
24
  else
25
25
  "Stack does not exist"
26
26
  end
data/lib/bora/status.rb CHANGED
@@ -22,8 +22,8 @@ module Bora
22
22
  success? || failure?
23
23
  end
24
24
 
25
- def to_s(colorize = true)
26
- colorize ? @status.colorize(color) : @status
25
+ def to_s
26
+ @status.colorize(color)
27
27
  end
28
28
 
29
29
 
data/lib/bora/tasks.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'colorize'
1
2
  require 'rake/tasklib'
2
3
  require 'bora/stack'
3
4
 
@@ -11,7 +12,12 @@ module Bora
11
12
  define_tasks
12
13
  end
13
14
 
14
- attr_accessor :stack_options, :colorize
15
+ attr_writer :stack_options
16
+
17
+ def colorize=(value)
18
+ @colorize = value
19
+ String.disable_colorization = !@colorize
20
+ end
15
21
 
16
22
  private
17
23
 
@@ -32,7 +38,12 @@ module Bora
32
38
  within_namespace do
33
39
  desc "Creates (or updates) the '#{@stack_name}' stack"
34
40
  task :apply do
35
- invoke_action(@stack.exists? ? "update" : "create", stack_options)
41
+ invoke_action(@stack.exists? ? "update" : "create", @stack_options)
42
+ outputs = @stack.outputs
43
+ if outputs && outputs.length > 0
44
+ puts "Stack outputs"
45
+ outputs.each { |output| puts output }
46
+ end
36
47
  end
37
48
  end
38
49
  end
@@ -116,7 +127,7 @@ module Bora
116
127
  within_namespace do
117
128
  desc "Recreates (deletes then creates) the '#{@stack_name}' stack"
118
129
  task :recreate do
119
- invoke_action("recreate", stack_options)
130
+ invoke_action("recreate", @stack_options)
120
131
  end
121
132
  end
122
133
  end
@@ -134,14 +145,14 @@ module Bora
134
145
  within_namespace do
135
146
  desc "Checks the '#{@stack_name}' stack's template for validity"
136
147
  task :validate do
137
- puts "Template for stack '#{@stack_name}' is valid" if @stack.validate(stack_options)
148
+ puts "Template for stack '#{@stack_name}' is valid" if @stack.validate(@stack_options)
138
149
  end
139
150
  end
140
151
  end
141
152
 
142
153
  def invoke_action(action, *args)
143
154
  puts "#{action.capitalize} stack '#{@stack_name}'"
144
- success = @stack.send(action, *args) { |event| puts event.to_s(colorize) }
155
+ success = @stack.send(action, *args) { |event| puts event }
145
156
  if success
146
157
  puts "#{action.capitalize} stack '#{@stack_name}' completed successfully"
147
158
  else
data/lib/bora/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bora
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Blaxland
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-19 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk