autostacker24 2.5.1 → 2.6.0
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 +4 -4
- data/bin/autostacker24 +20 -9
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5060871b0994fa6b788507e1613aa95fda045059
         | 
| 4 | 
            +
              data.tar.gz: 0f46c2f43bf01522c8942abb718e431ef2a6d6ac
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 131bc460dc4aa5ee92bc2239235b11d1293ec05bcd37756da074045831ee6d04a8014347a8ffe1dd2b70e5657742d69ff86e8a0545318469e93fc54470d6daf4
         | 
| 7 | 
            +
              data.tar.gz: 706faddbb9db962d1dfa9d6e522e3e7bc8fd0fa890cc2c5efbdc8b24d2c57c5401902c4652d270c9d806809d488b7ad166cdbccfe20f0dbc08237f0b5b9a2e46
         | 
    
        data/bin/autostacker24
    CHANGED
    
    | @@ -17,6 +17,16 @@ def check_stack(args) | |
| 17 17 | 
             
              error('--stack name missing') unless args.stack
         | 
| 18 18 | 
             
            end
         | 
| 19 19 |  | 
| 20 | 
            +
            def json?(data)
         | 
| 21 | 
            +
              data =~ /\A((\s*\{)|(\s*\/{2}))/
         | 
| 22 | 
            +
            end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            def load_file(path)
         | 
| 25 | 
            +
              error('params file not found') unless File.exists?(path)
         | 
| 26 | 
            +
              data = File.read(path)
         | 
| 27 | 
            +
              json?(data) ? JSON.parse(data) : YAML.load(data)
         | 
| 28 | 
            +
            end
         | 
| 29 | 
            +
             | 
| 20 30 | 
             
            args = OpenStruct.new
         | 
| 21 31 | 
             
            args.region = ENV['AWS_REGION']
         | 
| 22 32 | 
             
            args.params = {}
         | 
| @@ -32,14 +42,15 @@ parser = OptionParser.new do |opts| | |
| 32 42 | 
             
              opts.separator "\tconvert    convert template to and from YAML"
         | 
| 33 43 | 
             
              opts.separator ''
         | 
| 34 44 | 
             
              opts.separator 'Options:'
         | 
| 35 | 
            -
              opts.on('--template TEMPLATE', 'Path to template') | 
| 36 | 
            -
              opts.on('--stack STACK',       'Name of stack') | 
| 37 | 
            -
              opts.on('--parent PARENT',     'Name of parent stack') | 
| 38 | 
            -
              opts.on('--region REGION',     'AWS region') | 
| 39 | 
            -
              opts.on('--profile PROFILE',   'AWS profile (use aws configure)') | 
| 40 | 
            -
              opts.on('--param KEY=VALUE',   'Stack Parameter') | 
| 41 | 
            -
              opts.on('-- | 
| 42 | 
            -
              opts.on('-- | 
| 45 | 
            +
              opts.on('--template TEMPLATE', 'Path to template')                    {|v| args.template = v}
         | 
| 46 | 
            +
              opts.on('--stack STACK',       'Name of stack')                       {|v| args.stack = v}
         | 
| 47 | 
            +
              opts.on('--parent PARENT',     'Name of parent stack')                {|v| args.parent = v}
         | 
| 48 | 
            +
              opts.on('--region REGION',     'AWS region')                          {|v| args.region = v}
         | 
| 49 | 
            +
              opts.on('--profile PROFILE',   'AWS profile (use aws configure)')     {|v| args.profile = v}
         | 
| 50 | 
            +
              opts.on('--param KEY=VALUE',   'Stack Parameter')                     {|v| args.params.store(*v.split('=')) }
         | 
| 51 | 
            +
              opts.on('--params FILE',       'Stack Parameter from yaml/json file') {|v| args.params.merge!(load_file(v)) }
         | 
| 52 | 
            +
              opts.on('--help',              'Show this help')                      {|_| puts opts; exit!;}
         | 
| 53 | 
            +
              opts.on('--version',           'Show version')                        {|_| puts `gem list autostacker24`; exit!;}
         | 
| 43 54 | 
             
              opts.separator ''
         | 
| 44 55 | 
             
            end
         | 
| 45 56 | 
             
            USAGE = parser.to_s
         | 
| @@ -77,7 +88,7 @@ case args.command | |
| 77 88 | 
             
              when /convert/
         | 
| 78 89 | 
             
                check_template(args)
         | 
| 79 90 | 
             
                template = File.read(args.template)
         | 
| 80 | 
            -
                if template | 
| 91 | 
            +
                if json?(template)
         | 
| 81 92 | 
             
                  puts JSON.parse(template).to_yaml.sub('---', '# AutoStacker24 CloudFormation YAML Template')
         | 
| 82 93 | 
             
                else
         | 
| 83 94 | 
             
                  puts '// AutoStacker24 CloudFormation JSON Template '
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: autostacker24
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2. | 
| 4 | 
            +
              version: 2.6.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Johannes Mueller
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 12 | 
            +
            date: 2017-02-23 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: aws-sdk-core
         | 
| @@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 135 135 | 
             
                  version: '0'
         | 
| 136 136 | 
             
            requirements: []
         | 
| 137 137 | 
             
            rubyforge_project: 
         | 
| 138 | 
            -
            rubygems_version: 2. | 
| 138 | 
            +
            rubygems_version: 2.6.8
         | 
| 139 139 | 
             
            signing_key: 
         | 
| 140 140 | 
             
            specification_version: 4
         | 
| 141 141 | 
             
            summary: Library for managing AWS CloudFormation stacks
         |