stack_master 2.6.0 → 2.6.1

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
  SHA256:
3
- metadata.gz: 63302facbdeb077ecd02518f7f510e422430c15ed0f45e4a3f1049733251f83c
4
- data.tar.gz: 46e6906d9a181fdd8951bc51e8abc8527623c63cbf54484272a0e121d501e0fd
3
+ metadata.gz: 4f146a3b9b4ca20e6c3fdf98d3620886663ec113cb81f7d763918aad28d5d42c
4
+ data.tar.gz: c7ebfef287797cff8cbb1ee74bafcbe583da1eb14079ea4b94d2102fbc48ea18
5
5
  SHA512:
6
- metadata.gz: 4d40c6555edd8d53ded7d5609d4a83f92732439525d0c818f590ba34da7612868e43def422018b823f33bcd55b9f9c1d5c5a6cfb36f9773490d548be52176737
7
- data.tar.gz: 5baaef8cbc2fe706e112c773dad5a0fe174bed277a84c6decdad8ee6c9f984aa5023f5caaae7148eabf545225863c5548db66ce5f84d769338b7541b96e84898
6
+ metadata.gz: 45ca7571feb3989ba167eec7b7dc27ba3ed003aec6890e6c172c4ced6dc432fb29bcc618481880604783f02138ca644b17d9f329f73dcab81d73585104a768c9
7
+ data.tar.gz: dead78c859b1d6cda3148a045c99d31c116a2849ccb2112d231561ae708e619236e4951754d7cdeecf53e08dd68ce99f2f8e242f255c6a168257c6b7cdaec021
@@ -2,12 +2,18 @@ module StackMaster
2
2
  module TemplateUtils
3
3
  MAX_TEMPLATE_SIZE = 51200
4
4
  MAX_S3_TEMPLATE_SIZE = 460800
5
+ # Matches if the first non-whitespace character is a '{', handling cases
6
+ # with leading whitespace and extra (whitespace-only) lines.
7
+ JSON_IDENTIFICATION_PATTERN = Regexp.new('\A\s*{', Regexp::MULTILINE)
5
8
 
6
9
  extend self
7
10
 
8
11
  def identify_template_format(template_body)
9
- return :json if template_body =~ /^{/x # ignore leading whitespaces
10
- :yaml
12
+ if template_body =~ JSON_IDENTIFICATION_PATTERN
13
+ :json
14
+ else
15
+ :yaml
16
+ end
11
17
  end
12
18
 
13
19
  def template_hash(template_body=nil)
@@ -28,4 +34,4 @@ module StackMaster
28
34
  JSON.dump(template_hash(template_body))
29
35
  end
30
36
  end
31
- end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module StackMaster
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Hodgkiss
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-15 00:00:00.000000000 Z
12
+ date: 2020-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -539,8 +539,8 @@ licenses:
539
539
  metadata:
540
540
  bug_tracker_uri: https://github.com/envato/stack_master/issues
541
541
  changelog_uri: https://github.com/envato/stack_master/blob/master/CHANGELOG.md
542
- documentation_uri: https://www.rubydoc.info/gems/stack_master/2.6.0
543
- source_code_uri: https://github.com/envato/stack_master/tree/v2.6.0
542
+ documentation_uri: https://www.rubydoc.info/gems/stack_master/2.6.1
543
+ source_code_uri: https://github.com/envato/stack_master/tree/v2.6.1
544
544
  post_install_message:
545
545
  rdoc_options: []
546
546
  require_paths:
@@ -556,7 +556,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
556
556
  - !ruby/object:Gem::Version
557
557
  version: '0'
558
558
  requirements: []
559
- rubygems_version: 3.1.2
559
+ rubygems_version: 3.0.4
560
560
  signing_key:
561
561
  specification_version: 4
562
562
  summary: StackMaster is a sure-footed way of creating, updating and keeping track