batali 0.2.32 → 0.3.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/CHANGELOG.md +4 -0
 - data/bin/batali +2 -0
 - data/lib/batali/b_file.rb +38 -18
 - data/lib/batali/command.rb +1 -1
 - data/lib/batali/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 46854b296a6edbf19b102be8b154d07a7b12281a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7ffcd5cb954a80a8f3fa3c03081b71eaef3ff614
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 54d327a5d8968e97c5b015e69137a702b38cef1e46251d3e2ccd05ba59c7300ca5e6f0c0b1ea06f3b8f97bb290674c09525f151bd2b51a690bfdd240b2da1076
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 545583f6bf2c2bebf1f12a5b0208b1b353b3bc3631aae38e1cb8e9823858acb44df9fc60049ea4158af3ea254a9a22ba44afe25f1620454e40159d0348736900
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # v0.3.0
         
     | 
| 
      
 2 
     | 
    
         
            +
            * [enhancement] Properly restore BFile from serialized data
         
     | 
| 
      
 3 
     | 
    
         
            +
            * [enhancement] Provide access to environment specific constraint usage
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
       1 
5 
     | 
    
         
             
            # v0.2.32
         
     | 
| 
       2 
6 
     | 
    
         
             
            * [fix] Skip constraint merging when entry is non-site sourced
         
     | 
| 
       3 
7 
     | 
    
         
             
            * [enhancement] Support dry run in infrastructure resolve
         
     | 
    
        data/bin/batali
    CHANGED
    
    | 
         @@ -44,6 +44,7 @@ Bogo::Cli::Setup.define do 
     | 
|
| 
       44 
44 
     | 
    
         
             
                on :i, 'install', 'Install cookbooks after update', :default => true
         
     | 
| 
       45 
45 
     | 
    
         
             
                on :p, 'path=', 'Cookbook install path'
         
     | 
| 
       46 
46 
     | 
    
         
             
                on :I, 'infrastructure', 'Resolve infrastructure cookbooks'
         
     | 
| 
      
 47 
     | 
    
         
            +
                on :e, 'environment=', 'Restrict auto-discovery to named environment'
         
     | 
| 
       47 
48 
     | 
    
         | 
| 
       48 
49 
     | 
    
         
             
                run do |opts, args|
         
     | 
| 
       49 
50 
     | 
    
         
             
                  Batali::Command::Update.new({:update => opts.to_hash}, args).execute!
         
     | 
| 
         @@ -56,6 +57,7 @@ Bogo::Cli::Setup.define do 
     | 
|
| 
       56 
57 
     | 
    
         
             
                on :d, 'dry-run', 'Print changes'
         
     | 
| 
       57 
58 
     | 
    
         
             
                on :l, 'least-impact', 'Update cookbooks with minimal version impact', :default => true
         
     | 
| 
       58 
59 
     | 
    
         
             
                on :I, 'infrastructure', 'Resolve infrastructure cookbooks'
         
     | 
| 
      
 60 
     | 
    
         
            +
                on :e, 'environment=', 'Restrict auto-discovery to named environment'
         
     | 
| 
       59 
61 
     | 
    
         | 
| 
       60 
62 
     | 
    
         
             
                run do |opts, args|
         
     | 
| 
       61 
63 
     | 
    
         
             
                  Batali::Command::Resolve.new({:resolve => opts.to_hash}, args).execute!
         
     | 
    
        data/lib/batali/b_file.rb
    CHANGED
    
    | 
         @@ -91,15 +91,19 @@ module Batali 
     | 
|
| 
       91 
91 
     | 
    
         
             
                def self.cookbook_coerce
         
     | 
| 
       92 
92 
     | 
    
         
             
                  proc do |v|
         
     | 
| 
       93 
93 
     | 
    
         
             
                    v = [v].flatten.compact
         
     | 
| 
       94 
     | 
    
         
            -
                     
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
                      args = Smash.new
         
     | 
| 
       97 
     | 
    
         
            -
                    elsif(args.size == 1 && args.first.is_a?(Hash))
         
     | 
| 
       98 
     | 
    
         
            -
                      args = args.first
         
     | 
| 
      
 94 
     | 
    
         
            +
                    if(v.size == 1 && v.first.is_a?(Hash))
         
     | 
| 
      
 95 
     | 
    
         
            +
                      Cookbook.new(v.first)
         
     | 
| 
       99 
96 
     | 
    
         
             
                    else
         
     | 
| 
       100 
     | 
    
         
            -
                      args =  
     | 
| 
      
 97 
     | 
    
         
            +
                      name, args = v.first, v.slice(1, v.size)
         
     | 
| 
      
 98 
     | 
    
         
            +
                      if(args.empty?)
         
     | 
| 
      
 99 
     | 
    
         
            +
                        args = Smash.new
         
     | 
| 
      
 100 
     | 
    
         
            +
                      elsif(args.size == 1 && args.first.is_a?(Hash))
         
     | 
| 
      
 101 
     | 
    
         
            +
                        args = args.first
         
     | 
| 
      
 102 
     | 
    
         
            +
                      else
         
     | 
| 
      
 103 
     | 
    
         
            +
                        args = Smash.new(:constraint => args.map(&:to_s))
         
     | 
| 
      
 104 
     | 
    
         
            +
                      end
         
     | 
| 
      
 105 
     | 
    
         
            +
                      Cookbook.new(Smash.new(:name => name).merge(args))
         
     | 
| 
       101 
106 
     | 
    
         
             
                    end
         
     | 
| 
       102 
     | 
    
         
            -
                    Cookbook.new(Smash.new(:name => name).merge(args))
         
     | 
| 
       103 
107 
     | 
    
         
             
                  end
         
     | 
| 
       104 
108 
     | 
    
         
             
                end
         
     | 
