spatula 0.0.2 → 0.0.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.
data/lib/spatula/cook.rb CHANGED
@@ -16,16 +16,17 @@ module Spatula
16
16
  end
17
17
 
18
18
  def run
19
- sh "rake test"
19
+ Dir["**/*.rb"].each do |recipe|
20
+ ok = sh "ruby -c #{recipe} >/dev/null 2>&1"
21
+ raise "Syntax error in #{recipe}" if not ok
22
+ end
20
23
  sh "rsync -rlP --rsh=\"ssh -p#@port\" --delete --exclude '.*' ./ #@server:#{REMOTE_CHEF_PATH}"
21
- sh "ssh -t -p #@port -A #@server \"cd #{REMOTE_CHEF_PATH}; sudo /var/lib/gems/1.8/bin/chef-solo -c config/solo.rb -j config/#@node.json \""
24
+ sh "ssh -t -p #@port -A #@server \"cd #{REMOTE_CHEF_PATH}; sudo chef-solo -c config/solo.rb -j config/#@node.json \""
22
25
  end
23
26
 
24
27
  private
25
28
  def sh(command)
26
- stdout = `#{command}`
27
- puts stdout
28
- stdout
29
+ system command
29
30
  end
30
31
  end
31
32
  end
@@ -12,16 +12,23 @@ module Spatula
12
12
  @port = port
13
13
  end
14
14
 
15
+ def ssh command
16
+ sh %Q|ssh -t -p #@port #@server "#{command.gsub('"', '\\"')}"|
17
+ end
18
+
15
19
  def run
16
- sh %Q|ssh -t -p #@port #@server sudo aptitude -y install ruby rubygems rubygems1.8 irb ri libopenssl-ruby1.8 libshadow-ruby1.8 ruby1.8-dev gcc g++ rsync |
17
- sh %Q|ssh -t -p #@port #@server sudo gem install rdoc chef ohai --no-ri --no-rdoc --source http://gems.opscode.com --source http://gems.rubyforge.org|
20
+ ssh "sudo apt-get update"
21
+ ssh "sudo aptitude -y install ruby irb ri libopenssl-ruby1.8 libshadow-ruby1.8 ruby1.8-dev gcc g++ rsync"
22
+ ssh "curl -L 'http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz' | tar xvzf -"
23
+ ssh "cd rubygems* && sudo ruby setup.rb --no-ri --no-rdoc"
24
+ ssh "sudo ln -sfv /usr/bin/gem1.8 /usr/bin/gem"
25
+
26
+ ssh "sudo gem install rdoc chef ohai --no-ri --no-rdoc --source http://gems.opscode.com --source http://gems.rubyforge.org"
18
27
  end
19
28
 
20
29
  private
21
30
  def sh(command)
22
- stdout = `#{command}`
23
- puts stdout
24
- stdout
31
+ system command
25
32
  end
26
33
  end
27
34
  end
metadata CHANGED
@@ -1,12 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spatula
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 2
9
- version: 0.0.2
4
+ version: 0.0.3
10
5
  platform: ruby
11
6
  authors:
12
7
  - Trotter Cashion
@@ -14,7 +9,7 @@ autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
11
 
17
- date: 2010-02-21 00:00:00 -05:00
12
+ date: 2010-03-04 00:00:00 -05:00
18
13
  default_executable:
19
14
  dependencies: []
20
15
 
@@ -46,20 +41,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
41
  requirements:
47
42
  - - ">="
48
43
  - !ruby/object:Gem::Version
49
- segments:
50
- - 0
51
44
  version: "0"
45
+ version:
52
46
  required_rubygems_version: !ruby/object:Gem::Requirement
53
47
  requirements:
54
48
  - - ">="
55
49
  - !ruby/object:Gem::Version
56
- segments:
57
- - 0
58
50
  version: "0"
51
+ version:
59
52
  requirements: []
60
53
 
61
54
  rubyforge_project:
62
- rubygems_version: 1.3.6
55
+ rubygems_version: 1.3.5
63
56
  signing_key:
64
57
  specification_version: 3
65
58
  summary: Command line helper app for use with Chef