capistrano-pyenv 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,8 +15,12 @@ module Capistrano
15
15
  _cset(:pyenv_repository, 'git://github.com/yyuu/pyenv.git')
16
16
  _cset(:pyenv_branch, 'master')
17
17
 
18
- _cset(:pyenv_plugins, {})
19
- _cset(:pyenv_plugins_options, {})
18
+ _cset(:pyenv_plugins, {
19
+ 'python-virtualenv' => 'git://github.com/yyuu/python-virtualenv.git',
20
+ })
21
+ _cset(:pyenv_plugins_options, {
22
+ 'python-virtualenv' => {:branch => 'master'},
23
+ })
20
24
  _cset(:pyenv_plugins_path) {
21
25
  File.join(pyenv_path, 'plugins')
22
26
  }
@@ -87,13 +91,15 @@ module Capistrano
87
91
  File.join(pyenv_configure_home, basename)
88
92
  }
89
93
  else
94
+ bash_profile File.join(pyenv_configure_home, '.bash_profile')
95
+ profile = File.join(pyenv_configure_home, '.profile')
90
96
  case File.basename(pyenv_configure_shell)
91
97
  when /bash/
92
- [ File.join(pyenv_configure_home, '.bash_profile') ]
98
+ [ capture("test -f #{profile.dump} && echo #{profile.dump} || echo #{bash_profile.dump}") ]
93
99
  when /zsh/
94
100
  [ File.join(pyenv_configure_home, '.zshenv') ]
95
101
  else # other sh compatible shell such like dash
96
- [ File.join(pyenv_configure_home, '.profile') ]
102
+ [ profile ]
97
103
  end
98
104
  end
99
105
  }
@@ -115,7 +121,8 @@ module Capistrano
115
121
  put(pyenv_configure_script, script)
116
122
  config_map.each { |file, temp|
117
123
  ## (1) copy original config to temporaly file and then modify
118
- execute << "( cp -fp #{file} #{temp} || touch #{temp} )"
124
+ execute << "( test -f #{file} || touch #{file} )"
125
+ execute << "cp -fp #{file} #{temp}"
119
126
  execute << "sed -i -e '/^#{Regexp.escape(pyenv_configure_signature)}/,/^#{Regexp.escape(pyenv_configure_signature)}/d' #{temp}"
120
127
  execute << "echo #{pyenv_configure_signature.dump} >> #{temp}"
121
128
  execute << "cat #{script} >> #{temp}"
@@ -176,7 +183,7 @@ module Capistrano
176
183
  if pyenv_python_version != 'system'
177
184
  run("#{pyenv_cmd} whence #{python} | grep -q #{pyenv_python_version} || #{pyenv_cmd} install #{pyenv_python_version}")
178
185
  end
179
- run("#{pyenv_cmd} exec #{python} --version")
186
+ run("#{pyenv_cmd} exec #{python} --version && #{pyenv_cmd} global #{pyenv_python_version}")
180
187
  }
181
188
  }
182
189
  }
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module PyEnv
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-pyenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
12
+ date: 2012-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano