Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > "Support Files" in Rubygems

Reply
Thread Tools

"Support Files" in Rubygems

 
 
Manuel Holtgrewe
Guest
Posts: n/a
 
      02-16-2007
Hi

Is it possible to include files in rubygems that are neither .rb nor
documentation files? I would like to publish Mozilla's cacert.pem in
my gem but seemingly, rubygems does not include the pem file in the
build gem.

You can find the Rakefile used to build the gem here:

http://preview.tinyurl.com/yrce7b

Thanks in advance,

Manuel Holtgrewe

 
Reply With Quote
 
 
 
 
Austin Ziegler
Guest
Posts: n/a
 
      02-16-2007
On 2/16/07, Manuel Holtgrewe <> wrote:
> Is it possible to include files in rubygems that are neither .rb nor
> documentation files? I would like to publish Mozilla's cacert.pem in
> my gem but seemingly, rubygems does not include the pem file in the
> build gem.
>
> You can find the Rakefile used to build the gem here:
>
> http://preview.tinyurl.com/yrce7b
>
> Thanks in advance,


Yes. See PDF::Writer and various others for how to do this.

RubyGems doesn't really care what you include; it just wants you to
enumerate it.

-austin
--
Austin Ziegler * * http://www.halostatue.ca/
* * http://www.halostatue.ca/feed/
*

 
Reply With Quote
 
 
 
 
Jeremy Hinegardner
Guest
Posts: n/a
 
      02-16-2007
--WhfpMioaduB5tiZL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, Feb 17, 2007 at 05:40:06AM +0900, Manuel Holtgrewe wrote:
> Hi
>
> Is it possible to include files in rubygems that are neither .rb nor
> documentation files? I would like to publish Mozilla's cacert.pem in
> my gem but seemingly, rubygems does not include the pem file in the
> build gem.
>
> You can find the Rakefile used to build the gem here:
>
> http://preview.tinyurl.com/yrce7b
>


Feel free to take a look at the Rakefile for keybox, I have a 'data'
directory that gets included. FileList is your friend.

Here's a patch to google4r HEAD that I think does what you want.

You'll probably want to take advantage of spec.rdoc_options to make sure
that when the rdoc is generated from the gem that your 'README' is the
main document.

Something like :

spec.rdoc_options = ["--line-numbers",
"--inline-source",
"--main","README"]

You can also add a task :debug_gem (from hoe) which can help debug
issues.

task :debug_gem do
puts spec.to_ruby
end

enjoy,

-jeremy

--
================================================== ======================
Jeremy Hinegardner


--WhfpMioaduB5tiZL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="google4r_file_list.patch"

Index: Rakefile
================================================== =================
--- Rakefile (revision 2)
+++ Rakefile (working copy)
@@ -7,9 +7,15 @@
task :default => :test

#
+# File sets
+#
+RUBY_FILES = FileList['lib/**/*.rb', 'lib/**/vendor/**']
+RDOC_EXTRA = FileList['README','LICENSE']
+EXTRA_FILES = FileList['var/*.pem']
+
+#
# Documentation
#
-
desc 'Generate documentation for the google4r library.'
Rake::RDocTask.new(:doc) do |rdoc|
rdoc.rdoc_dir = 'doc'
@@ -17,10 +23,7 @@
rdoc.main = 'README'
rdoc.options << '--line-numbers' << '--inline-source'
#rdoc.template = "var/allison/allison.rb"
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('LICENSE')
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc.rdoc_files.exclude('lib/**/vendor/**')
+ rdoc.rdoc_files = RUBY_FILES + RDOC_EXTRA
end

#
@@ -78,10 +81,11 @@
spec.version = version
spec.author = "Manuel Holtgrewe"

- spec.test_files = Dir.glob('test/**/*_test.rb')
- spec.files << 'README' << 'LICENSE' << 'var/cacert.pem'
- spec.files += Dir.glob('lib/**/*.rb')
- spec.files.reject! { |str| str ~= /^\./ }
+ spec.test_files = FileList['test/**/*_test.rb']
+ spec.files = RUBY_FILES + EXTRA_FILES
+ spec.extra_rdoc_files = RDOC_EXTRA
+ spec.files.reject! { |str| str =~ /^\./ }
+
spec.require_path = 'lib'
spec.required_ruby_version = '>= 1.8.4'
spec.autorequire = ''
@@ -93,4 +97,4 @@
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
-end
\ No newline at end of file
+end

--WhfpMioaduB5tiZL--

 
Reply With Quote
 
Eric Hodel
Guest
Posts: n/a
 
      02-16-2007
On Feb 16, 2007, at 13:05, Jeremy Hinegardner wrote:

> You'll probably want to take advantage of spec.rdoc_options to make
> sure
> that when the rdoc is generated from the gem that your 'README' is the
> main document.
>
> You can also add a task :debug_gem (from hoe) which can help debug
> issues.


Or you could just use Hoe and let somebody else (me) take care of
these things.

 
Reply With Quote
 
Jeremy Hinegardner
Guest
Posts: n/a
 
      02-16-2007
On Sat, Feb 17, 2007 at 06:12:02AM +0900, Eric Hodel wrote:
> On Feb 16, 2007, at 13:05, Jeremy Hinegardner wrote:
>
> >You'll probably want to take advantage of spec.rdoc_options to make
> >sure
> >that when the rdoc is generated from the gem that your 'README' is the
> >main document.
> >
> >You can also add a task :debug_gem (from hoe) which can help debug
> >issues.

>
> Or you could just use Hoe and let somebody else (me) take care of
> these things.


Yup, that would work too, hoe makes the common stuff pretty easy, and
your publication to rubyforge and announcements and such.

-jeremy

--
================================================== ======================
Jeremy Hinegardner


 
Reply With Quote
 
Manuel Holtgrewe
Guest
Posts: n/a
 
      02-17-2007
Hi

Thank you all for your kind suggestions - they all solve my problem =)

I will certainly have a look at Hoe since it seems to be what I am
trying to duplicate (although I could not find much documentation on
it on the net).

Kind Regards,

Manuel

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rubygems 1.3.5 can't load 'rubygems/defaults/operating_sy..' Eric Roscher Ruby 3 11-24-2009 01:07 AM
[BUG] RubyGems: "No such file to load -- rubygems/builder" Erik Veenstra Ruby 4 02-04-2005 10:28 PM
Problems with fresh install of RubyGems on Ubuntu Linux: No suchfile to load -- rubygems/builder (LoadError) Trevor Ruby 5 01-29-2005 12:52 AM
RubyGems news? Phil Tomson Ruby 2 01-24-2004 06:27 PM
RubyGems and dependencies Francis Hwang Ruby 2 12-24-2003 05:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57