[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Gem packaging...

ggarramuno

10/7/2004 6:45:00 PM

After I got my copy of the ruby book and went thru the rubygems packaging, I
tried repackaging my getopt-declare library as a gem.
It worked fine, but I did run into a stumbling block, when it came to the ri
documentation. Currently, due to its length, I keep the rdoc documentation in
a separate file.

My gemspec looks like:

require 'rubygems'

spec = Gem::Specification.new do |s|
s.name = 'getopt-declare'
s.version = "1.09.7"
s.author = "Gonzalo Garramuno"
s.email = "GGarramuno@aol.com"
s.homepage = "http://getoptdeclare.rubyforge....
s.platform = Gem::Platform::RUBY
s.summary = "Comprehensive and easy to use command-line parser library using
regular expressions (port of Perl's module)."
s.files = Dir.glob("{samples,tests,lib,docs}/**/*").delete_if {|item|
item.include?("CVS") || item.include?("rdoc")}
s.require_path = 'lib'
end

if $0==__FILE__
Gem::manage_gems
Gem::Builder.new(spec).build
end

and the documentation is in a file inside the docs directory as
docs/Declare.rdoc.
I've tried also adding the s.extra_rdocs_files and listing in there without
success.

Whenever I install, I get:
WARNING: Generating RDoc on .gem that may not have RDoc.

and obviously 'ri' remains unaware of the new module(s).

2 Answers

Jim Weirich

10/7/2004 7:14:00 PM

0


GGarramuno said:
> After I got my copy of the ruby book and went thru the rubygems packaging,
> I
> tried repackaging my getopt-declare library as a gem.
[..]
> I've tried also adding the s.extra_rdocs_files and listing in there
> without
> success.
>
> Whenever I install, I get:
> WARNING: Generating RDoc on .gem that may not have RDoc.

You need to set the "has_rdoc" flag in the gem spec to true, e.g.

s.has_rdoc = true


--
-- Jim Weirich jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



Chad Fowler

10/7/2004 7:14:00 PM

0

On Fri, 8 Oct 2004 03:49:45 +0900, GGarramuno <ggarramuno@aol.com> wrote:
> After I got my copy of the ruby book and went thru the rubygems packaging, I
> tried repackaging my getopt-declare library as a gem.

Great! Thanks! Very cool library, too.

> It worked fine, but I did run into a stumbling block, when it came to the ri
> documentation. Currently, due to its length, I keep the rdoc documentation in
> a separate file.
>
> My gemspec looks like:
>
> require 'rubygems'
>
> spec = Gem::Specification.new do |s|
> s.name = 'getopt-declare'
> s.version = "1.09.7"
> s.author = "Gonzalo Garramuno"
> s.email = "GGarramuno@aol.com"
> s.homepage = "http://getoptdeclare.rubyforge....
> s.platform = Gem::Platform::RUBY
> s.summary = "Comprehensive and easy to use command-line parser library using
> regular expressions (port of Perl's module)."
> s.files = Dir.glob("{samples,tests,lib,docs}/**/*").delete_if {|item|
> item.include?("CVS") || item.include?("rdoc")}
> s.require_path = 'lib'
> end
>
> if $0==__FILE__
> Gem::manage_gems
> Gem::Builder.new(spec).build
> end
>
> and the documentation is in a file inside the docs directory as
> docs/Declare.rdoc.
> I've tried also adding the s.extra_rdocs_files and listing in there without
> success.
>
> Whenever I install, I get:
> WARNING: Generating RDoc on .gem that may not have RDoc.
>

This is something that I think we'll probably get rid of. We have an
attribute in the gemspec called "has_rdoc?" which you need to set to
true to explicitly declare that you have rdoc'd the library. The idea
was that all ruby libraries can be run through rdoc, but the ones that
have actually be documented in the source are the ones that are going
to really be valuable documentation-wise.

Nobody really uses this though, so you almost always see this warning. ;)


> and obviously 'ri' remains unaware of the new module(s).
>

Yea, we haven't sorted the "ri" integration out yet. We'll make that
one of our focuses for RubyGems 0.9.0.

Thanks for the feedback!

Chad