stacker 0.3.1 → 0.4.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: 91202089e64bdd467ec3288b44808b940ee77220
4
- data.tar.gz: 71ec100286d1c8b162a7b6fcafdea3a7575940e8
3
+ metadata.gz: ee70d019619b3105e087cd13603eef0f32ce234e
4
+ data.tar.gz: de0606601b47c370a90196e59d81c1bbe9c870d2
5
5
  SHA512:
6
- metadata.gz: fcae84b9dd316bb9691b73c4bcd022ed0fd052d0d57bb320171d1c542f5bfd18dab90c5731d2665f4c6ed43d267bfb279b9d372550032ef2b24fbad00a965e3c
7
- data.tar.gz: d686c5fcaf9386c1fc045a3e245c82f3eca41b330d1f3251108c86307b0a04f6f4a854c12bbefd8cfc718820c20c0fdd612b7177102826dc0e6518aad3e25a6e
6
+ metadata.gz: f2549d8f9d28c551055be54ca26afd054c6a933244a26b96492011dfafe9dc4fe8572482d7ecd84d59f23747d596748d4cb4675edfed78e78a8bb6dd4ac4a905
7
+ data.tar.gz: 4b1503839d320111ec4bc469ea090f60d9626a7cb2e08871da5c9ad60fbd9bcaabab5232f609683b83cc24a00b8206756dca5f7382177ba838bc2aa584f8f36b
@@ -3,6 +3,7 @@ require 'active_support/core_ext/hash/slice'
3
3
  require 'active_support/core_ext/module/delegation'
4
4
  require 'aws-sdk'
5
5
  require 'memoist'
6
+ require 'stacker/stack/errors'
6
7
  require 'stacker/stack/capabilities'
7
8
  require 'stacker/stack/parameters'
8
9
  require 'stacker/stack/template'
@@ -10,12 +11,6 @@ require 'stacker/stack/template'
10
11
  module Stacker
11
12
  class Stack
12
13
 
13
- class Error < StandardError; end
14
- class StackPolicyError < Error; end
15
- class DoesNotExistError < Error; end
16
- class MissingParameters < Error; end
17
- class UpToDateError < Error; end
18
-
19
14
  extend Memoist
20
15
 
21
16
  CLIENT_METHODS = %w[
@@ -0,0 +1,41 @@
1
+ require 'jsonlint'
2
+
3
+ module Stacker
4
+ class Stack
5
+
6
+ class Error < StandardError; end
7
+ class StackPolicyError < Error; end
8
+ class DoesNotExistError < Error; end
9
+ class MissingParameters < Error; end
10
+ class UpToDateError < Error; end
11
+
12
+ class TemplateSyntaxError < Error
13
+
14
+ def initialize(path)
15
+ @path = path
16
+ end
17
+
18
+ def message
19
+ <<END_MSG
20
+ Syntax error(s) in template.
21
+ #{path}:
22
+ #{errors}
23
+ END_MSG
24
+ end
25
+
26
+ private
27
+
28
+ attr_reader :path
29
+
30
+ def errors
31
+ @errors ||= begin
32
+ linter = JsonLint::Linter.new
33
+ linter.check path
34
+ linter.errors.values.join "\n"
35
+ end
36
+ end
37
+
38
+ end
39
+
40
+ end
41
+ end
@@ -2,6 +2,7 @@ require 'active_support/core_ext/string/inflections'
2
2
  require 'json'
3
3
  require 'memoist'
4
4
  require 'stacker/differ'
5
+ require 'stacker/stack'
5
6
  require 'stacker/stack/component'
6
7
 
7
8
  module Stacker
@@ -26,6 +27,8 @@ module Stacker
26
27
  {}
27
28
  end
28
29
  end
30
+ rescue JSON::ParserError
31
+ raise TemplateSyntaxError.new path
29
32
  end
30
33
 
31
34
  def remote
@@ -1,3 +1,3 @@
1
1
  module Stacker
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cotap, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-08 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: jsonlint
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 0.2.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 0.2.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: memoist
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -166,6 +180,7 @@ files:
166
180
  - lib/stacker/resolver.rb
167
181
  - lib/stacker/stack/capabilities.rb
168
182
  - lib/stacker/stack/component.rb
183
+ - lib/stacker/stack/errors.rb
169
184
  - lib/stacker/stack/parameters.rb
170
185
  - lib/stacker/stack/template.rb
171
186
  - lib/stacker/stack.rb