capistrano-virtualenv 0.0.2 → 0.0.3

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.
@@ -1,5 +1,4 @@
1
1
 
2
- require 'tempfile'
3
2
  require 'uri'
4
3
 
5
4
  module Capistrano
@@ -34,6 +33,7 @@ module Capistrano
34
33
  _cset(:virtualenv_requirements_file) { # secondary package list
35
34
  File.join(release_path, 'requirements.txt')
36
35
  }
36
+ _cset(:virtualenv_build_requirements, {})
37
37
  _cset(:virtualenv_install_packages, []) # apt packages
38
38
 
39
39
  ## shared virtualenv:
@@ -175,11 +175,21 @@ module Capistrano
175
175
 
176
176
  task(:update_shared, :except => { :no_release => true }) {
177
177
  unless virtualenv_requirements.empty?
178
- tempfile = Tempfile.new(File.basename($0))
179
- top.put(virtualenv_requirements.join("\n"), tempfile.path)
180
- run("diff -u #{virtualenv_requirements_file} #{tempfile.path} || mv -f #{tempfile.path} #{virtualenv_requirements_file}; rm -f #{tempfile.path}")
178
+ tempfile = "/tmp/requirements.txt.#{$$}"
179
+ begin
180
+ top.put(virtualenv_requirements.join("\n"), tempfile)
181
+ run("diff -u #{virtualenv_requirements_file} #{tempfile} || mv -f #{tempfile} #{virtualenv_requirements_file}")
182
+ ensure
183
+ run("rm -f #{tempfile}")
184
+ end
181
185
  end
182
186
  run("touch #{virtualenv_requirements_file} && #{virtualenv_shared_pip_cmd} install #{virtualenv_pip_install_options.join(' ')} -r #{virtualenv_requirements_file}")
187
+
188
+ execute = virtualenv_build_requirements.map { |package, options|
189
+ build_options = ( options || [] )
190
+ "#{virtualenv_shared_pip_cmd} install #{virtualenv_pip_install_options.join(' ')} #{build_options.join(' ')} #{package.dump}"
191
+ }
192
+ run(execute.join(' && ')) unless execute.empty?
183
193
  }
184
194
 
185
195
  task(:create_release, :except => { :no_release => true }) {
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Virtualenv
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-virtualenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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-08-30 00:00:00.000000000 Z
12
+ date: 2012-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -68,4 +68,3 @@ signing_key:
68
68
  specification_version: 3
69
69
  summary: a capistrano recipe to deploy python apps with virtualenv.
70
70
  test_files: []
71
- has_rdoc: