diff --git a/lib/roo/base.rb b/lib/roo/base.rb index 38d5c6d6..9cbd2083 100644 --- a/lib/roo/base.rb +++ b/lib/roo/base.rb @@ -244,7 +244,7 @@ def find(*args) # :nodoc [col, cell(@header_line,col)] end] #-- id - if args[0].class == Fixnum + if args[0].class == Integer rownum = args[0] if @header_line [Hash[1.upto(self.row().size).map {|j| @@ -309,7 +309,7 @@ def set(row,col,value,sheet=nil) #:nodoc: read_cells(sheet) row, col = normalize(row,col) cell_type = case value - when Fixnum then :float + when Integer then :float when String, Float then :string else raise ArgumentError, "Type for #{value} not set" @@ -623,7 +623,7 @@ def set_type(row,col,type,sheet=nil) # converts cell coordinate to numeric values of row,col def normalize(row,col) if row.class == String - if col.class == Fixnum + if col.class == Integer # ('A',1): # ('B', 5) -> (5, 2) row, col = col, row @@ -711,7 +711,7 @@ def validate_sheet!(sheet) case sheet when nil raise ArgumentError, "Error: sheet 'nil' not valid" - when Fixnum + when Integer self.sheets.fetch(sheet-1) do raise RangeError, "sheet index #{sheet} not found" end diff --git a/lib/roo/excel.rb b/lib/roo/excel.rb index 7652bb9b..9ece84e0 100644 --- a/lib/roo/excel.rb +++ b/lib/roo/excel.rb @@ -198,7 +198,7 @@ def validate_sheet!(sheet) # converts name of a sheet to index (0,1,2,..) def sheet_no(name) - return name - 1 if name.is_a?(Fixnum) + return name - 1 if name.is_a?(Integer) worksheets.each_with_index do |worksheet, index| return index if name == normalize_string(worksheet.name) end @@ -306,7 +306,7 @@ def read_cell(row, idx) cell = read_cell_content(row, idx) case cell - when Integer, Fixnum, Bignum + when Integer value_type = :float value = cell.to_i when Float diff --git a/lib/roo/excelx.rb b/lib/roo/excelx.rb index 30321506..eaeb2081 100644 --- a/lib/roo/excelx.rb +++ b/lib/roo/excelx.rb @@ -266,7 +266,7 @@ def sheets # returns the sheet index by name # passed indexes through def sheet_index(sheet) - if sheet.is_a?(Fixnum) + if sheet.is_a?(Integer) sheet else sheets.index(sheet) diff --git a/scripts/txt2html b/scripts/txt2html index aac07a19..6e69ec0b 100644 --- a/scripts/txt2html +++ b/scripts/txt2html @@ -9,7 +9,7 @@ require File.dirname(__FILE__) + '/../lib/roo/version.rb' version = Roo::VERSION::STRING download = 'http://rubyforge.org/projects/roo' -class Fixnum +class Integer def ordinal # teens return 'th' if (10..19).include?(self % 100)