stackup 1.1.2 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20ef7c568fc7e9522f584971713e2785e26628d7
4
- data.tar.gz: ddc63cb469f6749a0880f9a048b2a35f110b6971
3
+ metadata.gz: 8d9136bd380d1644176d3b65c7ee93315016d455
4
+ data.tar.gz: ea8bdd9c6766e6f581557073a2afb5134efd3902
5
5
  SHA512:
6
- metadata.gz: 8d4f8835951cdbb655038217a10abb3fb1ae590341efd4bd9ee07e2cdb1108d00251752773fc951e32f6b99ae7b59e8c144e53a14b54452c42f815f716fbf5da
7
- data.tar.gz: f745669e927ef53ffe51855a84b63ecd58b7428761db198b4a1508016ed81bcb2b2fe40e7358e2d364ed5fc8a99ba665581278ca6c7e7d646be9f9ed1d9d6284
6
+ metadata.gz: 3f9a13acc03300f01506f109ae336c794e49753ef592e630462faa89fa39f6e858e43fe56c33c3c03c59ded1132e063a1eb7c2431005b674ee6f43d39a6749d4
7
+ data.tar.gz: 48b38607b8e0ee0015ab1fd81e049e62c9b53ab7338b005be51e15a9fcf8e573bbde69cd9352fec2688111ae2c1b60492234dacaed56d25cfdab9bfaa2610dde
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.1.3 (2017-05-01)
2
+
3
+ * Fix #39: parse error when JSON-like text is embedded in YAML.
4
+
1
5
  ## 1.1.1 (2017-02-23)
2
6
 
3
7
  * The `stackup` CLI now allows stack template and policy documents to be specified as URLs.
@@ -29,6 +29,8 @@ module Stackup
29
29
 
30
30
  private
31
31
 
32
+ LOOKS_LIKE_JSON = /\A\s*[\{\[]/
33
+
32
34
  def uri
33
35
  URI(location)
34
36
  end
@@ -50,11 +52,13 @@ module Stackup
50
52
  end
51
53
 
52
54
  def parse_body
53
- begin
54
- MultiJson.load(body)
55
- rescue MultiJson::ParseError
56
- Stackup::YAML.load(body)
57
- end
55
+ if body =~ LOOKS_LIKE_JSON
56
+ # Psych has issues parsing some JSON, so let's use a JSON parser.
57
+ # (see https://github.com/realestate-com-au/stackup/issues/35)
58
+ MultiJson.load(body)
59
+ else
60
+ Stackup::YAML.load(body)
61
+ end
58
62
  end
59
63
 
60
64
  class ReadError < StandardError
@@ -1,5 +1,5 @@
1
1
  module Stackup
2
2
 
3
- VERSION = "1.1.2"
3
+ VERSION = "1.1.3"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-10 00:00:00.000000000 Z
12
+ date: 2017-05-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-resources