kuzushi 0.0.54 → 0.0.55

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/README CHANGED
@@ -3,9 +3,8 @@
3
3
  opponent by keeping them slightly off balance.
4
4
 
5
5
  The 'kuzushi' gem is a companion to the 'judo' gem. Judo handles
6
- AWS/instance/volume management of a server based on its specificatoion.
6
+ AWS/instance/volume management of a server based on its specification.
7
7
  Kuzushi handles the management from inside the server by installing packages,
8
8
  setting up drives and users, writing config files, etc
9
9
 
10
- See the Judo readme here: http://github.com/orionz/judo
11
-
10
+ See the Judo README here: http://github.com/heroku/judo
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.54
1
+ 0.0.55
@@ -391,7 +391,8 @@ class Kuzushi
391
391
 
392
392
  def shell(cmd)
393
393
  log "# #{cmd}"
394
- Kernel.system cmd ## FIXME - need to handle/report exceptions here
394
+ Kernel.system cmd
395
+ raise "Command #{cmd} failed with exit code #{$?.to_i}" unless $?.success?
395
396
  end
396
397
 
397
398
  def init?
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 54
9
- version: 0.0.54
8
+ - 55
9
+ version: 0.0.55
10
10
  platform: ruby
11
11
  authors:
12
12
  - Orion Henry
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-31 00:00:00 -04:00
17
+ date: 2010-06-15 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -59,8 +59,6 @@ files:
59
59
  - bin/kuzushi-erb
60
60
  - bin/kuzushi-setup
61
61
  - lib/kuzushi.rb
62
- - spec/base.rb
63
- - spec/kuzushi_spec.rb
64
62
  has_rdoc: true
65
63
  homepage: http://github.com/orionhenry/kuzushi
66
64
  licenses: []
@@ -91,6 +89,5 @@ rubygems_version: 1.3.6
91
89
  signing_key:
92
90
  specification_version: 3
93
91
  summary: A tool used by the sumo gem for performing instance setup and management in AWS
