Package: libdbi-ruby
Version: 0.2.2-1
Severity: minor
When using libdbi-ruby with -w, I get a lot of warnings like this:
/usr/lib/ruby/1.8/dbi/utils.rb:176: warning: instance variable @original_date
not initialized
.... e.g. if a Timestamp was created from a Time, but you then
call to_date on that object. The fix is simple - I've attached
a patch that sets @original_date and @original_time to nil in the
intialize methods.
many thanks,
mark
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (900, 'testing'), (800, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL
set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libdbi-ruby depends on:
ii libdbi-ruby1.8 0.2.2-1 Database Independent Interface for
libdbi-ruby recommends no packages.
libdbi-ruby suggests no packages.
-- no debconf information
--- utils.rb 2008-10-12 17:36:58.000000000 +0100
+++ utils.rb.new 2008-10-12 17:38:29.000000000 +0100
@@ -14,6 +14,8 @@
# standard Date class' constructor except that it also accepts a
# Date or Time object.
def initialize(year=0, month=0, day=0)
+ @original_date = nil
+ @original_time = nil
case year
when ::Date
@year, @month, @day = year.year, year.month, year.day
@@ -60,6 +62,7 @@
# in the standard library, accepts an hour, minute and second, or a
# Time object.
def initialize(hour=0, minute=0, second=0)
+ @original_time = nil
case hour
when ::Time
@hour, @minute, @second = hour.hour, hour.min, hour.sec
@@ -106,6 +109,8 @@
# seconds, expressed in nanoseconds. In addition, the constructor
# accepts either a Date or Time object.
def initialize(year=0, month=0, day=0, hour=0, min=0, sec=0,
fraction=nil)
+ @original_date = nil
+ @original_time = nil
case year
when ::Time
@year, @month, @day = year.year, year.month, year.day