lono 7.0.4 → 7.0.5

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: 51a04aa19c67011e6f32ba9e032f439d281820a97e2ad41c6187aa4aa55971be
4
- data.tar.gz: ad2e51a8917fb855e6e7e5cbf230b3445f3d0a1bd9bae478c78189a4ac6b14fe
3
+ metadata.gz: 978e40e7263ef0cc011601eec42c5581e580c4bc7c74feea55658776d2f60f61
4
+ data.tar.gz: b8ef03d604d0145577c58a9b2aef532d7e0ac033145bba7b56e5182314f2fef6
5
5
  SHA512:
6
- metadata.gz: 01caf3e4f07a635acffb67a8a437b6714af1bace864f5ddf016b49aecef0e90b2c5fe387e693adc5e5f91fcea34b7ee8428c9bd2f39ea27779a578ea812c51b8
7
- data.tar.gz: 539801feb80ed5fc8e8fe8cb97b012ef9e5fbd7bb172497380a7808abcbb99def14b0ff221c6470ca3fcf9713f41ec3829e9df26fd74ea126b98baa95edc8490
6
+ metadata.gz: 6df32378a05c9d8279cafb2f6e379b39bfdc3aba799371c1fafd7318fcd1d68aed09f75a01817723b3de2852917d3e7ac9b1c5cec86a2617aa19d56a814a82ab
7
+ data.tar.gz: 02c7f8fc999daecb2a87889123ce49ced93cc72bdbf0ff2e6b9d1880ea40fa2e8d5d565229d941dee0c746d829f5dd841fc084f41aa42f04392386214d35a722
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [7.0.5]
7
+ - #41 sort parameter with required at top
8
+
6
9
  ## [7.0.4]
7
10
  - #40 fix lono summary total
8
11
 
@@ -15,7 +15,12 @@ module Lono::Output
15
15
  end
16
16
 
17
17
  def parameters
18
- data["Parameters"] || []
18
+ list = data["Parameters"] || []
19
+ # Not using sort_parameter_group because structure is different
20
+ list.sort_by do |name, data|
21
+ optional = !data["Default"].nil?
22
+ [optional, name].join('-')
23
+ end.to_h
19
24
  end
20
25
 
21
26
  def parameter_groups
@@ -23,9 +28,9 @@ module Lono::Output
23
28
  return unless interface
24
29
  pgs = interface["ParameterGroups"]
25
30
  pgs.inject({}) do |result, pg|
26
- k = pg["Label"]["default"]
27
- v = pg["Parameters"]
28
- result.merge(k => v)
31
+ label = pg["Label"]["default"]
32
+ parameters = sort_parameter_group(pg["Parameters"])
33
+ result.merge(label => parameters)
29
34
  end
30
35
  end
31
36
 
@@ -37,6 +42,15 @@ module Lono::Output
37
42
  memoize :data
38
43
 
39
44
  private
45
+ def sort_parameter_group(list)
46
+ list.sort_by do |name|
47
+ raw_parameters = data["Parameters"] || []
48
+ param = raw_parameters[name]
49
+ optional = !param["Default"].nil?
50
+ [optional, name].join('-')
51
+ end
52
+ end
53
+
40
54
  # Check if the template exists and print friendly error message. Exits if it
41
55
  # does not exist.
42
56
  def check_template_exists!(template_path)
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "7.0.4"
2
+ VERSION = "7.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.4
4
+ version: 7.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -717,8 +717,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
717
717
  - !ruby/object:Gem::Version
718
718
  version: '0'
719
719
  requirements: []
720
- rubyforge_project:
721
- rubygems_version: 2.7.6.2
720
+ rubygems_version: 3.1.2
722
721
  signing_key:
723
722
  specification_version: 4
724
723
  summary: The CloudFormation Framework