Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

GitHub :author param to config.gem (Rails::GemDependency)

#2152

Lately my environment.rb is filled with GitHub gems. I suspect yours is too.

I got a bit tired of all the :source and :lib stuff, so I whipped this patch to allow me to pass :author => 'foo'. It then changes the defaults for :lib and :source (as well as changes the gem name), to fit what GitHub expects.

Thoughts?

Reported by Jordi Bunster · March 6th, 2009 @ 03:08 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. José Valim
    José Valim

    I've seen a similar patch about this around. If I'm sure it used config.gem 'gem', :github => 'author', but I like more yours. +1

    March 6th, 2009 @ 03:40 PM

  2. Jordi Bunster
    Jordi Bunster

    José:

    I did a quick search for the one you mentioned but I couldn't find it here on Lighthouse. Is it here, do you know?

    March 6th, 2009 @ 04:05 PM

  3. ronin-278 (at lighthouseapp)
    ronin-278 (at lighthouseapp)

    I would go with something like :github_author => 'foobar'. More explicit IMO.

    March 6th, 2009 @ 04:07 PM

  4. Pratik
    Pratik
    • State changed from new to wontfix
    • Title changed from [PATCH] GitHub :author param to config.gem (Rails::GemDependency) to GitHub :author param to config.gem (Rails::GemDependency)

    Not sure I like the idea of having a service specific code in Rails. If it's in rubygems, that's cool.

    Will reopen if more ppl think otherwise.

    Thanks.

    March 6th, 2009 @ 04:08 PM

  5. Jordi Bunster
    Jordi Bunster

    Nicolás: yeah, I went for brevity, but I see your point. I wouldn't mind changing the syntax.

    Pratik: I thought about it, but the reality is that more and more people publish on GitHub only, which at the end of the day, is just service, not unlike RubyForge.

    March 6th, 2009 @ 04:14 PM

  6. Damian Janowski
    Damian Janowski

    What about a :prepend option?

    config.gem 'will_paginate', :prepend => 'mislav'

    That way it's not service-specific.

    March 6th, 2009 @ 04:15 PM

  7. Jordi Bunster
    Jordi Bunster

    Damian:

    I think the service-specific part is the fact that when you pass :author (or :prepend or :whatever_color_the_shed_is) we then assume :source => GitHub.

    March 6th, 2009 @ 04:19 PM

  8. Pratik
    Pratik

    Hey Jordi,

    I really don't have a strong opinion about this. Will reopen if more people on the mailing list think this is a good feature. Please don't take "wontfix" the wrong way, just trying to do some LH gardening :)

    Thanks.

    March 6th, 2009 @ 04:37 PM

  9. Jordi Bunster
    Jordi Bunster

    Pratik: I know. I don't take it one way or another. Just trying to get the patch in. :P

    March 6th, 2009 @ 04:43 PM

  10. Jordi Bunster
    Jordi Bunster

    This is a workaround to now having this in Rails: http://gist.github.com/78259

    Sadly, I can't really make it a plugin, because of how early in the initialization it has to work.

    March 12th, 2009 @ 08:18 PM

  11. Markús
    Markús

    @Jordi

    I've started a ticket for something similar about one month ago, it's may be the one José Valim is talking about.

    There's an interesting answer by Matt Jones in my ticket about this concern. It's practically the same Pratik says in his comment, and I agree with them, perhaps it's better to leave the config.gem as it is right now (it makes sense since it's planned to make Rails as agnostic as possible in Rails 3).

    And think, we already have templates which make a lot of automatic work for us. For example, I've created a "templates_helper" with functions like this "github_gems" to easily add and remove gems from templates both for new or existing applications.

    By the way. I like your approach, it's more clear than mine.

    Cheers. Markus.

    March 12th, 2009 @ 10:39 PM