moonglum / exogenesis

Build your dotfile installer, updater and teardown
MIT License
19 stars 8 forks source link

gem module #18

Open bitboxer opened 11 years ago

bitboxer commented 11 years ago

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

Thoughts on this?

moonglum commented 11 years ago

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.

bitboxer commented 10 years ago

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?

moonglum commented 10 years ago

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
bitboxer commented 10 years ago

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

moonglum commented 10 years ago

Great :smile: Thanks in advance!

moonglum commented 10 years ago

Are you using RVM or rbenv?

bitboxer commented 10 years ago

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

moonglum commented 10 years ago

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

bitboxer commented 10 years ago

fixing all the things

bitboxer commented 10 years ago

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.

moonglum commented 10 years ago

You are so awesome.

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

moonglum commented 10 years ago

Same thought :smiley_cat:

moonglum commented 10 years ago

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

bitboxer commented 10 years ago

:heart_eyes:

bitboxer commented 10 years ago

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.

moonglum commented 10 years ago

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

bitboxer commented 10 years ago

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

moonglum commented 10 years ago

You are awesome!! :rocket:

bitboxer commented 10 years ago

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: ?

moonglum commented 10 years ago

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:

bitboxer commented 10 years ago

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 commented 10 years ago

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.

moonglum commented 10 years ago

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.

bitboxer commented 10 years ago

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

moonglum commented 10 years ago

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

bitboxer commented 10 years ago

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

bitboxer commented 10 years ago

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:

moonglum commented 10 years ago

Damn :unamused:

Ok, let us push this to version 0.3.

bitboxer commented 10 years ago

Yep.

bitboxer commented 10 years ago

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"

moonglum commented 10 years ago

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

bitboxer commented 10 years ago

:dancers: