kuzushi 0.0.34 → 0.0.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +3 -1
  2. data/VERSION +1 -1
  3. data/lib/kuzushi.rb +6 -18
  4. metadata +3 -3
data/README CHANGED
@@ -2,8 +2,10 @@
2
2
  Kuzushi ( ka ZU she ) - a technique used by martial artists to control of an
3
3
  opponent by keeping them slightly off balance.
4
4
 
5
- The 'kuzushi' gem is a companion to the 'sumo' gem. Sumo handles
5
+ The 'kuzushi' gem is a companion to the 'judo' gem. Judo handles
6
6
  AWS/instance/volume management of a server based on its specificatoion.
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
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.34
1
+ 0.0.35
@@ -13,16 +13,15 @@ require 'erb'
13
13
  ## user configs
14
14
 
15
15
  class Kuzushi
16
- attr_accessor :config, :config_names
16
+ attr_accessor :config
17
17
 
18
18
  def initialize(url)
19
19
  @url = url
20
20
  @base_url = File.dirname(url)
21
- if @url =~ /s3.amazonaws.com.*\/([^\/]*).(\d+).tar.gz/
21
+ if @url =~ /s3.amazonaws.com.*\/([^\/]*)[.](\d+)[.]tar[.]gz/
22
22
  @name = $1
23
23
  @version = $2
24
24
  end
25
- @config_names = []
26
25
  @configs = []
27
26
  @packages = []
28
27
  @tasks = []
@@ -37,12 +36,15 @@ class Kuzushi
37
36
  shell "mkdir -p /tmp/kuzushi/"
38
37
  shell "cd /tmp/kuzushi/ ; curl --silent '#{@url}' | tar xzv"
39
38
  @config = JSON.parse(File.read("/tmp/kuzushi/#{@name}/config.json"))
40
- @config_names = [ @name ]
41
39
  end
42
40
 
43
41
  def start
44
42
  # load_config_stack(@name)
45
43
  boot
44
+ run
45
+ end
46
+
47
+ def run
46
48
  process_stack
47
49
  log "----"
48
50
  @tasks.each do |t|
@@ -64,16 +66,6 @@ class Kuzushi
64
66
  RestClient.get(url)
65
67
  end
66
68
 
67
- def load_config_stack(name)
68
- @config_names << name
69
- @configs << JSON.parse(http_get("#{@base_url}/#{name}").body)
70
- if import = @configs.last["import"]
71
- load_config_stack(import)
72
- else
73
- @config = @configs.reverse.inject({}) { |i,c| i.merge(c) }
74
- end
75
- end
76
-
77
69
  def process_stack
78
70
  script get("before")
79
71
 
@@ -112,11 +104,7 @@ class Kuzushi
112
104
  def process_packages
113
105
  @packages = get_array("packages")
114
106
  task "install packages" do
115
- # shell "apt-get update"
116
107
  shell "apt-get install -y #{@packages.join(" ")}" unless @packages.empty?
117
- # @packages.each do |pkg|
118
- # shell "apt-get install -y #{pkg}"
119
- # end
120
108
  end
121
109
  end
122
110
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 34
9
- version: 0.0.34
8
+ - 35
9
+ version: 0.0.35
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-03-10 00:00:00 -05:00
17
+ date: 2010-03-17 00:00:00 -04:00
18
18
  default_executable: kuzushi
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency