subcontractor 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,7 +18,7 @@ gem install subcontractor
18
18
  or with bundler
19
19
 
20
20
  ```ruby
21
- gem 'subcontractor', '0.3.0'
21
+ gem 'subcontractor', '0.7.0'
22
22
  ```
23
23
 
24
24
  The gem provides an executable called ```subcontract``` that you will use from your Procfile. You can see what it does by running ```subcontract --help```
@@ -26,6 +26,7 @@ The gem provides an executable called ```subcontract``` that you will use from y
26
26
  ```
27
27
  USAGE: subcontract [options] -- executable
28
28
  -r, --rvm RVM run in a specific RVM (use `.` for ruby from `PATH`)
29
+ -b, --rbenv RBENV run in a specific RBENV
29
30
  -d, --chdir PATH chdir to PATH before starting process
30
31
  -s, --signal SIGNAL signal to send to process to kill it, default TERM
31
32
  ```
@@ -52,6 +53,12 @@ Newer versions of RVM use a slightly different syntax for referencing the app .r
52
53
  new_rvm_app: push: subcontract --rvm --with-rubies default-with-rvmrc do --chdir ../push --signal INT -- bundle exec rails server
53
54
  ```
54
55
 
56
+ You can use specific rbenv version.
57
+
58
+ ```
59
+ rbenv_app: bundle exec subcontract --rbenv 'ree-1.8.7-2012.02' --chdir ~/rbenv_app -- bundle exec rails server -p 3001
60
+ ```
61
+
55
62
  ### Contributions
56
63
  * Fork the project
57
64
  * Make your change
@@ -63,3 +70,4 @@ new_rvm_app: push: subcontract --rvm --with-rubies default-with-rvmrc do --chdir
63
70
  * Drew Olson [github](http://github.com/drewolson) [blog](http://fingernailsinoatmeal.com/) [twitter](http://twitter.com/drewolson)
64
71
  * Paul Gross [github](http://github.com/pgr0ss) [blog](http://www.pgrs.net) [twitter](http://twitter.com/pgr0ss)
65
72
  * Rune Skjoldborg Madsen [github](https://github.com/runemadsen)
73
+ * Masahiro Ihara [github](http://github.com/ihara2525) [twitter](http://twitter.com/ihara2525)
@@ -7,6 +7,7 @@ module SafePty
7
7
  def self.spawn command, &block
8
8
  if Object.const_defined?('Bundler')
9
9
  Bundler.with_clean_env do
10
+ self.clear_more_env
10
11
  self.spawn_internal command, &block
11
12
  end
12
13
  else
@@ -26,6 +27,10 @@ module SafePty
26
27
 
27
28
  $?.exitstatus
28
29
  end
30
+
31
+ def self.clear_more_env
32
+ ['GEM_HOME', 'GEM_PATH', 'RUBYOPT', 'RBENV_DIR'].each { |e| ENV.delete(e) }
33
+ end
29
34
  end
30
35
 
31
36
  module Subcontractor
@@ -71,6 +76,7 @@ module Subcontractor
71
76
 
72
77
  def build_command(parts, options)
73
78
  parts.unshift("rvm #{options[:rvm]} exec") if options.has_key?(:rvm)
79
+ parts.unshift("env RBENV_VERSION=#{options[:rbenv]} rbenv exec") if options.has_key?(:rbenv)
74
80
  parts.join(' ')
75
81
  end
76
82
 
@@ -81,6 +87,9 @@ module Subcontractor
81
87
  opt.on('-r', '--rvm RVM', 'run in a specific RVM') do |rvm|
82
88
  options[:rvm] = rvm
83
89
  end
90
+ opt.on('-b', '--rbenv RBENV', 'run in a specific RBENV') do |rbenv|
91
+ options[:rbenv] = rbenv
92
+ end
84
93
  opt.on('-d', '--chdir PATH', 'chdir to PATH before starting process') do |path|
85
94
  options[:chdir] = path
86
95
  end
@@ -1,3 +1,3 @@
1
1
  module Subcontractor
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subcontractor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
5
- prerelease:
4
+ hash: 3
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 1
10
- version: 0.6.1
8
+ - 7
9
+ - 0
10
+ version: 0.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Pitluga
@@ -15,7 +15,8 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-02-27 00:00:00 Z
18
+ date: 2013-03-04 00:00:00 -08:00
19
+ default_executable:
19
20
  dependencies: []
20
21
 
21
22
  description: rvm aware process launcher for foreman
@@ -46,6 +47,7 @@ files:
46
47
  - lib/subcontractor/cli.rb
47
48
  - lib/subcontractor/version.rb
48
49
  - subcontractor.gemspec
50
+ has_rdoc: true
49
51
  homepage: https://github.com/pitluga/subcontractor
50
52
  licenses: []
51
53
 
@@ -75,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
77
  requirements: []
76
78
 
77
79
  rubyforge_project: subcontractor
78
- rubygems_version: 1.8.24
80
+ rubygems_version: 1.3.7
79
81
  signing_key:
80
82
  specification_version: 3
81
83
  summary: rvm aware process launcher for foreman