This is the second time lately that I raise what seems like a obvious
issue and end up answering myself. There's not enough traffic on this
group. Has newgem lapsed into disuse (shame)
Anyway, here's what I've found so far:
If I create a gem spec with 'rake gemspec' I see this code for
dependencies
if s.respond_to? :specification_version then
current_version =
Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new
('1.2.0') then
s.add_runtime_dependency(%q<hpricot>, [">= 0.6"])
s.add_runtime_dependency(%q<mechanize>, [">= 0.7.5"])
s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
s.add_runtime_dependency(%q<fastercsv>, [">= 1.2.3"])
s.add_development_dependency(%q<newgem>, [">= 1.3.0"])
s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
else
s.add_dependency(%q<hpricot>, [">= 0.6"])
s.add_dependency(%q<mechanize>, [">= 0.7.5"])
s.add_dependency(%q<builder>, [">= 2.1.2"])
s.add_dependency(%q<fastercsv>, [">= 1.2.3"])
s.add_dependency(%q<newgem>, [">= 1.3.0"])
s.add_dependency(%q<hoe>, [">= 1.8.0"])
end
else
s.add_dependency(%q<hpricot>, [">= 0.6"])
s.add_dependency(%q<mechanize>, [">= 0.7.5"])
s.add_dependency(%q<builder>, [">= 2.1.2"])
s.add_dependency(%q<fastercsv>, [">= 1.2.3"])
s.add_dependency(%q<newgem>, [">= 1.3.0"])
s.add_dependency(%q<hoe>, [">= 1.8.0"])
end
So you see if the local version of rubygem is recent enough (1.2+) it
can distinguish between development and runtime dependencies. Hoe and
NewGem are development dependencies but I don't want them to be
runtime dependencies.
Unfortunately this code above means that on the end-user's system if
their rubygem is pre-1.2, they'll get all of the development deps as
runtime deps.
I think this is pretty dumb of rubygem (I traced the code that does
this to the specification.rb in the rubygem gem - so it's not newgen
or hoe to blame this time) - it seems obvious to me that if I the
developer am smart enough to specify _development_ dependencies, then
a) I don't want my end users dealing with them and b) I already have
the latest rubygem installed. So the else clauses should filter out
the development deps.
So I'd like to take newgem and hoe out altogether. I can take out
newgem but hoe adds itself.
I see Dr Nic replying on some forum that newgem removes the hoe
behaviour of adding itself - but it doesnt seem to - perhaps I
misread.
Any ideas? I'm getting ready to do one of the following
1. create gemspecs edit them and create the gem itself (any help with
this, e.g. will commands like 'rake release' pick up my hand-crafted
gem or recreate the gem with the evil dependences?)
2. hack hoe or newgem to try and stop the madness
3. give into the madness and start again with Dr Bones (don't want to
go there yet because I like the website stuff that Dr Nic provides)
ideas?