gap 0.0.3 → 0.0.4

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
@@ -15,6 +15,7 @@ lib/gap/defalut_recipe.rb
15
15
  lib/gap/god_erb.rb
16
16
  lib/gap/patch.rb
17
17
  lib/gap/tasks.rb
18
+ lib/gap/sudo_run.rb
18
19
  lib/gap/tmpl.erb
19
20
  lib/gap/recipes/hg.rb
20
21
  lib/gap/recipes/sys.rb
data/lib/gap/god_erb.rb CHANGED
@@ -11,7 +11,7 @@ module Gap
11
11
 
12
12
  def render
13
13
  # ファイル出力
14
- output = "./god_#{@app}_#{@part}.rb"
14
+ output = "./config/god_#{@app}_#{@part}.rb"
15
15
  txt = @erb.result(binding)
16
16
  fw = File.open(output, 'w')
17
17
  fw.puts(txt)
data/lib/gap/patch.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'yaml'
2
2
  require 'gap/god_erb'
3
3
  require 'gap/tasks'
4
+ require 'gap/sudo_run'
4
5
 
5
6
 
6
7
  module Capistrano
@@ -38,6 +39,7 @@ module Capistrano
38
39
  #コマンドラインオプションにする
39
40
  gap_config = YAML.load_file("config/gap.yml")
40
41
  config.send(:extend,Gap::Tasks)
42
+ config.send(:extend,Gap::SudoRun)
41
43
  config.load do
42
44
 
43
45
  gap_config.each do |env,value|
@@ -0,0 +1,7 @@
1
+ module Gap
2
+ module SudoRun
3
+ def sudo_run command
4
+ run command.gsub(/sudo/,sudo)
5
+ end
6
+ end
7
+ end
data/lib/gap/tasks.rb CHANGED
@@ -41,12 +41,12 @@ module Gap
41
41
  god_config_path = File.join( deploy_to, "config/god_#{application}_#{app}.rb")
42
42
  god_config = Gap::GodErb.new("./gap/tmpl.erb",application, app, commands)
43
43
  upload( god_config.render, god_config_path, :via => :scp)
44
- sudo "rvm-shell '1.9.2@god' -c 'god load #{god_config_path}'"
44
+ sudo "god load #{god_config_path}"
45
45
  end
46
46
 
47
47
  commands.each do |name, command|
48
48
  task(name) do
49
- sudo "rvm-shell '1.9.2@god' -c 'god #{name} #{app}_#{application}'"
49
+ sudo "god #{name} #{app}_#{application}"
50
50
  end
51
51
  end
52
52
  end
@@ -54,7 +54,7 @@ module Gap
54
54
 
55
55
  task(app) do
56
56
  commands.each { |name, command|
57
- task(name) { run command }}
57
+ task(name) { sudo_run command }}
58
58
  end
59
59
 
60
60
  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.3'
5
+ VERSION = '0.0.4'
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.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Takashi Yaguchi
@@ -74,6 +74,7 @@ files:
74
74
  - lib/gap/god_erb.rb
75
75
  - lib/gap/patch.rb
76
76
  - lib/gap/tasks.rb
77
+ - lib/gap/sudo_run.rb
77
78
  - lib/gap/tmpl.erb
78
79
  - lib/gap/recipes/hg.rb
79
80
  - lib/gap/recipes/sys.rb