exogenesis icon indicating copy to clipboard operation
exogenesis copied to clipboard

gem module

Open bitboxer opened this issue 10 years ago • 32 comments

I have some command line utils that are delivered as gems. I think I want to have them installed via exogenesis.

Thoughts on this?

bitboxer avatar Oct 02 '13 05:10 bitboxer

Yep, is also on my wish list :smile: I think it has to be part of the Ruby version manager adapter you chose though: I want those gems to be available on all my Ruby versions and therefore it has to switch between them.

moonglum avatar Oct 02 '13 05:10 moonglum

Okay, since npm is now off my list, this is the next on my wishlist. But I am worried about the "switch through all ruby versions" thing. I have installed jruby on my system, but I don't want my ruby gems with executables installed in there. Most of them won't work and that who work would be f**ing slow due to the bootup time. What do you think about this?

bitboxer avatar Jan 30 '14 19:01 bitboxer

Great :smile:

The reason behind installing it for all rubies on the system is that I want the executables to be always available – no matter to which Ruby I switched to. Commands like gem man or tmuxinator always need to be there – otherwise I for example can’t call man or start my new tmux session.

However I understand your problem. What do you think the solution is for that? Listing all Rubies for which they should be installed is bad IMHO, because it would be duplication in the packages.yml file. Maybe there should be an exclude option?

As I said above, I think it should be implemented for each ruby version manager separately. What do you think about the following configuration which would be required by each of them?

rubies:
- ruby-1.9.3
- ruby-2.0.0
- ruby-2.1.0
- jruby-head:
  - no-default-gems
default_gems:
- tmuxinator
- gem-man

moonglum avatar Jan 31 '14 12:01 moonglum

I like that approach. Will try to implement this next week.

bitboxer avatar Jan 31 '14 12:01 bitboxer

Great :smile: Thanks in advance!

moonglum avatar Jan 31 '14 12:01 moonglum

Are you using RVM or rbenv?

moonglum avatar Jan 31 '14 12:01 moonglum

rbenv, which means that I have to implement rbenv and than this in both systems. But don't worry about that.

bitboxer avatar Jan 31 '14 12:01 bitboxer

So you’ll also work on #5? :smile:

moonglum avatar Jan 31 '14 12:01 moonglum

fixing all the things

bitboxer avatar Jan 31 '14 12:01 bitboxer

Can you add me to the project that I can assign myself to the issues? Will send pull requests, but that way you see what I am working on.

bitboxer avatar Jan 31 '14 12:01 bitboxer

You are so awesome.

I would like to add you as a contributor :smile:

moonglum avatar Jan 31 '14 12:01 moonglum

Same thought :smiley_cat:

moonglum avatar Jan 31 '14 12:01 moonglum

You are a contributor now. Welcome to the team :rocket: Yep, we will do it pull request based :smile:

moonglum avatar Jan 31 '14 12:01 moonglum

:heart_eyes:

bitboxer avatar Jan 31 '14 13:01 bitboxer

After #23 is done, I will do this. My current thought on this is:

Iterate over every ruby version that should have gems installed, run gem update [list of gems]

This should do it, right? Worried that I forgot an important step here.

bitboxer avatar Feb 21 '14 10:02 bitboxer

Nope, that’s all I think :wink: You will build it into the rbenv passenger, right?

moonglum avatar Feb 21 '14 10:02 moonglum

Want to add it into rvm and rbenv. Will install rvm for this :wink:

bitboxer avatar Feb 21 '14 10:02 bitboxer

You are awesome!! :rocket:

moonglum avatar Feb 21 '14 10:02 moonglum

One thing I forgot. gem update does not install the gem, I have to run gem list, parse that output and than either install or update the gem. Or is there another way :sob: ?

bitboxer avatar Feb 27 '14 09:02 bitboxer

No, I would also use gem list and parse the output. I think that’s not a big problem – just don’t forget to memorize it :wink:

moonglum avatar Feb 28 '14 10:02 moonglum

Holy shit. Today is really frustrating. I am giving up on this today.

I can't open a new shell as a subprocess and switch the used ruby version in there. This is not as simple as it seems :-1:

bitboxer avatar Feb 28 '14 20:02 bitboxer

Btw: this works if Bundler is not part of the equation:

system({"RBENV_VERSION" => "2.1.1"}, "rbenv exec gem list")

If Bundler wraps the stuff, something is changed and gem only returns the gem list of the current used ruby. I don't know why. I tried the with_clean_env stuff and several other ways..without any luck.

bitboxer avatar Feb 28 '14 21:02 bitboxer

rvm 1.9.3,2.0.0 do gem install tmuxinator will install the tmuxinator gem for Ruby 1.9.3 and 2.0.0.. I thought that it would work as follows in RVM:

gems_to_install.each do |gem|
    execute "Install ‘#{gem}’", "rvm install #{ruby_versions.join}” do gem install #{gem}"
end

That should also work when executed in a Bundler environment.

moonglum avatar Mar 03 '14 09:03 moonglum

I asked the rbenv folks. Let's see what they have something similar.

bitboxer avatar Mar 03 '14 20:03 bitboxer

Have you checked out the rbenv Plugin rbenv-each? It’s listed on the approved plugin directory of rbenv.

moonglum avatar Mar 04 '14 09:03 moonglum

I found the time to look into this today. Looks like a winner :+1: .

bitboxer avatar Mar 05 '14 18:03 bitboxer

Nope, still has some edge cases when using bundler and you can't exclude certain ruby versions. I think we should put this one on hold, it drives me crazy :sob:

bitboxer avatar Mar 05 '14 21:03 bitboxer

Damn :unamused:

Ok, let us push this to version 0.3.

moonglum avatar Mar 06 '14 20:03 moonglum

Yep.

bitboxer avatar Mar 06 '14 21:03 bitboxer

Btw: after switching back to zsh, this is working:

system({"RBENV_VERSION" => "1.9.3-p448"}, "rbenv exec ruby --version")

It was the strange fish subshell behaviour that tricked me a few times and was one of the main reasons to switch back to zsh.

We now can continue with this ticket and put a warning on it: "NOT WORKING ON FISH SHELL"

bitboxer avatar Mar 29 '14 18:03 bitboxer

Sounds awesome! :smiley_cat: Will continue working on exogenesis as soon as I'm done with the exam on Monday!

moonglum avatar Mar 29 '14 18:03 moonglum

:dancers:

bitboxer avatar Mar 29 '14 19:03 bitboxer