gusteau 1.0.1.dev → 1.0.2.dev
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.
- data/CHANGELOG.md +3 -0
 - data/README.md +1 -1
 - data/Rakefile +1 -0
 - data/gusteau.gemspec +1 -0
 - data/lib/gusteau/bureau.rb +1 -1
 - data/lib/gusteau/compressed_tar_stream.rb +2 -1
 - data/lib/gusteau/server.rb +4 -1
 - data/lib/gusteau/ssh_config.rb +1 -1
 - data/lib/gusteau/version.rb +1 -1
 - data/spec/lib/gusteau/bureau_spec.rb +2 -2
 - data/spec/lib/gusteau/config_spec.rb +1 -1
 - data/spec/lib/gusteau/log_spec.rb +1 -1
 - data/spec/lib/gusteau/ssh_config_spec.rb +5 -5
 - metadata +21 -2
 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    
    
        data/gusteau.gemspec
    CHANGED
    
    | 
         @@ -25,6 +25,7 @@ Gem::Specification.new do |gem| 
     | 
|
| 
       25 
25 
     | 
    
         
             
              gem.add_dependency 'net-ssh', '>= 2.2.2'
         
     | 
| 
       26 
26 
     | 
    
         
             
              gem.add_dependency 'archive-tar-minitar', '>= 0.5.2'
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
      
 28 
     | 
    
         
            +
              gem.add_development_dependency 'bundler'
         
     | 
| 
       28 
29 
     | 
    
         
             
              gem.add_development_dependency 'minitest'
         
     | 
| 
       29 
30 
     | 
    
         
             
              gem.add_development_dependency 'mocha'
         
     | 
| 
       30 
31 
     | 
    
         
             
              gem.add_development_dependency 'simplecov'
         
     | 
    
        data/lib/gusteau/bureau.rb
    CHANGED
    
    | 
         @@ -14,7 +14,7 @@ module Gusteau 
     | 
|
| 
       14 
14 
     | 
    
         
             
                  @login   = Etc.getlogin
         
     | 
| 
       15 
15 
     | 
    
         
             
                  @ssh_key = File.read(File.expand_path '~/.ssh/id_rsa.pub').chomp rescue 'Your SSH key'
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
                  abort "Directory #{name} already exists" if  
     | 
| 
      
 17 
     | 
    
         
            +
                  abort "Directory #{name} already exists" if File.exists?(name)
         
     | 
| 
       18 
18 
     | 
    
         
             
                end
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
                def generate!(init = true)
         
     | 
| 
         @@ -14,7 +14,8 @@ module Gusteau 
     | 
|
| 
       14 
14 
     | 
    
         
             
                      print '.'
         
     | 
| 
       15 
15 
     | 
    
         
             
                      Archive::Tar::Minitar.pack_file(f, tar)
         
     | 
| 
       16 
16 
     | 
    
         
             
                    end
         
     | 
| 
       17 
     | 
    
         
            -
                    tar.close.string. 
     | 
| 
      
 17 
     | 
    
         
            +
                    tar.close.string.tap { |data|
         
     | 
| 
      
 18 
     | 
    
         
            +
                      data.force_encoding('binary') if data.respond_to?(:force_encoding)
         
     | 
| 
       18 
19 
     | 
    
         
             
                      puts " (compressed down to #{data.size} bytes)"
         
     | 
| 
       19 
20 
     | 
    
         
             
                    }
         
     | 
| 
       20 
21 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/gusteau/server.rb
    CHANGED
    
    | 
         @@ -18,7 +18,10 @@ module Gusteau 
     | 
|
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                def upload(files_and_dirs, dest_dir, opts={})
         
     | 
| 
       20 
20 
     | 
    
         
             
                  log "#uploading #{files_and_dirs.join(' ')} to #{@host}:#{dest_dir}" do
         
     | 
| 
       21 
     | 
    
         
            -
                    files =  
     | 
| 
      
 21 
     | 
    
         
            +
                    files = []
         
     | 
| 
      
 22 
     | 
    
         
            +
                    Find.find(*files_and_dirs) do |f|
         
     | 
| 
      
 23 
     | 
    
         
            +
                      files << f unless(opts[:exclude] && f.include?(opts[:exclude]))
         
     | 
| 
      
 24 
     | 
    
         
            +
                    end
         
     | 
| 
       22 
25 
     | 
    
         
             
                    send_files(files, dest_dir)
         
     | 
| 
       23 
26 
     | 
    
         
             
                  end
         
     | 
| 
       24 
27 
     | 
    
         
             
                end
         
     | 
    
        data/lib/gusteau/ssh_config.rb
    CHANGED
    
    
    
        data/lib/gusteau/version.rb
    CHANGED
    
    
| 
         @@ -19,14 +19,14 @@ describe Gusteau::Bureau do 
     | 
|
| 
       19 
19 
     | 
    
         
             
              describe "#generate!" do
         
     | 
| 
       20 
20 
     | 
    
         
             
                before { subject.generate!(false) }
         
     | 
| 
       21 
21 
     | 
    
         
             
                it "should create a basic structure" do
         
     | 
