gap 0.0.10 → 0.0.11

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/Manifest.txt CHANGED
@@ -21,3 +21,4 @@ lib/gap/tmpl.erb
21
21
  lib/gap/recipes/hg.rb
22
22
  lib/gap/recipes/sys.rb
23
23
  lib/gap/recipes/ruby.rb
24
+ lib/gap/recipes/god.rb
@@ -1,5 +1,6 @@
1
1
  load File.expand_path './recipes/hg.rb', File.dirname(__FILE__)
2
2
  load File.expand_path './recipes/sys.rb', File.dirname(__FILE__)
3
+ load File.expand_path './recipes/god.rb', File.dirname(__FILE__)
3
4
  #load 'gap/recipes/hg.rb'
4
5
  #load 'gap/recipes/sys.rb'
5
6
 
@@ -0,0 +1,20 @@
1
+ namespace :god do
2
+ task :setup do
3
+ install
4
+ start
5
+ end
6
+ task :install do
7
+ version,gemset = rvm_god_string.split("@")
8
+ sudo "rvm-shell '#{version}' -c 'rvm gemset create #{gemset}'"
9
+ sudo "rvm-shell '#{rvm_god_string}' -c 'gem install god --no-ri --no-rdoc'"
10
+ end
11
+
12
+ task :start do
13
+ sudo "god --log-level info"
14
+ end
15
+
16
+ task :quit do
17
+ sudo "god quit"
18
+ end
19
+
20
+ end
data/lib/gap/tasks.rb CHANGED
@@ -24,10 +24,12 @@ module Gap
24
24
  start
25
25
  end
26
26
 
27
- task(:god) do
28
- value.each do |app,commands|
29
- send(app)
30
- send(:god)
27
+ namespace :god do
28
+ task(:config) do
29
+ value.each do |app,commands|
30
+ send(app)
31
+ send(:config)
32
+ end
31
33
  end
32
34
  end
33
35
  end
@@ -43,7 +45,6 @@ module Gap
43
45
  else
44
46
 
45
47
  val.each do |a, v|
46
-
47
48
  case a
48
49
  when "role"
49
50
  v.each { |attr, val| role attr.to_sym, val } if v
@@ -52,13 +53,16 @@ module Gap
52
53
  when "task"
53
54
  if god
54
55
  task(attr) do
55
- task(:god) do
56
- god_config_path = File.join( deploy_to, "config/god_#{application}_#{attr}.rb")
57
- tmpl_path = File.expand_path 'tmpl.erb', File.dirname(__FILE__)
58
- god_config = Gap::GodErb.new(tmpl_path,application, attr, v)
59
- upload( god_config.render, god_config_path, :via => :scp)
60
- use_god_rvm do
61
- sudo "god load #{god_config_path}"
56
+
57
+ namespace :god do
58
+ task(:config) do
59
+ god_config_path = File.join( deploy_to, "config/god_#{application}_#{attr}.rb")
60
+ tmpl_path = File.expand_path 'tmpl.erb', File.dirname(__FILE__)
61
+ god_config = Gap::GodErb.new(tmpl_path,application, attr, v)
62
+ upload( god_config.render, god_config_path, :via => :scp)
63
+ use_god_rvm do
64
+ sudo "god load #{god_config_path}"
65
+ end
62
66
  end
63
67
  end
64
68
 
@@ -78,7 +82,6 @@ module Gap
78
82
 
79
83
  end
80
84
  else
81
-
82
85
  task(attr) do
83
86
  v.each do |name, command|
84
87
  task(name) { sudo_run command }
@@ -96,7 +99,6 @@ module Gap
96
99
  ruby_string_tmp = rvm_ruby_string
97
100
  set :rvm_ruby_string, rvm_god_string
98
101
  yield
99
- set :rvm_ruby_string, ruby_string_tmp
100
102
  end
101
103
  end
102
104
  end
data/lib/gap.rb CHANGED
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module Gap
5
- VERSION = '0.0.10'
5
+ VERSION = '0.0.11'
6
6
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gap
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.10
5
+ version: 0.0.11
6
6
  platform: ruby
7
7
  authors:
8
8
  - Takashi Yaguchi
@@ -80,6 +80,7 @@ files:
80
80
  - lib/gap/recipes/hg.rb
81
81
  - lib/gap/recipes/sys.rb
82
82
  - lib/gap/recipes/ruby.rb
83
+ - lib/gap/recipes/god.rb
83
84
  - .gemtest
84
85
  homepage: http://github.com/#{github_username}/#{project_name}
85
86
  licenses: []