slushy 0.1.2 → 0.1.3

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.
@@ -87,10 +87,11 @@ class Slushy::Instance
87
87
  def converge(cookbooks_path) # TODO: find the standard Chef term for this
88
88
  puts "Copying chef resources from provision directory..."
89
89
  cookbooks_path = "#{cookbooks_path}/" unless cookbooks_path.to_s.end_with?('/')
90
+ run_command!('sudo rm -rf /tmp/chef-solo') # scp does not clobber existing files
90
91
  scp(cookbooks_path, '/tmp/chef-solo', :recursive => true)
91
92
  puts "Converging server, this may take a while (10-20 minutes)"
92
93
  path_part = 'PATH=/var/lib/gems/1.8/bin:/usr/local/bin:$PATH'
93
- cmd = "cd /tmp/chef-solo && #{path_part} sudo chef-solo -c solo.rb -j dna.json"
94
+ cmd = %Q{cd /tmp/chef-solo && sudo sh -c "#{path_part} chef-solo -c solo.rb -j dna.json"}
94
95
  run_command!(cmd)
95
96
  end
96
97
 
@@ -1,3 +1,3 @@
1
1
  module Slushy
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -187,8 +187,9 @@ describe Slushy::Instance do
187
187
 
188
188
  describe "#converge" do
189
189
  it "converges the given instance" do
190
+ instance.should_receive(:run_command!).ordered.with("sudo rm -rf /tmp/chef-solo")
190
191
  instance.should_receive(:scp).ordered.with('some_path/', "/tmp/chef-solo", :recursive => true).and_return(true)
191
- instance.should_receive(:run_command).ordered.with("cd /tmp/chef-solo && sudo /var/lib/gems/1.8/bin/chef-solo -c solo.rb -j dna.json").and_return(true)
192
+ instance.should_receive(:run_command!).ordered.with(%Q{cd /tmp/chef-solo && sudo sh -c "PATH=/var/lib/gems/1.8/bin:/usr/local/bin:$PATH chef-solo -c solo.rb -j dna.json"}).and_return(true)
192
193
  capture_stdout { instance.converge(Pathname.new('some_path')) }
193
194
  end
194
195
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slushy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-07-09 00:00:00.000000000 Z
14
+ date: 2012-09-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog
@@ -113,18 +113,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  - - ! '>='
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
- segments:
117
- - 0
118
- hash: -3387664004883499874
119
116
  required_rubygems_version: !ruby/object:Gem::Requirement
120
117
  none: false
121
118
  requirements:
122
119
  - - ! '>='
123
120
  - !ruby/object:Gem::Version
124
121
  version: '0'
125
- segments:
126
- - 0
127
- hash: -3387664004883499874
128
122
  requirements: []
129
123
  rubyforge_project:
130
124
  rubygems_version: 1.8.24