piculet 0.2.9.beta → 0.2.9.beta2
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/README.md +44 -0
 - data/bin/piculet +20 -4
 - data/lib/piculet/client.rb +30 -31
 - data/lib/piculet/dsl/ec2.rb +6 -2
 - data/lib/piculet/dsl/permission.rb +9 -1
 - data/lib/piculet/dsl/permissions.rb +4 -2
 - data/lib/piculet/dsl/security-group.rb +6 -3
 - data/lib/piculet/dsl.rb +18 -5
 - data/lib/piculet/logger.rb +2 -1
 - data/lib/piculet/template-helper.rb +20 -0
 - data/lib/piculet/utils.rb +17 -0
 - data/lib/piculet/version.rb +1 -1
 - data/lib/piculet/wrapper/security-group.rb +1 -1
 - data/lib/piculet.rb +5 -0
 - metadata +49 -19
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: ef643aaca63e3788b2a8564c9a1745a838ad7fb1
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: cde74196414708bf85fd941e333cfcb6130efa37
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 0a0115ee9795c828186c31f2a90065a791e3655dbabe142ba8c578e5876b0f4968f6bbc572e9ca4894c9cc95a842bddf97a0a26da1e8d5f1f6cfb9cebcd52ef1
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b145ff246f344b220beedfb4ad017592639e4331320ba1825d49e59acfcf06b212ce1f30be9dae89b53563aa3c11cfb709ef1acde68408d38c3c95a7022fa3d0
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -7,6 +7,14 @@ It defines the state of EC2 Security Group using DSL, and updates EC2 Security G 
     | 
|
| 
       7 