| 
       105 
109 
     | 
    
         | 
| 
         @@ -123,28 +127,44 @@ module Batali 
     | 
|
| 
       123 
127 
     | 
    
         | 
| 
       124 
128 
     | 
    
         
             
                attribute :discover, [TrueClass, FalseClass], :required => true, :default => false
         
     | 
| 
       125 
129 
     | 
    
         
             
                attribute :restrict, Restriction, :multiple => true, :coerce => lambda{|v|
         
     | 
| 
       126 
     | 
    
         
            -
                   
     | 
| 
      
 130 
     | 
    
         
            +
                  if(v.is_a?(Hash))
         
     | 
| 
      
 131 
     | 
    
         
            +
                    Restriction.new(v)
         
     | 
| 
      
 132 
     | 
    
         
            +
                  else
         
     | 
| 
      
 133 
     | 
    
         
            +
                    Restriction.new(:cookbook => v.first, :source => v.last.to_smash[:source])
         
     | 
| 
      
 134 
     | 
    
         
            +
                  end
         
     | 
| 
       127 
135 
     | 
    
         
             
                }
         
     | 
| 
       128 
136 
     | 
    
         
             
                attribute :source, Origin::RemoteSite, :multiple => true, :default => [], :coerce => lambda{|v|
         
     | 
| 
       129 
     | 
    
         
            -
                   
     | 
| 
       130 
     | 
    
         
            -
             
     | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
      
 137 
     | 
    
         
            +
                  if(v.is_a?(Hash))
         
     | 
| 
      
 138 
     | 
    
         
            +
                    args = v
         
     | 
| 
      
 139 
     | 
    
         
            +
                  else
         
     | 
| 
      
 140 
     | 
    
         
            +
                    args = Smash.new(:endpoint => v.first)
         
     | 
| 
      
 141 
     | 
    
         
            +
                    if(v.last.is_a?(Hash))
         
     | 
| 
      
 142 
     | 
    
         
            +
                      args.merge!(v.last)
         
     | 
| 
      
 143 
     | 
    
         
            +
                    end
         
     | 
| 
       132 
144 
     | 
    
         
             
                  end
         
     | 
| 
       133 
145 
     | 
    
         
             
                  Origin::RemoteSite.new(args)
         
     | 
| 
       134 
146 
     | 
    
         
             
                }
         
     | 
| 
       135 
147 
     | 
    
         
             
                attribute :chef_server, Origin::ChefServer, :multiple => true, :default => [], :coerce => lambda{|v|
         
     | 
| 
       136 
     | 
    
         
            -
                   
     | 
| 
       137 
     | 
    
         
            -
             
     | 
| 
       138 
     | 
    
         
            -
             
     | 
| 
      
 148 
     | 
    
         
            +
                  if(v.is_a?(Hash))
         
     | 
| 
      
 149 
     | 
    
         
            +
                    args = v
         
     | 
| 
      
 150 
     | 
    
         
            +
                  else
         
     | 
| 
      
 151 
     | 
    
         
            +
                    args = Smash.new(:endpoint => v.first)
         
     | 
| 
      
 152 
     | 
    
         
            +
                    if(v.last.is_a?(Hash))
         
     | 
| 
      
 153 
     | 
    
         
            +
                      args.merge!(v.last)
         
     | 
| 
      
 154 
     | 
    
         
            +
                    end
         
     | 
| 
       139 
155 
     | 
    
         
             
                  end
         
     | 
| 
       140 
156 
     | 
    
         
             
                  Origin::ChefServer.new(args)
         
     | 
| 
       141 
157 
     | 
    
         
             
                }
         
     | 
| 
       142 
     | 
    
         
            -
                attribute :group, Group, :multiple => true, :coerce => lambda{|v| Group.new()}
         
     | 
| 
      
 158 
     | 
    
         
            +
                attribute :group, Group, :multiple => true, :coerce => lambda{|v| Group.new(v)}
         
     | 
| 
       143 
159 
     | 
    
         
             
                attribute :cookbook, Cookbook, :multiple => true, :coerce => BFile.cookbook_coerce, :default => []
         
     | 
| 
       144 
160 
     | 
    
         
             
                attribute :metadata, Cookbook, :coerce => lambda{ |v, b_file|
         
     | 
| 
       145 
     | 
    
         
            -
                   
     | 
| 
       146 
     | 
    
         
            -
             
     | 
| 
       147 
     | 
    
         
            -
                   
     | 
| 
      
 161 
     | 
    
         
            +
                  if(v.is_a?(Hash))
         
     | 
| 
      
 162 
     | 
    
         
            +
                    ckbk = Cookbook.new(v)
         
     | 
| 
      
 163 
     | 
    
         
            +
                  else
         
     | 
| 
      
 164 
     | 
    
         
            +
                    dir = Pathname.new(File.dirname(b_file.path)).relative_path_from(Pathname.new(Dir.pwd)).to_path
         
     | 
| 
      
 165 
     | 
    
         
            +
                    m_unit = Origin::Path.new(:name => 'metadata', :path => dir).units.first
         
     | 
| 
      
 166 
     | 
    
         
            +
                    ckbk = Cookbook.new(:name => m_unit.name, :version => m_unit.version, :path => dir)
         
     | 
| 
      
 167 
     | 
    
         
            +
                  end
         
     | 
| 
       148 
168 
     | 
    
         
             
                  unless(b_file.cookbook.map(&:name).include?(ckbk.name))
         
     | 
| 
       149 
169 
     | 
    
         
             
                    b_file.cookbook.push ckbk
         
     | 
| 
       150 
170 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/batali/command.rb
    CHANGED
    
    
    
        data/lib/batali/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: batali
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Chris Roberts
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-11-04 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: attribute_struct
         
     |