Skip to content

Commit

Permalink
Remove leading space in Ruby help message. (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
t4lz authored Sep 11, 2023
1 parent 6efc6f3 commit b74199b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions changelog.d/+leading-space-ruby-error.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove leading space from non-RVM Ruby help message.
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,24 @@ class RubyMineRunConfigurationExtension : RubyRunConfigurationExtension() {
cmdLine.exePath = patched
}

// TODO: would be nice to have a more robust RVM detection mechanism.
val isRvm = cmdLine.exePath.contains("/.rvm/rubies/")
if (isMac && !isRvm) {
val e = MirrordError(
"At the moment, only RVM Rubies are supported by mirrord on RubyMine on macOS, due to SIP.",
" Support for other Rubies is tracked on " +
"https://github.com/metalbear-co/mirrord-intellij/issues/134."
)
e.showHelp(configuration.project)
throw e
}

if (isMac && isRvm) {
val path = createTempFile("mirrord-ruby-launcher-", ".sh")
// Using patched exe inside the launcher script.
path.writeText("DYLD_INSERT_LIBRARIES=${currentEnv["DYLD_INSERT_LIBRARIES"]} ${cmdLine.exePath} $@")
cmdLine.exePath = path.pathString
path.toFile().setExecutable(true)
if (isMac) {
// TODO: would be nice to have a more robust RVM detection mechanism.
val isRvm = cmdLine.exePath.contains("/.rvm/rubies/")
if (isRvm) {
val path = createTempFile("mirrord-ruby-launcher-", ".sh")
// Using patched exe inside the launcher script.
path.writeText("DYLD_INSERT_LIBRARIES=${currentEnv["DYLD_INSERT_LIBRARIES"]} ${cmdLine.exePath} $@")
cmdLine.exePath = path.pathString
path.toFile().setExecutable(true)
} else {
val e = MirrordError(
"At the moment, only RVM Rubies are supported by mirrord on RubyMine on macOS, due to SIP.",
"Support for other Rubies is tracked on " +
"https://github.com/metalbear-co/mirrord-intellij/issues/134."
)
e.showHelp(configuration.project)
throw e
}
}
}
}
Expand Down

0 comments on commit b74199b

Please sign in to comment.