[Rubygems-developers] __FILE__ hacks -was: Re: [...] Adoption

chad at chadfowler.com chad at chadfowler.com
Fri Oct 22 11:15:49 EDT 2004


> On Fri, Oct 22, 2004 at 06:45:55AM -0400, Jim Weirich wrote:
>> In David HH's RubyConf talk, he mentioned that Rails promotes conformity
>> by
>> making the conforming "golden" path easy and the non-conforming paths
>> difficult.  I see this suggestion, along with careful selection of
>> defaults
>> in the gem spec as being part of the "golden path" strategy.  If you use
>> "gem
>> initialize-directory" and a very minimal gemspec, you could have a
>> working
>> gem project.
>>
>> I think providing documentation about this "golden path" is good too.
>> Make
>> using a properly designed directory structure easy and a improper one
>> inconvenient and most people will automatically follow your lead
>
> I agree.  If I were to do this for RubyGems, I think I'd start with the
> following steps:
>
> Add
>
>   gem setup <projectname>
> and
>   gem lint
>
> Setup would set up a new project (proving templates for important files,
> creating directories, etc).
>
> Lint would verify that stuff looked policy-wise OK (correct directories,
> grep for hacks, etc).  Give errors for serious stuff, warnings for less
> serious stuff.  We've had great success with a tool like this for the
> FreeBSD ports collection.
>
> Then I'd add more doc on how to be compatible to the RubyGems Wiki -
> probably I'd just start by pointing at the RPA GoodPractices page
> (http://rpa-base.rubyforge.org/wiki/wiki.cgi?GoodPractices).
>
> In order to ensure that gems support directory splitting (this is
> necessary for some systems), I'd at some point add the command
>
>   gem bust
>
> or similar, to install a gem in non-single-directory manner for testing.
> This helps make it easy for developers (and testers) to test that gem
> packages actually work in the relevant context.
>


I've had these 3 ideas brewing in my head for a few weeks (along with
conversations with Jim, Rich, and David Heinemeier Hansson).  Rich
actually started on the last one already.  I'm all for them.

Now we just need free time :)

Chad



More information about the Rubygems-developers mailing list