7 
     | 
    
         
             
            [](http://badge.fury.io/rb/piculet)
         
     | 
| 
       8 
8 
     | 
    
         
             
            [](https://travis-ci.org/winebarrel/piculet)
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
      
 10 
     | 
    
         
            +
            ## Notice
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            * `>= 0.2.9`
         
     | 
| 
      
 13 
     | 
    
         
            +
              * Add ip/group duplicate check [PR#16](https://github.com/winebarrel/piculet/pull/16)
         
     | 
| 
      
 14 
     | 
    
         
            +
              * Add `--exclude-tags` option [PR#17](https://github.com/winebarrel/piculet/pull/18)
         
     | 
| 
      
 15 
     | 
    
         
            +
              * Support Template
         
     | 
| 
      
 16 
     | 
    
         
            +
              * Add `--split-more` option
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
       10 
18 
     | 
    
         
             
            ## Installation
         
     | 
| 
       11 
19 
     | 
    
         | 
| 
       12 
20 
     | 
    
         
             
            Add this line to your application's Gemfile:
         
     | 
| 
         @@ -48,11 +56,13 @@ Usage: piculet [options] 
     | 
|
| 
       48 
56 
     | 
    
         
             
                -f, --file FILE
         
     | 
| 
       49 
57 
     | 
    
         
             
                -n, --names SG_LIST
         
     | 
| 
       50 
58 
     | 
    
         
             
                -x, --exclude SG_LIST
         
     | 
| 
      
 59 
     | 
    
         
            +
                -t, --exclude-tags TAG_LIST
         
     | 
| 
       51 
60 
     | 
    
         
             
                    --ec2s VPC_IDS
         
     | 
| 
       52 
61 
     | 
    
         
             
                    --dry-run
         
     | 
| 
       53 
62 
     | 
    
         
             
                -e, --export
         
     | 
| 
       54 
63 
     | 
    
         
             
                -o, --output FILE
         
     | 
| 
       55 
64 
     | 
    
         
             
                    --split
         
     | 
| 
      
 65 
     | 
    
         
            +
                    --split-more
         
     | 
| 
       56 
66 
     | 
    
         
             
                    --format=FORMAT
         
     | 
| 
       57 
67 
     | 
    
         
             
                    --no-color
         
     | 
| 
       58 
68 
     | 
    
         
             
                    --debug
         
     | 
| 
         @@ -169,6 +179,40 @@ ec2 "vpc-XXXXXXXX" do 
     | 
|
| 
       169 
179 
     | 
    
         
             
            end
         
     | 
| 
       170 
180 
     | 
    
         
             
            ```
         
     | 
| 
       171 
181 
     | 
    
         | 
| 
      
 182 
     | 
    
         
            +
            ## Use Template
         
     | 
| 
      
 183 
     | 
    
         
            +
             
     | 
| 
      
 184 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 185 
     | 
    
         
            +
            template "basic" do
         
     | 
| 
      
 186 
     | 
    
         
            +
              permission :tcp, 22..22 do
         
     | 
| 
      
 187 
     | 
    
         
            +
                ip_ranges(
         
     | 
| 
      
 188 
     | 
    
         
            +
                  "0.0.0.0/0",
         
     | 
| 
      
 189 
     | 
    
         
            +
                )
         
     | 
| 
      
 190 
     | 
    
         
            +
              end
         
     | 
| 
      
 191 
     | 
    
         
            +
            end
         
     | 
| 
      
 192 
     | 
    
         
            +
             
     | 
| 
      
 193 
     | 
    
         
            +
            template "egress" do
         
     | 
| 
      
 194 
     | 
    
         
            +
              egress do
         
     | 
| 
      
 195 
     | 
    
         
            +
                permission :any do
         
     | 
| 
      
 196 
     | 
    
         
            +
                  ip_ranges(
         
     | 
| 
      
 197 
     | 
    
         
            +
                    context.ip_addr || "0.0.0.0/0"
         
     | 
| 
      
 198 
     | 
    
         
            +
                  )
         
     | 
| 
      
 199 
     | 
    
         
            +
                end
         
     | 
| 
      
 200 
     | 
    
         
            +
              end
         
     | 
| 
      
 201 
     | 
    
         
            +
            end
         
     | 
| 
      
 202 
     | 
    
         
            +
             
     | 
| 
      
 203 
     | 
    
         
            +
            ec2 "vpc-XXXXXXXX" do
         
     | 
| 
      
 204 
     | 
    
         
            +
              security_group "default" do
         
     | 
| 
      
 205 
     | 
    
         
            +
                description "default VPC security group"
         
     | 
| 
      
 206 
     | 
    
         
            +
             
     | 
| 
      
 207 
     | 
    
         
            +
                ingress do
         
     | 
| 
      
 208 
     | 
    
         
            +
                  include_template "basic"
         
     | 
| 
      
 209 
     | 
    
         
            +
                end
         
     | 
| 
      
 210 
     | 
    
         
            +
             
     | 
| 
      
 211 
     | 
    
         
            +
                include_template "egress", :ip_addr => "192.168.0.0/24"
         
     | 
| 
      
 212 
     | 
    
         
            +
              end
         
     | 
| 
      
 213 
     | 
    
         
            +
            end
         
     | 
| 
      
 214 
     | 
    
         
            +
            ```
         
     | 
| 
      
 215 
     | 
    
         
            +
             
     | 
| 
       172 
216 
     | 
    
         
             
            ## JSON Groupfile
         
     | 
| 
       173 
217 
     | 
    
         | 
| 
       174 
218 
     | 
    
         
             
            ```json
         
     | 
    
        data/bin/piculet
    CHANGED
    
    | 
         @@ -40,11 +40,13 @@ ARGV.options do |opt| 
     | 
|
| 
       40 
40 
     | 
    
         
             
                opt.on('-f', '--file FILE')                     {|v| file                         = v           }
         
     | 
| 
       41 
41 
     | 
    
         
             
                opt.on('-n', '--names SG_LIST', Array)          {|v| options[:sg_names]           = v           }
         
     | 
| 
       42 
42 
     | 
    
         
             
                opt.on('-x', '--exclude SG_LIST', Array)        {|v| options[:exclude_sgs]        = v           }
         
     | 
| 
      
 43 
     | 
    
         
            +
                opt.on('-t', '--exclude-tags TAGS_LIST', Array) {|v| options[:exclude_tags]       = v           }
         
     | 
| 
       43 
44 
     | 
    
         
             
                opt.on('',   '--ec2s VPC_IDS', Array)           {|v| options[:ec2s]               = v           }
         
     | 
| 
       44 
45 
     | 
    
         
             
                opt.on('',   '--dry-run')                       {|v| options[:dry_run]            = true        }
         
     | 
| 
       45 
46 
     | 
    
         
             
                opt.on('-e', '--export')                        {|v| mode                         = :export     }
         
     | 
| 
       46 
47 
     | 
    
         
             
                opt.on('-o', '--output FILE')                   {|v| output_file                  = v           }
         
     | 
| 
       47 
48 
     | 
    
         
             
                opt.on('',   '--split')                         {|v| split                        = true        }
         
     | 
| 
      
 49 
     | 
    
         
            +
                opt.on('',   '--split-more')                    {|v| split                        = :more       }
         
     | 
| 
       48 
50 
     | 
    
         
             
                opt.on('',   '--format=FORMAT', [:ruby, :json]) {|v| format_passed = true; options[:format] = v }
         
     | 
| 
       49 
51 
     | 
    
         
             
                opt.on(''  , '--no-color')                      {    options[:color]              = false       }
         
     | 
| 
       50 
52 
     | 
    
         
             
                opt.on(''  , '--debug')                         {    options[:debug]              = true        }
         
     | 
| 
         @@ -107,11 +109,10 @@ begin 
     | 
|
| 
       107 
109 
     | 
    
         | 
| 
       108 
110 
     | 
    
         
             
                  output_file = 'Groupfile' if output_file == '-'
         
     | 
| 
       109 
111 
     | 
    
         
             
                  requires = []
         
     | 
| 
      
 112 
     | 
    
         
            +
                  base_dir = File.dirname(output_file)
         
     | 
| 
       110 
113 
     | 
    
         | 
| 
       111 
114 
     | 
    
         
             
                  client.export(options.merge(:without_convert => options[:format] != :ruby)) do |exported, converter|
         
     | 
| 
       112 
     | 
    
         
            -
                     
     | 
| 
       113 
     | 
    
         
            -
                      group_file = File.join(File.dirname(output_file), "#{vpc || :classic}.group")
         
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
      
 115 
     | 
    
         
            +
                    write_group_file = proc do |group_file, vpc, security_groups|
         
     | 
| 
       115 
116 
     | 
    
         
             
                      if options[:format] == :json
         
     | 
| 
       116 
117 
     | 
    
         
             
                        group_file << '.json'
         
     | 
| 
       117 
118 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -119,6 +120,7 @@ begin 
     | 
|
| 
       119 
120 
     | 
    
         
             
                      requires << group_file
         
     | 
| 
       120 
121 
     | 
    
         | 
| 
       121 
122 
     | 
    
         
             
                      logger.info("  write `#{group_file}`")
         
     | 
| 
      
 123 
     | 
    
         
            +
                      FileUtils.mkdir_p(File.dirname(group_file))
         
     | 
| 
       122 
124 
     | 
    
         | 
| 
       123 
125 
     | 
    
         
             
                      open(group_file, 'wb') do |f|
         
     | 
| 
       124 
126 
     | 
    
         
             
                        if options[:format] == :json
         
     | 
| 
         @@ -129,6 +131,19 @@ begin 
     | 
|
| 
       129 
131 
     | 
    
         
             
                        end
         
     | 
| 
       130 
132 
     | 
    
         
             
                      end
         
     | 
| 
       131 
133 
     | 
    
         
             
                    end
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
                    exported.each do |vpc, security_groups|
         
     | 
| 
      
 136 
     | 
    
         
            +
                      if split == :more
         
     | 
| 
      
 137 
     | 
    
         
            +
                        security_groups.each do |sg_id, sg_attrs|
         
     | 
| 
      
 138 
     | 
    
         
            +
                          sg_name = sg_attrs.fetch(:name)
         
     | 
| 
      
 139 
     | 
    
         
            +
                          group_file = File.join(base_dir, vpc || 'classic', "#{sg_name}.group")
         
     | 
| 
      
 140 
     | 
    
         
            +
                          write_group_file.call(group_file, vpc, sg_id => sg_attrs)
         
     | 
| 
      
 141 
     | 
    
         
            +
                        end
         
     | 
| 
      
 142 
     | 
    
         
            +
                      else
         
     | 
| 
      
 143 
     | 
    
         
            +
                        group_file = File.join(base_dir, "#{vpc || :classic}.group")
         
     | 
| 
      
 144 
     | 
    
         
            +
                        write_group_file.call(group_file, vpc, security_groups)
         
     | 
| 
      
 145 
     | 
    
         
            +
                      end
         
     | 
| 
      
 146 
     | 
    
         
            +
                    end
         
     | 
| 
       132 
147 
     | 
    
         
             
                  end
         
     | 
| 
       133 
148 
     | 
    
         | 
| 
       134 
149 
     | 
    
         
             
                  if options[:format] == :ruby
         
     | 
| 
         @@ -138,7 +153,8 @@ begin 
     | 
|
| 
       138 
153 
     | 
    
         
             
                      f.puts MAGIC_COMMENT
         
     | 
| 
       139 
154 
     | 
    
         | 
| 
       140 
155 
     | 
    
         
             
                      requires.each do |group_file|
         
     | 
| 
       141 
     | 
    
         
            -
                         
     | 
| 
      
 156 
     | 
    
         
            +
                        group_file.sub!(%r|\A#{Regexp.escape base_dir}/?|, '')
         
     | 
| 
      
 157 
     | 
    
         
            +
                        f.puts "require '#{group_file}'"
         
     | 
| 
       142 
158 
     | 
    
         
             
                      end
         
     | 
| 
       143 
159 
     | 
    
         
             
                    end
         
     | 
| 
       144 
160 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/piculet/client.rb
    CHANGED
    
    | 
         @@ -13,6 +13,30 @@ module Piculet 
     | 
|
| 
       13 
13 
     | 
    
         
             
                  AWS.memoize { walk(file) }
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
      
 16 
     | 
    
         
            +
                def should_skip(sg_name, sg)
         
     | 
| 
      
 17 
     | 
    
         
            +
                  # Name
         
     | 
| 
      
 18 
     | 
    
         
            +
                  if @options.sg_names
         
     | 
| 
      
 19 
     | 
    
         
            +
                    if not @options.sg_names.include?(sg_name)
         
     | 
| 
      
 20 
     | 
    
         
            +
                      return true
         
     | 
| 
      
 21 
     | 
    
         
            +
                    end
         
     | 
| 
      
 22 
     | 
    
         
            +
                  end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                  if @options.exclude_sgs
         
     | 
| 
      
 25 
     | 
    
         
            +
                    if @options.exclude_sgs.any? {|regex| sg_name =~ regex}
         
     | 
| 
      
 26 
     | 
    
         
            +
                      return true
         
     | 
| 
      
 27 
     | 
    
         
            +
                    end
         
     | 
| 
      
 28 
     | 
    
         
            +
                  end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  # Tag
         
     | 
| 
      
 31 
     | 
    
         
            +
                  if @options.exclude_tags
         
     | 
| 
      
 32 
     | 
    
         
            +
                    if sg and @options.exclude_tags.any? {|tagname| not sg.tags.has_key?(tagname) }
         
     | 
| 
      
 33 
     | 
    
         
            +
                      return true
         
     | 
| 
      
 34 
     | 
    
         
            +
                    end
         
     | 
| 
      
 35 
     | 
    
         
            +
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                  false
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
       16 
40 
     | 
    
         
             
                def export(options = {})
         
     | 
| 
       17 
41 
     | 
    
         
             
                  exported = AWS.memoize do
         
     | 
| 
       18 
42 
     | 
    
         
             
                    Exporter.export(@options.ec2, @options_hash.merge(options))
         
     | 
| 
         @@ -97,17 +121,10 @@ module Piculet 
     | 
|
| 
       97 
121 
     | 
    
         | 
| 
       98 
122 
     | 
    
         
             
                  sg_list_dsl.each do |key, sg_dsl|
         
     | 
| 
       99 
123 
     | 
    
         
             
                    name = key[0]
         
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
                    if @options.sg_names
         
     | 
| 
       102 
     | 
    
         
            -
                      next unless @options.sg_names.include?(name)
         
     | 
| 
       103 
     | 
    
         
            -
                    end
         
     | 
| 
       104 
     | 
    
         
            -
             
     | 
| 
       105 
     | 
    
         
            -
                    if @options.exclude_sgs
         
     | 
| 
       106 
     | 
    
         
            -
                      next if @options.exclude_sgs.any? {|regex| name =~ regex}
         
     | 
| 
       107 
     | 
    
         
            -
                    end
         
     | 
| 
       108 
     | 
    
         
            -
             
     | 
| 
       109 
124 
     | 
    
         
             
                    sg_aws = sg_list_aws[key]
         
     | 
| 
       110 
125 
     | 
    
         | 
| 
      
 126 
     | 
    
         
            +
                    next if should_skip(name, sg_aws)
         
     | 
| 
      
 127 
     | 
    
         
            +
             
     | 
| 
       111 
128 
     | 
    
         
             
                    unless sg_aws
         
     | 
| 
       112 
129 
     | 
    
         
             
                      sg_aws = collection_api.create(name, :vpc => vpc, :description => sg_dsl.description)
         
     | 
| 
       113 
130 
     | 
    
         | 
| 
         @@ -121,29 +138,17 @@ module Piculet 
     | 
|
| 
       121 
138 
     | 
    
         | 
| 
       122 
139 
     | 
    
         
             
                  sg_list_dsl.each do |key, sg_dsl|
         
     | 
| 
       123 
140 
     | 
    
         
             
                    name = key[0]
         
     | 
| 
      
 141 
     | 
    
         
            +
                    sg_aws = sg_list_aws.delete(key)
         
     | 
| 
       124 
142 
     | 
    
         | 
| 
       125 
     | 
    
         
            -
                    if  
     | 
| 
       126 
     | 
    
         
            -
                      next unless @options.sg_names.include?(name)
         
     | 
| 
       127 
     | 
    
         
            -
                    end
         
     | 
| 
       128 
     | 
    
         
            -
             
     | 
| 
       129 
     | 
    
         
            -
                    if @options.exclude_sgs
         
     | 
| 
       130 
     | 
    
         
            -
                      next if @options.exclude_sgs.any? {|regex| name =~ regex}
         
     | 
| 
       131 
     | 
    
         
            -
                    end
         
     | 
| 
      
 143 
     | 
    
         
            +
                    next if should_skip(name, sg_aws)
         
     | 
| 
       132 
144 
     | 
    
         | 
| 
       133 
     | 
    
         
            -
                    sg_aws = sg_list_aws.delete(key)
         
     | 
| 
       134 
145 
     | 
    
         
             
                    walk_security_group(sg_dsl, sg_aws)
         
     | 
| 
       135 
146 
     | 
    
         
             
                  end
         
     | 
| 
       136 
147 
     | 
    
         | 
| 
       137 
148 
     | 
    
         
             
                  sg_list_aws.each do |key, sg_aws|
         
     | 
| 
       138 
149 
     | 
    
         
             
                    name = key[0]
         
     | 
| 
       139 
150 
     | 
    
         | 
| 
       140 
     | 
    
         
            -
                    if  
     | 
| 
       141 
     | 
    
         
            -
                      next unless @options.sg_names.include?(name)
         
     | 
| 
       142 
     | 
    
         
            -
                    end
         
     | 
| 
       143 
     | 
    
         
            -
             
     | 
| 
       144 
     | 
    
         
            -
                    if @options.exclude_sgs
         
     | 
| 
       145 
     | 
    
         
            -
                      next if @options.exclude_sgs.any? {|regex| name =~ regex}
         
     | 
| 
       146 
     | 
    
         
            -
                    end
         
     | 
| 
      
 151 
     | 
    
         
            +
                    next if should_skip(name, sg_aws)
         
     | 
| 
       147 
152 
     | 
    
         | 
| 
       148 
153 
     | 
    
         
             
                    sg_aws.ingress_ip_permissions.each {|i| i.delete }
         
     | 
| 
       149 
154 
     | 
    
         
             
                    sg_aws.egress_ip_permissions.each {|i| i.delete } if vpc
         
     | 
| 
         @@ -152,13 +157,7 @@ module Piculet 
     | 
|
| 
       152 
157 
     | 
    
         
             
                  sg_list_aws.each do |key, sg_aws|
         
     | 
| 
       153 
158 
     | 
    
         
             
                    name = key[0]
         
     | 
| 
       154 
159 
     | 
    
         | 
| 
       155 
     | 
    
         
            -
                    if  
     | 
| 
       156 
     | 
    
         
            -
                      next unless @options.sg_names.include?(name)
         
     | 
| 
       157 
     | 
    
         
            -
                    end
         
     | 
| 
       158 
     | 
    
         
            -
             
     | 
| 
       159 
     | 
    
         
            -
                    if @options.exclude_sgs
         
     | 
| 
       160 
     | 
    
         
            -
                      next if @options.exclude_sgs.any? {|regex| name =~ regex}
         
     | 
| 
       161 
     | 
    
         
            -
                    end
         
     | 
| 
      
 160 
     | 
    
         
            +
                    next if should_skip(name, sg_aws)
         
     | 
| 
       162 
161 
     | 
    
         | 
| 
       163 
162 
     | 
    
         
             
                    sg_aws.delete
         
     | 
| 
       164 
163 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/piculet/dsl/ec2.rb
    CHANGED
    
    | 
         @@ -1,10 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Piculet
         
     | 
| 
       2 
2 
     | 
    
         
             
              class DSL
         
     | 
| 
       3 
3 
     | 
    
         
             
                class EC2
         
     | 
| 
      
 4 
     | 
    
         
            +
                  include Piculet::TemplateHelper
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       4 
6 
     | 
    
         
             
                  attr_reader :result
         
     | 
| 
       5 
7 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
                  def initialize(vpc, security_groups = [], &block)
         
     | 
| 
      
 8 
     | 
    
         
            +
                  def initialize(context, vpc, security_groups = [], &block)
         
     | 
| 
       7 
9 
     | 
    
         
             
                    @names = Set.new
         
     | 
| 
      
 10 
     | 
    
         
            +
                    @context = context.merge(:vpc => vpc)
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
       8 
12 
     | 
    
         
             
                    @result = OpenStruct.new({
         
     | 
| 
       9 
13 
     | 
    
         
             
                      :vpc             => vpc,
         
     | 
| 
       10 
14 
     | 
    
         
             
                      :security_groups => security_groups,
         
     | 
| 
         @@ -19,7 +23,7 @@ module Piculet 
     | 
|
| 
       19 
23 
     | 
    
         
             
                      raise "EC2 `#{@result.vpc || :classic}`: `#{name}` is already defined"
         
     | 
| 
       20 
24 
     | 
    
         
             
                    end
         
     | 
| 
       21 
25 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                    @result.security_groups << SecurityGroup.new(name, @result.vpc, &block).result
         
     | 
| 
      
 26 
     | 
    
         
            +
                    @result.security_groups << SecurityGroup.new(@context, name, @result.vpc, &block).result
         
     | 
| 
       23 
27 
     | 
    
         
             
                    @names << name
         
     | 
| 
       24 
28 
     | 
    
         
             
                  end
         
     | 
| 
       25 
29 
     | 
    
         
             
                end # EC2
         
     | 
| 
         @@ -4,10 +4,18 @@ module Piculet 
     | 
|
| 
       4 
4 
     | 
    
         
             
                  class SecurityGroup
         
     | 
| 
       5 
5 
     | 
    
         
             
                    class Permissions
         
     | 
| 
       6 
6 
     | 
    
         
             
                      class Permission
         
     | 
| 
       7 
     | 
    
         
            -
                         
     | 
| 
      
 7 
     | 
    
         
            +
                        include Piculet::TemplateHelper
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                        def initialize(context, security_group, direction, protocol_prot_range, &block)
         
     | 
| 
       8 
10 
     | 
    
         
             
                          @security_group = security_group
         
     | 
| 
       9 
11 
     | 
    
         
             
                          @direction = direction
         
     | 
| 
       10 
12 
     | 
    
         
             
                          @protocol_prot_range = protocol_prot_range
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                          @context = context.merge(
         
     | 
| 
      
 15 
     | 
    
         
            +
                            :protocol => protocol_prot_range[0],
         
     | 
| 
      
 16 
     | 
    
         
            +
                            :port_range => protocol_prot_range[1]
         
     | 
| 
      
 17 
     | 
    
         
            +
                          )
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       11 
19 
     | 
    
         
             
                          @result = OpenStruct.new
         
     | 
| 
       12 
20 
     | 
    
         
             
                          instance_eval(&block)
         
     | 
| 
       13 
21 
     | 
    
         
             
                        end
         
     | 
| 
         @@ -4,10 +4,12 @@ module Piculet 
     | 
|
| 
       4 
4 
     | 
    
         
             
                  class SecurityGroup
         
     | 
| 
       5 
5 
     | 
    
         
             
                    class Permissions
         
     | 
| 
       6 
6 
     | 
    
         
             
                      include Logger::ClientHelper
         
     | 
| 
      
 7 
     | 
    
         
            +
                      include Piculet::TemplateHelper
         
     | 
| 
       7 
8 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
                      def initialize(security_group, direction, &block)
         
     | 
| 
      
 9 
     | 
    
         
            +
                      def initialize(context, security_group, direction, &block)
         
     | 
| 
       9 
10 
     | 
    
         
             
                        @security_group = security_group
         
     | 
| 
       10 
11 
     | 
    
         
             
                        @direction = direction
         
     | 
| 
      
 12 
     | 
    
         
            +
                        @context = context.merge(:direction => direction)
         
     | 
| 
       11 
13 
     | 
    
         
             
                        @result = {}
         
     | 
| 
       12 
14 
     | 
    
         
             
                        instance_eval(&block)
         
     | 
| 
       13 
15 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -32,7 +34,7 @@ module Piculet 
     | 
|
| 
       32 
34 
     | 
    
         
             
                        end
         
     | 
| 
       33 
35 
     | 
    
         | 
| 
       34 
36 
     | 
    
         
             
                        key = [protocol, port_range]
         
     | 
| 
       35 
     | 
    
         
            -
                        res = Permission.new(@security_group, @direction, key, &block).result
         
     | 
| 
      
 37 
     | 
    
         
            +
                        res = Permission.new(@context, @security_group, @direction, key, &block).result
         
     | 
| 
       36 
38 
     | 
    
         | 
| 
       37 
39 
     | 
    
         
             
                        if @result.has_key?(key)
         
     | 
| 
       38 
40 
     | 
    
         
             
                          @result[key] = OpenStruct.new(@result[key].marshal_dump.merge(res.marshal_dump) {|hash_key, old_val, new_val|
         
     | 
| 
         @@ -2,9 +2,12 @@ module Piculet 
     | 
|
| 
       2 
2 
     | 
    
         
             
              class DSL
         
     | 
| 
       3 
3 
     | 
    
         
             
                class EC2
         
     | 
| 
       4 
4 
     | 
    
         
             
                  class SecurityGroup
         
     | 
| 
       5 
     | 
    
         
            -
                     
     | 
| 
      
 5 
     | 
    
         
            +
                    include Piculet::TemplateHelper
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                    def initialize(context, name, vpc, &block)
         
     | 
| 
       6 
8 
     | 
    
         
             
                      @name = name
         
     | 
| 
       7 
9 
     | 
    
         
             
                      @vpc = vpc
         
     | 
| 
      
 10 
     | 
    
         
            +
                      @context = context.merge(:security_group_name => name)
         
     | 
| 
       8 
11 
     | 
    
         | 
| 
       9 
12 
     | 
    
         
             
                      @result = OpenStruct.new({
         
     | 
| 
       10 
13 
     | 
    
         
             
                        :name    => name,
         
     | 
| 
         @@ -47,7 +50,7 @@ module Piculet 
     | 
|
| 
       47 
50 
     | 
    
         
             
                        raise "SecurityGroup `#{@name}`: `ingress` is already defined"
         
     | 
| 
       48 
51 
     | 
    
         
             
                      end
         
     | 
| 
       49 
52 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
                      @result.ingress = Permissions.new(@name, :ingress, &block).result
         
     | 
| 
      
 53 
     | 
    
         
            +
                      @result.ingress = Permissions.new(@context, @name, :ingress, &block).result
         
     | 
| 
       51 
54 
     | 
    
         
             
                      @ingress_is_defined = true
         
     | 
| 
       52 
55 
     | 
    
         
             
                    end
         
     | 
| 
       53 
56 
     | 
    
         | 
| 
         @@ -60,7 +63,7 @@ module Piculet 
     | 
|
| 
       60 
63 
     | 
    
         
             
                        raise "SecurityGroup `#{@name}`: Cannot define `egress` in classic"
         
     | 
| 
       61 
64 
     | 
    
         
             
                      end
         
     | 
| 
       62 
65 
     | 
    
         | 
| 
       63 
     | 
    
         
            -
                      @result.egress = Permissions.new(@name, :egress, &block).result
         
     | 
| 
      
 66 
     | 
    
         
            +
                      @result.egress = Permissions.new(@context, @name, :egress, &block).result
         
     | 
| 
       64 
67 
     | 
    
         | 
| 
       65 
68 
     | 
    
         
             
                      @egress_is_defined = true
         
     | 
| 
       66 
69 
     | 
    
         
             
                    end
         
     | 
    
        data/lib/piculet/dsl.rb
    CHANGED
    
    | 
         @@ -1,5 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Piculet
         
     | 
| 
       2 
2 
     | 
    
         
             
              class DSL
         
     | 
| 
      
 3 
     | 
    
         
            +
                include Piculet::TemplateHelper
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
       3 
5 
     | 
    
         
             
                class << self
         
     | 
| 
       4 
6 
     | 
    
         
             
                  def define(source, path)
         
     | 
| 
       5 
7 
     | 
    
         
             
                    self.new(path) do
         
     | 
| 
         @@ -17,17 +19,28 @@ module Piculet 
     | 
|
| 
       17 
19 
     | 
    
         
             
                def initialize(path, &block)
         
     | 
| 
       18 
20 
     | 
    
         
             
                  @path = path
         
     | 
| 
       19 
21 
     | 
    
         
             
                  @result = OpenStruct.new(:ec2s => {})
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                  @context = Hashie::Mash.new(
         
     | 
| 
      
 24 
     | 
    
         
            +
                    :path => path,
         
     | 
| 
      
 25 
     | 
    
         
            +
                    :templates => {}
         
     | 
| 
      
 26 
     | 
    
         
            +
                  )
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
       20 
28 
     | 
    
         
             
                  instance_eval(&block)
         
     | 
| 
       21 
29 
     | 
    
         
             
                end
         
     | 
| 
       22 
30 
     | 
    
         | 
| 
       23 
31 
     | 
    
         
             
                private
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                def template(name, &block)
         
     | 
| 
      
 34 
     | 
    
         
            +
                  @context.templates[name.to_s] = block
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
       24 
37 
     | 
    
         
             
                def require(file)
         
     | 
| 
       25 
     | 
    
         
            -
                  groupfile = File.expand_path(File.join(File.dirname(@path), file))
         
     | 
| 
      
 38 
     | 
    
         
            +
                  groupfile = (file =~ %r|\A/|) ? file : File.expand_path(File.join(File.dirname(@path), file))
         
     | 
| 
       26 
39 
     | 
    
         | 
| 
       27 
40 
     | 
    
         
             
                  if File.exist?(groupfile)
         
     | 
| 
       28 
     | 
    
         
            -
                    instance_eval(File.read(groupfile))
         
     | 
| 
      
 41 
     | 
    
         
            +
                    instance_eval(File.read(groupfile), groupfile)
         
     | 
| 
       29 
42 
     | 
    
         
             
                  elsif File.exist?(groupfile + '.rb')
         
     | 
| 
       30 
     | 
    
         
            -
                    instance_eval(File.read(groupfile + '.rb'))
         
     | 
| 
      
 43 
     | 
    
         
            +
                    instance_eval(File.read(groupfile + '.rb'), groupfile + '.rb')
         
     | 
| 
       31 
44 
     | 
    
         
             
                  else
         
     | 
| 
       32 
45 
     | 
    
         
             
                    Kernel.require(file)
         
     | 
| 
       33 
46 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -35,9 +48,9 @@ module Piculet 
     | 
|
| 
       35 
48 
     | 
    
         | 
| 
       36 
49 
     | 
    
         
             
                def ec2(vpc = nil, &block)
         
     | 
| 
       37 
50 
     | 
    
         
             
                  if (ec2_result = @result.ec2s[vpc])
         
     | 
| 
       38 
     | 
    
         
            -
                    @result.ec2s[vpc] = EC2.new(vpc, ec2_result.security_groups, &block).result
         
     | 
| 
      
 51 
     | 
    
         
            +
                    @result.ec2s[vpc] = EC2.new(@context, vpc, ec2_result.security_groups, &block).result
         
     | 
| 
       39 
52 
     | 
    
         
             
                  else
         
     | 
| 
       40 
     | 
    
         
            -
                    @result.ec2s[vpc] = EC2.new(vpc, [], &block).result
         
     | 
| 
      
 53 
     | 
    
         
            +
                    @result.ec2s[vpc] = EC2.new(@context, vpc, [], &block).result
         
     | 
| 
       41 
54 
     | 
    
         
             
                  end
         
     | 
| 
       42 
55 
     | 
    
         
             
                end
         
     | 
| 
       43 
56 
     | 
    
         
             
              end # DSL
         
     | 
    
        data/lib/piculet/logger.rb
    CHANGED
    
    | 
         @@ -22,7 +22,8 @@ module Piculet 
     | 
|
| 
       22 
22 
     | 
    
         
             
                    message << ": #{log_id}" if log_id
         
     | 
| 
       23 
23 
     | 
    
         
             
                    message << ' (dry-run)' if @options && @options.dry_run
         
     | 
| 
       24 
24 
     | 
    
         
             
                    logger = (@options && @options.logger) || Piculet::Logger.instance
         
     | 
| 
       25 
     | 
    
         
            -
                     
     | 
| 
      
 25 
     | 
    
         
            +
                    message = message.send(color) if color
         
     | 
| 
      
 26 
     | 
    
         
            +
                    logger.send(level, message)
         
     | 
| 
       26 
27 
     | 
    
         
             
                  end
         
     | 
| 
       27 
28 
     | 
    
         
             
                end # ClientHelper
         
     | 
| 
       28 
29 
     | 
    
         
             
              end # Logger
         
     | 
| 
         @@ -0,0 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Piculet
         
     | 
| 
      
 2 
     | 
    
         
            +
              module TemplateHelper
         
     | 
| 
      
 3 
     | 
    
         
            +
                def include_template(template_name, context = {})
         
     | 
| 
      
 4 
     | 
    
         
            +
                  tmplt = @context.templates[template_name.to_s]
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                  unless tmplt
         
     | 
| 
      
 7 
     | 
    
         
            +
                    raise "Template `#{template_name}` is not defined"
         
     | 
| 
      
 8 
     | 
    
         
            +
                  end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                  context_orig = @context
         
     | 
| 
      
 11 
     | 
    
         
            +
                  @context = @context.merge(context)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  instance_eval(&tmplt)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @context = context_orig
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                def context
         
     | 
| 
      
 17 
     | 
    
         
            +
                  @context
         
     | 
| 
      
 18 
     | 
    
         
            +
                end
         
     | 
| 
      
 19 
     | 
    
         
            +
              end
         
     | 
| 
      
 20 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,17 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Piculet
         
     | 
| 
      
 2 
     | 
    
         
            +
              class Utils
         
     | 
| 
      
 3 
     | 
    
         
            +
                class << self
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def diff(obj1, obj2, options = {})
         
     | 
| 
      
 5 
     | 
    
         
            +
                    diffy = Diffy::Diff.new(
         
     | 
| 
      
 6 
     | 
    
         
            +
                      obj1.pretty_inspect,
         
     | 
| 
      
 7 
     | 
    
         
            +
                      obj2.pretty_inspect,
         
     | 
| 
      
 8 
     | 
    
         
            +
                      :diff => '-u'
         
     | 
| 
      
 9 
     | 
    
         
            +
                    )
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                    out = diffy.to_s(options[:color] ? :color : :text).gsub(/\s+\z/m, '')
         
     | 
| 
      
 12 
     | 
    
         
            +
                    out.gsub!(/^/, options[:indent]) if options[:indent]
         
     | 
| 
      
 13 
     | 
    
         
            +
                    out
         
     | 
| 
      
 14 
     | 
    
         
            +
                  end
         
     | 
| 
      
 15 
     | 
    
         
            +
                end # of class methods
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/piculet/version.rb
    CHANGED
    
    
| 
         @@ -71,7 +71,7 @@ module Piculet 
     | 
|
| 
       71 
71 
     | 
    
         
             
                      self_tags = normalize_tags(self.tags)
         
     | 
| 
       72 
72 
     | 
    
         
             
                      dsl_tags = normalize_tags(dsl.tags)
         
     | 
| 
       73 
73 
     | 
    
         | 
| 
       74 
     | 
    
         
            -
                      log(:info, "   
     | 
| 
      
 74 
     | 
    
         
            +
                      log(:info, "  tags:\n".green + Piculet::Utils.diff(self_tags, dsl_tags, :color => @options.color, :indent => '    '), false)
         
     | 
| 
       75 
75 
     | 
    
         | 
| 
       76 
76 
     | 
    
         
             
                      unless @options.dry_run
         
     | 
| 
       77 
77 
     | 
    
         
             
                        if dsl_tags.empty?
         
     | 
    
        data/lib/piculet.rb
    CHANGED
    
    | 
         @@ -4,6 +4,9 @@ require 'ostruct' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            require 'set'
         
     | 
| 
       5 
5 
     | 
    
         
             
            require 'singleton'
         
     | 
| 
       6 
6 
     | 
    
         
             
            require 'term/ansicolor'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'diffy'
         
     | 
| 
      
 8 
     | 
    
         
            +
            require 'pp'
         
     | 
| 
      
 9 
     | 
    
         
            +
            require 'hashie'
         
     | 
| 
       7 
10 
     | 
    
         | 
| 
       8 
11 
     | 
    
         
             
            require 'aws-sdk-v1'
         
     | 
| 
       9 
12 
     | 
    
         | 
| 
         @@ -13,6 +16,8 @@ require 'piculet/ext/ip-permission-collection-ext' 
     | 
|
| 
       13 
16 
     | 
    
         
             
            require 'piculet/ext/string-ext'
         
     | 
| 
       14 
17 
     | 
    
         | 
| 
       15 
18 
     | 
    
         
             
            require 'piculet/logger'
         
     | 
| 
      
 19 
     | 
    
         
            +
            require 'piculet/template-helper'
         
     | 
| 
      
 20 
     | 
    
         
            +
            require 'piculet/utils'
         
     | 
| 
       16 
21 
     | 
    
         
             
            require 'piculet/client'
         
     | 
| 
       17 
22 
     | 
    
         
             
            require 'piculet/dsl'
         
     | 
| 
       18 
23 
     | 
    
         
             
            require 'piculet/dsl/converter'
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,97 +1,125 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: piculet
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2.9. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.9.beta2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - winebarrel
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-10-18 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: aws-sdk-v1
         
     | 
| 
       15 
15 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       16 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
     | 
    
         
            -
                - -  
     | 
| 
      
 17 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       18 
18 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
19 
     | 
    
         
             
                    version: 1.48.0
         
     | 
| 
       20 
20 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       21 
21 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       22 
22 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
23 
     | 
    
         
             
                requirements:
         
     | 
| 
       24 
     | 
    
         
            -
                - -  
     | 
| 
      
 24 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       25 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
26 
     | 
    
         
             
                    version: 1.48.0
         
     | 
| 
       27 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
28 
     | 
    
         
             
              name: term-ansicolor
         
     | 
| 
       29 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
     | 
    
         
            -
                - -  
     | 
| 
      
 31 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       32 
32 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
33 
     | 
    
         
             
                    version: 1.2.2
         
     | 
| 
       34 
34 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       35 
35 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       36 
36 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       37 
37 
     | 
    
         
             
                requirements:
         
     | 
| 
       38 
     | 
    
         
            -
                - -  
     | 
| 
      
 38 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       39 
39 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
40 
     | 
    
         
             
                    version: 1.2.2
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: diffy
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 44 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 48 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 49 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 50 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 55 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 56 
     | 
    
         
            +
              name: hashie
         
     | 
| 
      
 57 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 58 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 59 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 60 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 62 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 63 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 64 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       41 
69 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
70 
     | 
    
         
             
              name: bundler
         
     | 
| 
       43 
71 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       44 
72 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 73 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       46 
74 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
75 
     | 
    
         
             
                    version: '1.3'
         
     | 
| 
       48 
76 
     | 
    
         
             
              type: :development
         
     | 
| 
       49 
77 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       50 
78 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       51 
79 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 80 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       53 
81 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       54 
82 
     | 
    
         
             
                    version: '1.3'
         
     | 
| 
       55 
83 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       56 
84 
     | 
    
         
             
              name: rake
         
     | 
| 
       57 
85 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       58 
86 
     | 
    
         
             
                requirements:
         
     | 
| 
       59 
     | 
    
         
            -
                - -  
     | 
| 
      
 87 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       60 
88 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       61 
89 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       62 
90 
     | 
    
         
             
              type: :development
         
     | 
| 
       63 
91 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       64 
92 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       65 
93 
     | 
    
         
             
                requirements:
         
     | 
| 
       66 
     | 
    
         
            -
                - -  
     | 
| 
      
 94 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       67 
95 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       68 
96 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       69 
97 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       70 
98 
     | 
    
         
             
              name: rspec
         
     | 
| 
       71 
99 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       72 
100 
     | 
    
         
             
                requirements:
         
     | 
| 
       73 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 101 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       74 
102 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       75 
103 
     | 
    
         
             
                    version: 2.14.1
         
     | 
| 
       76 
104 
     | 
    
         
             
              type: :development
         
     | 
| 
       77 
105 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       78 
106 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       79 
107 
     | 
    
         
             
                requirements:
         
     | 
| 
       80 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 108 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       81 
109 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       82 
110 
     | 
    
         
             
                    version: 2.14.1
         
     | 
| 
       83 
111 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       84 
112 
     | 
    
         
             
              name: rspec-instafail
         
     | 
| 
       85 
113 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       86 
114 
     | 
    
         
             
                requirements:
         
     | 
| 
       87 
     | 
    
         
            -
                - -  
     | 
| 
      
 115 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       88 
116 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       89 
117 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       90 
118 
     | 
    
         
             
              type: :development
         
     | 
| 
       91 
119 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       92 
120 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       93 
121 
     | 
    
         
             
                requirements:
         
     | 
| 
       94 
     | 
    
         
            -
                - -  
     | 
| 
      
 122 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       95 
123 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       96 
124 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       97 
125 
     | 
    
         
             
            description: Piculet is a tool to manage EC2 Security Group. It defines the state
         
     | 
| 
         @@ -105,26 +133,28 @@ extra_rdoc_files: [] 
     | 
|
| 
       105 
133 
     | 
    
         
             
            files:
         
     | 
| 
       106 
134 
     | 
    
         
             
            - README.md
         
     | 
| 
       107 
135 
     | 
    
         
             
            - bin/piculet
         
     | 
| 
      
 136 
     | 
    
         
            +
            - lib/piculet.rb
         
     | 
| 
       108 
137 
     | 
    
         
             
            - lib/piculet/client.rb
         
     | 
| 
      
 138 
     | 
    
         
            +
            - lib/piculet/dsl.rb
         
     | 
| 
       109 
139 
     | 
    
         
             
            - lib/piculet/dsl/converter.rb
         
     | 
| 
       110 
140 
     | 
    
         
             
            - lib/piculet/dsl/ec2.rb
         
     | 
| 
       111 
141 
     | 
    
         
             
            - lib/piculet/dsl/permission.rb
         
     | 
| 
       112 
142 
     | 
    
         
             
            - lib/piculet/dsl/permissions.rb
         
     | 
| 
       113 
143 
     | 
    
         
             
            - lib/piculet/dsl/security-group.rb
         
     | 
| 
       114 
     | 
    
         
            -
            - lib/piculet/dsl.rb
         
     | 
| 
       115 
144 
     | 
    
         
             
            - lib/piculet/exporter.rb
         
     | 
| 
       116 
145 
     | 
    
         
             
            - lib/piculet/ext/ec2-owner-id-ext.rb
         
     | 
| 
       117 
146 
     | 
    
         
             
            - lib/piculet/ext/ip-permission-collection-ext.rb
         
     | 
| 
       118 
147 
     | 
    
         
             
            - lib/piculet/ext/security-group.rb
         
     | 
| 
       119 
148 
     | 
    
         
             
            - lib/piculet/ext/string-ext.rb
         
     | 
| 
       120 
149 
     | 
    
         
             
            - lib/piculet/logger.rb
         
     | 
| 
      
 150 
     | 
    
         
            +
            - lib/piculet/template-helper.rb
         
     | 
| 
      
 151 
     | 
    
         
            +
            - lib/piculet/utils.rb
         
     | 
| 
       121 
152 
     | 
    
         
             
            - lib/piculet/version.rb
         
     | 
| 
       122 
153 
     | 
    
         
             
            - lib/piculet/wrapper/ec2-wrapper.rb
         
     | 
| 
       123 
154 
     | 
    
         
             
            - lib/piculet/wrapper/permission-collection.rb
         
     | 
| 
       124 
155 
     | 
    
         
             
            - lib/piculet/wrapper/permission.rb
         
     | 
| 
       125 
156 
     | 
    
         
             
            - lib/piculet/wrapper/security-group-collection.rb
         
     | 
| 
       126 
157 
     | 
    
         
             
            - lib/piculet/wrapper/security-group.rb
         
     | 
| 
       127 
     | 
    
         
            -
            - lib/piculet.rb
         
     | 
| 
       128 
158 
     | 
    
         
             
            homepage: http://piculet.codenize.tools/
         
     | 
| 
       129 
159 
     | 
    
         
             
            licenses:
         
     | 
| 
       130 
160 
     | 
    
         
             
            - MIT
         
     | 
| 
         @@ -135,17 +165,17 @@ require_paths: 
     | 
|
| 
       135 
165 
     | 
    
         
             
            - lib
         
     | 
| 
       136 
166 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       137 
167 
     | 
    
         
             
              requirements:
         
     | 
| 
       138 
     | 
    
         
            -
              - -  
     | 
| 
      
 168 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       139 
169 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       140 
170 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       141 
171 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       142 
172 
     | 
    
         
             
              requirements:
         
     | 
| 
       143 
     | 
    
         
            -
              - -  
     | 
| 
      
 173 
     | 
    
         
            +
              - - ">"
         
     | 
| 
       144 
174 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       145 
175 
     | 
    
         
             
                  version: 1.3.1
         
     | 
| 
       146 
176 
     | 
    
         
             
            requirements: []
         
     | 
| 
       147 
177 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       148 
     | 
    
         
            -
            rubygems_version: 2. 
     | 
| 
      
 178 
     | 
    
         
            +
            rubygems_version: 2.4.5
         
     | 
| 
       149 
179 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       150 
180 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       151 
181 
     | 
    
         
             
            summary: Piculet is a tool to manage EC2 Security Group.
         
     |