Commit d10e94ce authored by Eloy Durán's avatar Eloy Durán

[Sandbox] Allow sandbox-pod to execute any tool inside a rbenv prefix.

parent e3ac34f5
......@@ -11,6 +11,7 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
Ruby (1.8.7).
[#939](https://github.com/CocoaPods/CocoaPods/issues/939#issuecomment-18396063)
* Allow sandbox-pod to execute any tool inside the Xcode.app bundle.
* Allow sandbox-pod to execute any tool inside a rbenv prefix.
## 0.20.1
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.20.0...0.20.1)
......
......@@ -124,14 +124,26 @@ class Profile
RbConfig::CONFIG['prefix']
end
def prefix_from_bin(bin_name)
unless (path = `which #{bin_name}`.strip).empty?
File.dirname(File.dirname(path))
end
end
def prefixes
prefixes = ['/bin', '/usr/bin', '/usr/libexec', xcode_app_path]
prefixes << `brew --prefix`.strip unless `which brew`.strip.empty?
# From asking people, it seems MacPorts does not have a `prefix` command, like
# Homebrew does, so make an educated guess:
unless (port = `which port`.strip).empty?
prefixes << File.dirname(File.dirname(port))
if port_prefix = prefix_from_bin('port')
prefixes << port_prefix
end
if rbenv_prefix = prefix_from_bin('rbenv')
prefixes << rbenv_prefix
end
prefixes
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment