From: Intransition Date: 2013-02-06T19:14:05+09:00 Subject: Re: Expanding gemspecs ------=_Part_498_8810994.1360145642412 Content-Type: multipart/alternative; boundary="----=_Part_499_10677790.1360145642412" ------=_Part_499_10677790.1360145642412 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Wednesday, February 6, 2013 4:48:36 AM UTC-5, Jon Cairns wrote: > > Hi everyone, I've got a question about the existence or potential > usefulness of a particular gem. > > The situation is this: all gems have a gemspec file that defines various > properties about the gem. When creating a new gem with bundler, it puts > in some shortcuts to generating that information, such as using git to > list files in the gem, requiring a file and class constant to retrieve > the version number and using grep to discover test files. > > This is great during development, but has a slight performance effect > for the end user when loading the gem. Multiply that by 20, 30, 40+ and > you start to get a noticeable delay when loading all gems (particularly > noticeable when starting rails). > > So far I haven't said anything new: this has been brought up before and, > as far as I know, there isn't a universal solution yet. Some people > create Rake tasks to build their gemspecs, but what about a gem? E.g. a > command line tool to produce a fully qualified gemspec from a template. > I think that Jeweller used to do it, but that's no longer maintained as > people tend towards using bundler now. > > Is there a gem in existence that parses the gemspec, producing an > expanded version that can then be used when packaging and delivering the > gem? A quick Google search returned nothing, so I wrote a small script > to do it. I was toying with the idea of turning it into a gem, but > wanted to pass it under the noses of seasoned rubyists to see what the > general feeling was. > > Any thoughts? > > Cheers, Jon :) > I am glad you asked. https://github.com/rubyworks/indexer ------=_Part_499_10677790.1360145642412 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On Wednesday, February 6, 2013 4:48:36 AM UTC-5, Jon Cairns wrote:
Hi everyone, I've got a question about the existence or potential
usefulness of a particular gem.

The situation is this: all gems have a gemspec file that defines various
properties about the gem. When creating a new gem with bundler, it puts
in some shortcuts to generating that information, such as using git to
list files in the gem, requiring a file and class constant to retrieve
the version number and using grep to discover test files.

This is great during development, but has a slight performance effect
for the end user when loading the gem. Multiply that by 20, 30, 40+ and
you start to get a noticeable delay when loading all gems (particularly
noticeable when starting rails).

So far I haven't said anything new: this has been brought up before and,
as far as I know, there isn't a universal solution yet. Some people
create Rake tasks to build their gemspecs, but what about a gem? E.g. a
command line tool to produce a fully qualified gemspec from a template.
I think that Jeweller used to do it, but that's no longer maintained as
people tend towards using bundler now.

Is there a gem in existence that parses the gemspec, producing an
expanded version that can then be used when packaging and delivering the
gem? A quick Google search returned nothing, so I wrote a small script
to do it. I was toying with the idea of turning it into a gem, but
wanted to pass it under the noses of seasoned rubyists to see what the
general feeling was.

Any thoughts?

Cheers, Jon :)

I am glad you asked.

https://github.com/rubyworks/indexer
 

------=_Part_499_10677790.1360145642412-- ------=_Part_498_8810994.1360145642412--