| 
       22 
     | 
    
         
            -
                  assert  
     | 
| 
      
 22 
     | 
    
         
            +
                  assert File.exists?(bureau_path)
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
                  %w{ Berksfile Vagrantfile .kitchen.yml }.each do |f|
         
     | 
| 
       25 
25 
     | 
    
         
             
                    assert File.exists?("#{bureau_path}/#{f}")
         
     | 
| 
       26 
26 
     | 
    
         
             
                  end
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
                  %w{ data_bags site-cookbooks test }.each do |d|
         
     | 
| 
       29 
     | 
    
         
            -
                    assert  
     | 
| 
      
 29 
     | 
    
         
            +
                    assert File.exists?("#{bureau_path}/#{d}")
         
     | 
| 
       30 
30 
     | 
    
         
             
                  end
         
     | 
| 
       31 
31 
     | 
    
         
             
                end
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
         @@ -13,7 +13,7 @@ describe Gusteau::Config do 
     | 
|
| 
       13 
13 
     | 
    
         
             
                let(:nodes) { Gusteau::Config.nodes("./spec/config/remi.yml") }
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
                it "should name nodes as per environment-node" do
         
     | 
| 
       16 
     | 
    
         
            -
                  nodes.keys.must_equal ["production-db", "production-www"]
         
     | 
| 
      
 16 
     | 
    
         
            +
                  nodes.keys.sort.must_equal ["production-db", "production-www"]
         
     | 
| 
       17 
17 
     | 
    
         
             
                end
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                it "should override run_list if defined for a node" do
         
     | 
| 
         @@ -2,7 +2,7 @@ require './spec/spec_helper' 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            describe Gusteau::Log do
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
              let(:fixed_time)   { Time. 
     | 
| 
      
 5 
     | 
    
         
            +
              let(:fixed_time)   { Time.parse("2013-07-25 14:40:23 UTC") }
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
              let(:logger_class) { class Example; include Gusteau::Log; end }
         
     | 
| 
       8 
8 
     | 
    
         
             
              let(:logger)       { logger_class.new }
         
     | 
| 
         @@ -13,11 +13,6 @@ Host development-playground 
     | 
|
| 
       13 
13 
     | 
    
         
             
              Port 22
         
     | 
| 
       14 
14 
     | 
    
         
             
              User root
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
            Host staging-www
         
     | 
| 
       17 
     | 
    
         
            -
              HostName staging.myapp.com
         
     | 
| 
       18 
     | 
    
         
            -
              Port 22
         
     | 
| 
       19 
     | 
    
         
            -
              User root
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
16 
     | 
    
         
             
            Host production-db
         
     | 
| 
       22 
17 
     | 
    
         
             
              HostName db.myapp.com
         
     | 
| 
       23 
18 
     | 
    
         
             
              Port 22
         
     | 
| 
         @@ -28,6 +23,11 @@ Host production-www 
     | 
|
| 
       28 
23 
     | 
    
         
             
              Port 22
         
     | 
| 
       29 
24 
     | 
    
         
             
              User billy
         
     | 
| 
       30 
25 
     | 
    
         | 
| 
      
 26 
     | 
    
         
            +
            Host staging-www
         
     | 
| 
      
 27 
     | 
    
         
            +
              HostName staging.myapp.com
         
     | 
| 
      
 28 
     | 
    
         
            +
              Port 22
         
     | 
| 
      
 29 
     | 
    
         
            +
              User root
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
       31 
31 
     | 
    
         
             
            # END GUSTEAU NODES
         
     | 
| 
       32 
32 
     | 
    
         
             
                eos
         
     | 
| 
       33 
33 
     | 
    
         
             
              end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: gusteau
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.2.dev
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 6
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -10,7 +10,7 @@ authors: 
     | 
|
| 
       10 
10 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       11 
11 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       12 
12 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       13 
     | 
    
         
            -
            date: 2013-07- 
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2013-07-05 00:00:00.000000000 Z
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       16 
16 
     | 
    
         
             
              name: optitron
         
     | 
| 
         @@ -124,6 +124,22 @@ dependencies: 
     | 
|
| 
       124 
124 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
       125 
125 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       126 
126 
     | 
    
         
             
                    version: 0.5.2
         
     | 
| 
      
 127 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 128 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 129 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 130 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 131 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 132 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 133 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 134 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 135 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 136 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 137 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 138 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 139 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 140 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 141 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 142 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       127 
143 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       128 
144 
     | 
    
         
             
              name: minitest
         
     | 
| 
       129 
145 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -267,6 +283,9 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       267 
283 
     | 
    
         
             
              - - ! '>='
         
     | 
| 
       268 
284 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       269 
285 
     | 
    
         
             
                  version: '0'
         
     | 
| 
      
 286 
     | 
    
         
            +
                  segments:
         
     | 
| 
      
 287 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 288 
     | 
    
         
            +
                  hash: 1972838977099657427
         
     | 
| 
       270 
289 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       271 
290 
     | 
    
         
             
              none: false
         
     | 
| 
       272 
291 
     | 
    
         
             
              requirements:
         
     |