Eeepub gem warnings?

I am using the fabulous eeepub gem to convert a folder full of HTML
files into a valid epub package. It works swimmingly, except I get the
following errors with each turn of my loop:

Minogue_0089 split into chapters…
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/
container_item.rb:19: warning: instance variable @depth not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/
container_item.rb:19: warning: instance variable @total_page_count not
initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/
container_item.rb:19: warning: instance variable @max_page_number not
initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/maker.rb:
101: warning: instance variable @languages not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/maker.rb:
102: warning: instance variable @subjects not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/maker.rb:
103: warning: instance variable @descriptions not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/maker.rb:
104: warning: instance variable @rightss not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/maker.rb:
105: warning: instance variable @relations not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/
container_item.rb:19: warning: instance variable @unique_identifier
not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/
container_item.rb:19: warning: instance variable @toc not initialized
/opt/local/lib/ruby/gems/1.8/gems/eeepub-0.6.1/lib/eeepub/opf.rb:42:
warning: instance variable @spine not initialized
created Minogue_0089.epub

I see these variables in the respective places where they are defined
– in the initialize method of the various classes – but the really
funny thing is that I don’t get these errors when I run the example
code that comes with the gem. That code begins with a line I don’t
recognize or understand:

$:.unshift(File.dirname(FILE) + ‘/…/lib’)

followed by:

require ‘rubygems’
require ‘eeepub’

I am running this from the command line, and my script begins with:

#!/usr/bin/env ruby -wKU
require ‘rubygems’
require ‘nokogiri’
require ‘cgi’
require ‘fileutils’
require ‘open-uri’
require ‘eeepub’

Can anyone explain what the $:.unshift bit does? And is there a way to
just hide these warnings? The script seems to work just fine.

Walter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs