Skip to content

Commit

Permalink
Support non rvm ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
shuky19 committed Feb 24, 2014
1 parent 043dea6 commit ac216c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions debugger/ruby_imp/ruby_debugger_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def validation_environment(self):
try:
if os.name == "posix":
# On Unix using rvm and bash
rvm_load = "[[ -s \"$HOME/.rvm/scripts/rvm\" ]] && source \"$HOME/.rvm/scripts/rvm\""
validate_command = rvm_load + " && exec ruby '" + PathHelper.get_ruby_version_discoverer()+"'"
rvm_load = "[[ -s \"$HOME/.rvm/scripts/rvm\" ]] 2> /dev/null ; source \"$HOME/.rvm/scripts/rvm\" 2> /dev/null"
validate_command = rvm_load + " ; exec ruby '" + PathHelper.get_ruby_version_discoverer()+"'"
self.ruby_version = subprocess.Popen(["bash", "-c", validate_command], stdout=subprocess.PIPE).communicate()[0].splitlines()
else:
# On Windows not using shell, so the proces is not visible to the user
Expand Down Expand Up @@ -80,8 +80,8 @@ def start_process(self, current_directory, file_name, args):
# Initialize params acourding to OS type
if os.name == "posix":
# On Unix using exec and shell to get environemnt variables of ruby version
rvm_load = "[[ -s \"$HOME/.rvm/scripts/rvm\" ]] && source \"$HOME/.rvm/scripts/rvm\""
process_command = rvm_load + " && exec ruby"+directory+requires+program
rvm_load = "[[ -s \"$HOME/.rvm/scripts/rvm\" ]] 2> /dev/null; source \"$HOME/.rvm/scripts/rvm\" 2> /dev/null"
process_command = rvm_load + " ; exec ruby"+directory+requires+program
process_params = ["bash", "-c", "\""+process_command+"\""]
self.process = subprocess.Popen(" ".join(process_params), stdin = subprocess.PIPE, stderr = subprocess.PIPE, stdout=subprocess.PIPE, bufsize=1, shell=True, cwd=sublime.active_window().folders()[0])
else:
Expand Down

0 comments on commit ac216c2

Please sign in to comment.