Support for uru_rt exec

Issue #106 new
Alexandr Evstigneev created an issue

There is a request for supporting URU in RubyMine. And I'd like to do that. But it's hard with current implementation.

There are some obstacles that could be fixed in uru and made it more machine-friendly.

Would be really nice to have exec command for uru_rt, like: uru_rt exec TAG some_arbirtrary_command Expecting uru to configure environment and just run a command. Without additional things, like necessity to eval admin install or smth.

If this is not possible, would be nice to be able to suppress unnecessary output. E.g. when I use uru_rt TAG i'd like to be able to suppress output currently using blabla. in such cases I'll be able to use something like uru_rt TAG && some_arbitrary_command.

First case is preferable.

Comments (9)

  1. Jon repo owner

    Interesting. So I'm clear on what you're requesting...

    1) Why would you use uru_rt rather than one of the uru shel wrappers? The shell wrappers do some of the magic (e.g. manages a shell's session envars) in combo with uru_rt as you can see from these bash and fish templates

    2) The overall idea is for uru to be able to run an arbitrary ruby command using a single tagged ruby installation, i.e. it's a complement to the existing uru ruby some_arbitrary_command?

    3) This request is for Linux, Windows, and OSX? Related, do you have the ability to test on OSX? Unfortunately, I no longer have the ability to test on OSX, just Linux and Windows.

    4) How would this be used by RedMine?

  2. Alexandr Evstigneev reporter
    1. Not a RedMine - RubyMine - the Ruby IDE. https://www.jetbrains.com/ruby/
    2. Well, would be nice to make it work everywhere, but I believe Windows is most important. Others have alternatives, windows - don't.
    3. Yes, exactly. Possibility to run arbitrary command with specific ruby. The point of not using shell is that we don't have it. IDE runs ruby for something. E.g. generate rails app. Or lint files with rubocop. And it does that silently in the background. And it's not possible to do so with uru.
  3. Jon repo owner

    I rarely use ruby these days, and use vim not an IDE for ruby dev. I don't value the feature enough to prioritize implementing it.

    But I do use idea community edition for kotlin/java dev, and find your request interesting.

    Is this how you want things to work from rubymine (RM)?

    1. RM starts a child process using uru_rt exec TAG some_arbitrary_command. RM assumes uru_rt is already on PATH or user has provided full path via an RM settings dialog.
    2. uru_rt starts a child process, updates the child process's PATH envar so the TAGged ruby is 1st on PATH, and hooks up child's stdout/stderr to the parent streams. The child process's GEM_HOME envar will likely also need set.
    3. The TAGged ruby runs the arbitrary command, returns, and uru_rt returns. uru_rt adds no additional output to the child process's stdout/stderr, and takes no action base upon the child process's return code.

    Reply with the specific behavior you'd like if the above is not precisely what you are requesting.

  4. Alexandr Evstigneev reporter

    Yes, that exactly what I need. I should be able to pipe to process and read stdout/stderr from it. Also I'd like to get an exit code of executed script. So uru_rt should be a transparent proxy for executing a command in the context of ruby specified with tag.

  5. Jon repo owner

    A few options for moving forward:

    1. If you work for jetbrains and would like to sponsor the dev work, I'll consider it in exchange for an idea ultimate perpetual license with lifetime free upgrades. Send me an email to work the details. Use the address you find when clicking "View raw commit" from the bitbucket webui for any of the commits.

    2. Send me a pull request. The go code is straight forward; a cmd router using handlers to write a envar updating script run by shell wrappers. This new uru_rt feature must run on both linux and windows and be usable from the multi-platform uru shell wrappers.

    3. Keep the issue open and wait until I find time to implement, or someone else interested submits a pull request.

  6. Lakshya Kapoor

    Hi @jonforums and @alexandr-evstigneev - any updates on this? Would love to use uru on RubyMine.

  7. Jon repo owner

    @kapoorlakshya I've not started any efforts nor have I seen any pull requests for the feature.

  8. Philip Schlesinger

    Hi @Jon if and when you can, please do assist the RubyMine team so that they can add uru as a local-version-manager within RubyMine. Thanks!

  9. Jon repo owner

    @Philip Schlesinger I also think @Alexandr Evstigneev idea is a cool for RubyMine. But don’t use ruby enough these days to put the time into this feature.

    Given my 2018-12-10 comment and @Alexandr Evstigneev reply confirming it is what’s requested, anyone with some time and a little Go knowlege should be able to submit an acceptable pull request.

  10. Log in to comment