Using New Gem Generator for projects on github

2 views
Skip to first unread message

tobs...@gmail.com

unread,
Jul 17, 2008, 5:53:43 PM7/17/08
to New Gem Generator
Hi,

I am just wondering how to use New Gem Generator for creating gems
hosted on github. What one would need is a <project>.gemspec file.
Otherwise github is not building the gem. I did some research and
found a rake task in the newgem_simple template (called make_spec).
Why is there none in the regular template? Can I generate the gemspec
file otherwise?

Thanx,

Tobi

Nic Williams

unread,
Jul 17, 2008, 7:28:40 PM7/17/08
to new-gem-...@googlegroups.com
Firstly, I highly recommend you push your gem to rubyforge. The rake tasks in newgem/hoe are designed for this, and the whole ruby community is built around this distribution model. Gems installed from github have a different name (instead of 'gem install newgem' its 'gem install drnic-newgem') which makes supporting dependencies between gems difficult/impossible. Which is sad since dependencies is one of rubygems' strong points.

But, assuming there are reasons to use github (hopefully that reason isn't "I cannot figure out how to deploy gems to rubyforge" - if that is the reason then we just need more documentation, but the http://newgem.rubyforge.org/rubyforge.html page has some discussion on it I think) then http://gems.github.com has a suggestion for generating the gemspec.

At the bottom of the page it suggests:

If you're currently using Hoe to manage your gems, you can run 'rake debug_gem' to generate the gemspec.
So theoretically you could do: "rake debug_gem > mygem.gemspec"

There is one more step. Edit mygem.gemspec and note that the top line is unnecessary so delete it or comment it out.

You should be good to go.

Granted, that seems unnecessary and surely there should be a rake task or something to do the equivalent. I'll take a patch from anyone for a "rake gemspec" task (put it in the generated tasks/ folder, say tasks/gemspec.rake file).

Ultimately such a task could go in Hoe. But firstly we'll add it to newgem and then ask Ryan to put it in Hoe.

If you cannot figure out how to add the new rake task to the newgem generator, just email me the final rake task and I'll add it into the generator. Easy peasy.

Cheers
Nic
--
Dr Nic Williams
Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com
* Learn TextMate for Rails2 - http://peepcode.com/products/textmate-for-rails-2 *

tobs...@gmail.com

unread,
Jul 18, 2008, 6:04:02 AM7/18/08
to New Gem Generator
Hey,

thanx a lot. So I will take your advice and will use rubyforge for the
gems I have in mind (as they offer git now).

Cheers,

Tobi

On 18 Jul., 01:28, "Nic Williams" <drnicwilli...@gmail.com> wrote:
> Firstly, I highly recommend you push your gem to rubyforge. The rake tasks
> in newgem/hoe are designed for this, and the whole ruby community is built
> around this distribution model. Gems installed from github have a different
> name (instead of 'gem install newgem' its 'gem install drnic-newgem') which
> makes supporting dependencies between gems difficult/impossible. Which is
> sad since dependencies is one of rubygems' strong points.
> But, assuming there are reasons to use github (hopefully that reason isn't
> "I cannot figure out how to deploy gems to rubyforge" - if that is the
> reason then we just need more documentation, but thehttp://newgem.rubyforge.org/rubyforge.htmlpage has some discussion on it I
> think) thenhttp://gems.github.comhas a suggestion for generating the
> gemspec.
>
> At the bottom of the page it suggests:
>
> If you're currently using Hoe to manage your gems, you can run 'rake
> debug_gem' to generate the gemspec.
>
> So theoretically you could do: "rake debug_gem > mygem.gemspec"
>
> There is one more step. Edit mygem.gemspec and note that the top line is
> unnecessary so delete it or comment it out.
>
> You should be good to go.
>
> Granted, that seems unnecessary and surely there should be a rake task or
> something to do the equivalent. I'll take a patch from anyone for a "rake
> gemspec" task (put it in the generated tasks/ folder, say tasks/gemspec.rake
> file).
>
> Ultimately such a task could go in Hoe. But firstly we'll add it to newgem
> and then ask Ryan to put it in Hoe.
>
> If you cannot figure out how to add the new rake task to the newgem
> generator, just email me the final rake task and I'll add it into the
> generator. Easy peasy.
>
> Cheers
> Nic
>
> On Fri, Jul 18, 2008 at 7:53 AM, tobst...@gmail.com <tobst...@gmail.com>
> wrote:
>
>
>
> > Hi,
>
> > I am just wondering how to use New Gem Generator for creating gems
> > hosted on github. What one would need is a <project>.gemspec file.
> > Otherwise github is not building the gem. I did some research and
> > found a rake task in the newgem_simple template (called make_spec).
> > Why is there none in the regular template? Can I generate the gemspec
> > file otherwise?
>
> > Thanx,
>
> > Tobi
>
> --
> Dr Nic Williams
> Fun with iPhone/Ruby/Rails/Javascript -http://drnicwilliams.com

Nic Williams

unread,
Jul 18, 2008, 8:29:06 AM7/18/08
to new-gem-...@googlegroups.com
You can still use github for your repo + for letting ppl fork + contribute (I do), but yeah also you can push to the git repo on rubyforge too.

The repo + the deployed gem are separate.
Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com
Reply all
Reply to author
Forward
0 new messages