94
- test_files:
95
- - spec/base.rb
96
- - spec/kuzushi_spec.rb
92
+ test_files: []
93
+
@@ -1,21 +0,0 @@
1
- require File.dirname(__FILE__) + '/../lib/kuzushi'
2
-
3
- require 'bacon'
4
- require 'mocha/standalone'
5
- require 'mocha/object'
6
-
7
- class Bacon::Context
8
- include Mocha::API
9
-
10
- def initialize(name, &block)
11
- @name = name
12
- @before, @after = [
13
- [lambda { mocha_setup }],
14
- [lambda { mocha_verify ; mocha_teardown }]
15
- ]
16
- @block = block
17
- end
18
-
19
- def xit(desc, &bk)
20
- end
21
- end
@@ -1,106 +0,0 @@
1
- require File.dirname(__FILE__) + '/base'
2
-
3
- describe Kuzushi do
4
- before do
5
- @url = "http://myurl/foo"
6
- @kuzushi = Kuzushi.new(@url)
7
- @kuzushi.stubs(:log) ## dont want to see the output
8
- @kuzushi.stubs(:config_names).returns(["foo"])
9
- @kuzushi.stubs(:load_config_stack)
10
- end
11
-
12
- it "processes a simple file" do
13
- @kuzushi.stubs(:config).returns( {
14
- "files" => [ {
15
- "file" => "/var/lib/zing.conf"
16
- } ] } )
17
- @kuzushi.expects(:http_get).with("#{@url}/files/zing.conf").returns( "123" )
18
- @kuzushi.expects(:put_file).with("123", "/tmp/kuzushi/zing.conf")
19
- @kuzushi.expects(:cp_file).with("/tmp/kuzushi/zing.conf", "/var/lib/zing.conf")
20
- should.not.raise { @kuzushi.start }
21
- end
22
-
23
- it "processes a simple file with a different source" do
24
- @kuzushi.stubs(:config).returns( {
25
- "files" => [ {
26
- "file" => "/var/lib/zing.conf",
27
- "source" => "zing-8.2"
28
- } ] } )
29
- @kuzushi.expects(:http_get).with("#{@url}/files/zing-8.2").returns( "123" )
30
- @kuzushi.expects(:put_file).with("123", "/tmp/kuzushi/zing-8.2")
31
- @kuzushi.expects(:cp_file).with("/tmp/kuzushi/zing-8.2", "/var/lib/zing.conf")
32
- should.not.raise { @kuzushi.start }
33
- end
34
-
35
- it "processes a file from an erb template" do
36
- @kuzushi.stubs(:config).returns( {
37
- "files" => [ {
38
- "file" => "/var/lib/zing.conf",
39
- "template" => "zing-8.2.erb"
40
- } ] } )
41
- @kuzushi.expects(:http_get).with("#{@url}/templates/zing-8.2.erb").returns( "I love <%= ['e','r','b'].join('') %>" )
42
- @kuzushi.expects(:put_file).with("I love erb", "/tmp/kuzushi/zing-8.2.erb")
43
- @kuzushi.expects(:cp_file).with("/tmp/kuzushi/zing-8.2.erb", "/var/lib/zing.conf")
44
- should.not.raise { @kuzushi.start }
45
- end
46
-
47
- it "can handle a basic crontab with a specified file" do
48
- @kuzushi.stubs(:config).returns( {
49
- "crontab" => [ {
50
- "file" => "mycrontab",
51
- } ] } )
52
- @kuzushi.expects(:http_get).with("#{@url}/files/mycrontab").returns("abc123")
53
- @kuzushi.expects(:put_file).with("abc123", tmpfile = "/tmp/kuzushi/mycrontab")
54
- @kuzushi.expects(:shell).with("crontab -u root #{tmpfile}")
55
- should.not.raise { @kuzushi.start }
56
- end
57
-
58
- it "can handle a basic crontab with a specified source or a different user" do
59
- @kuzushi.stubs(:config).returns( {
60
- "crontab" => [ {
61
- "source" => "mycrontab",
62
- "user" => "bob",
63
- } ] } )
64
- @kuzushi.expects(:http_get).with("#{@url}/files/mycrontab").returns("abc123")
65
- @kuzushi.expects(:put_file).with("abc123", tmpfile = "/tmp/kuzushi/mycrontab")
66
- @kuzushi.expects(:shell).with("crontab -u bob #{tmpfile}")
67
- should.not.raise { @kuzushi.start }
68
- end
69
-
70
- it "can handle a basic crontab with a specified source" do
71
- @kuzushi.stubs(:config).returns( {
72
- "crontab" => [ {
73
- "template" => "mycrontab.erb",
74
- } ] } )
75
- @kuzushi.expects(:http_get).with("#{@url}/templates/mycrontab.erb").returns("Hello <%= 'world' %>")
76
- @kuzushi.expects(:put_file).with("Hello world", tmpfile = "/tmp/kuzushi/mycrontab.erb")
77
- @kuzushi.expects(:shell).with("crontab -u root #{tmpfile}")
78
- should.not.raise { @kuzushi.start }
79
- end
80
-
81
- it "will run external scripts" do
82
- @kuzushi.stubs(:config).returns( {
83
- "before" => "script.sh"
84
- })
85
- @kuzushi.expects(:external_script).with("script.sh")
86
- should.not.raise { @kuzushi.start }
87
- end
88
-
89
- it "will run inline scripts" do
90
- @kuzushi.stubs(:config).returns( {
91
- "before" => "#!/bin/bash\n echo 'hello'\n"
92
- })
93
- @kuzushi.expects(:inline_script).with("#!/bin/bash\n echo 'hello'\n")
94
- should.not.raise { @kuzushi.start }
95
- end
96
-
97
- it "will run sets of scripts" do
98
- @kuzushi.stubs(:config).returns( {
99
- "before" => [ "script.sh", "#!/bin/bash\n echo 'hello'\n" ]
100
- })
101
- @kuzushi.expects(:inline_script).with("#!/bin/bash\n echo 'hello'\n")
102
- @kuzushi.expects(:external_script).with("script.sh")
103
- should.not.raise { @kuzushi.start }
104
- end
105
- end
106
-