Public bug reported:

PRETTY_NAME="Ubuntu quantal (12.10)"
VERSION="12.10, Quantal Quetzal"

Package: ruby-commandline
Priority: optional
Section: ruby
Installed-Size: 96
Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
Architecture: all
Version: 0.7.10-13
Ruby-Versions: ruby1.9.1 ruby1.8

After installing dhelp which uses ruby, I was frequently seeing during
package installation the error message

ERROR: comparison of String with 10 failed

following the invocation of dhelp information processing for the
particular package.

In fact, just invoking dhelp_parse at the command line produces the
error message

 dhelp_parse
ERROR: comparison of String with 10 failed

After investigation, it was ascertained that this error was due to console width
being obtained from the environmental variable COLUMNS in the form of a string
and not being automatically converted to an integer.

Therefore the following fix of changing console width from a string to
an integer needed to be applied to

/usr/lib/ruby/vendor_ruby/commandline/application.rb

--- application.rb.OLD 2012-05-30 12:59:59.000000000 +0200
+++ application.rb.NEW  2012-05-30 12:59:59.000000000 +0200
@@ -336,6 +336,7 @@
     # Formatting defaults
     #
     console_width = ENV["COLUMNS"]
+    console_width = console_width.to_i
     @columns =
       if console_width.nil?
         DEFAULT_CONSOLE_WIDTH

and to

/usr/lib/ruby/vendor_ruby/commandline/optionparser/optionparser.rb

--- optionparser.rb.OLD        2012-05-30 12:59:59.000000000 +0200
+++ optionparser.rb.NEW 2012-05-30 12:59:59.000000000 +0200
@@ -67,6 +67,7 @@
     # Formatting defaults
     #
     console_width = ENV["COLUMNS"]
+    console_width = console_width.to_i
     @columns =
       if console_width.nil?
         DEFAULT_CONSOLE_WIDTH

in order to ensure that in both cases the comparison test was being done
on console width in the form of an integer.

Having applied this changes, dhelp_parse then works without error.

dhelp_parse
 Usage: dhelp_parse [-v] [-h] -a doc-base_file1 d-b_f2 ... | -d doc-base_file1 
d-b_f2 ... | -i | -r

** Affects: ruby-commandline (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: dhelp ruby-commandline

** Description changed:

  PRETTY_NAME="Ubuntu quantal (12.10)"
  VERSION="12.10, Quantal Quetzal"
  
  Package: ruby-commandline
  Priority: optional
  Section: ruby
  Installed-Size: 96
  Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
  Architecture: all
  Version: 0.7.10-13
  Ruby-Versions: ruby1.9.1 ruby1.8
  
- 
- After installing dhelp which uses ruby, I was frequently seeing during 
package installation the error message
+ After installing dhelp which uses ruby, I was frequently seeing during
+ package installation the error message
  
  ERROR: comparison of String with 10 failed
  
  following the invocation of dhelp information processing for the
  particular package.
  
  In fact, just invoking dhelp_parse at the command line produces the
  error message
  
-  dhelp_parse
+  dhelp_parse
  ERROR: comparison of String with 10 failed
  
- After investigation, it was ascertained that this error was due to a
- comparison being done as a string for the console width, but the console
- width was being treated as a string and was not being automatically
- converted to an integer.
+ After investigation, it was ascertained that this error was due to console 
width
+ being obtained from the environmental variable COLUMNS in the form of a string
+ and not being automatically converted to an integer.
  
  Therefore the following fix of changing console width from a string to
  an integer needed to be applied to
  
  /usr/lib/ruby/vendor_ruby/commandline/application.rb
  
  --- application.rb.OLD 2012-05-30 12:59:59.000000000 +0200
  +++ application.rb.NEW  2012-05-30 12:59:59.000000000 +0200
  @@ -336,6 +336,7 @@
-      # Formatting defaults
-      #
-      console_width = ENV["COLUMNS"]
+      # Formatting defaults
+      #
+      console_width = ENV["COLUMNS"]
  +    console_width = console_width.to_i
-      @columns = 
-        if console_width.nil?
-          DEFAULT_CONSOLE_WIDTH
+      @columns =
+        if console_width.nil?
+          DEFAULT_CONSOLE_WIDTH
  
  and to
  
  /usr/lib/ruby/vendor_ruby/commandline/optionparser/optionparser.rb
  
  --- optionparser.rb.OLD        2012-05-30 12:59:59.000000000 +0200
  +++ optionparser.rb.NEW 2012-05-30 12:59:59.000000000 +0200
  @@ -67,6 +67,7 @@
-      # Formatting defaults
-      #
-      console_width = ENV["COLUMNS"]
+      # Formatting defaults
+      #
+      console_width = ENV["COLUMNS"]
  +    console_width = console_width.to_i
-      @columns = 
-        if console_width.nil?
-          DEFAULT_CONSOLE_WIDTH
+      @columns =
+        if console_width.nil?
+          DEFAULT_CONSOLE_WIDTH
  
  in order to ensure that in both cases the comparison test was being done
  on console width in the form of an integer.
  
  Having applied this changes, dhelp_parse then works without error.
  
  dhelp_parse
-  Usage: dhelp_parse [-v] [-h] -a doc-base_file1 d-b_f2 ... | -d 
doc-base_file1 d-b_f2 ... | -i | -r
+  Usage: dhelp_parse [-v] [-h] -a doc-base_file1 d-b_f2 ... | -d 
doc-base_file1 d-b_f2 ... | -i | -r

** Tags added: dhelp ruby-commandline

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1123281

Title:
  ruby-commandline [0.7.10-13] (quantal) -- ERROR: comparison of String
  with 10 failed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ruby-commandline/+bug/1123281/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to