roo 1.11.1 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +9 -0
- data/README.markdown +5 -5
- data/VERSION +1 -1
- data/lib/roo.rb +1 -23
- data/lib/roo/csv.rb +23 -26
- data/lib/roo/excel2003xml.rb +3 -2
- data/lib/roo/excelx.rb +8 -9
- data/lib/roo/generic_spreadsheet.rb +2 -1
- data/lib/roo/spreadsheet.rb +25 -0
- data/roo.gemspec +6 -3
- data/spec/lib/roo/excel2003xml_spec.rb +15 -0
- data/spec/lib/roo/excelx/format_spec.rb +3 -1
- data/spec/lib/roo/spreadsheet_spec.rb +14 -0
- metadata +13 -8
    
        data/CHANGELOG
    CHANGED
    
    | @@ -1,3 +1,12 @@ | |
| 1 | 
            +
            == 1.11.2 (unreleased)
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            * 4 bugfixes
         | 
| 4 | 
            +
              * Fix that Roo::Spreadsheet.open wasn't tolerant to case differences.
         | 
| 5 | 
            +
              * Fix that Roo::Excel2003XML loading was broken https://github.com/Empact/roo/pull/27
         | 
| 6 | 
            +
              * Enable loading Roo::Csv files from uris, just as other file types https://github.com/Empact/roo/pull/31
         | 
| 7 | 
            +
              * Fix that Excelx "m/d/yy h:mm" was improperly being interpreted as date rather
         | 
| 8 | 
            +
                than datetime https://github.com/Empact/roo/pull/29
         | 
| 9 | 
            +
             | 
| 1 10 | 
             
            == 1.11.1 2013-03-18
         | 
| 2 11 |  | 
| 3 12 | 
             
            * 1 bugfix
         | 
    
        data/README.markdown
    CHANGED
    
    | @@ -19,12 +19,12 @@ file but not the formula itself) | |
| 19 19 |  | 
| 20 20 | 
             
                require 'roo'
         | 
| 21 21 |  | 
| 22 | 
            -
                s = Openoffice.new("myspreadsheet.ods")      # creates an Openoffice Spreadsheet instance
         | 
| 23 | 
            -
                s = Excel.new("myspreadsheet.xls")           # creates an Excel Spreadsheet instance
         | 
| 24 | 
            -
                s = Google.new("myspreadsheetkey_at_google") # creates an Google Spreadsheet instance
         | 
| 25 | 
            -
                s = Excelx.new("myspreadsheet.xlsx")         # creates an Excel Spreadsheet instance for Excel .xlsx files
         | 
| 22 | 
            +
                s = Roo::Openoffice.new("myspreadsheet.ods")      # creates an Openoffice Spreadsheet instance
         | 
| 23 | 
            +
                s = Roo::Excel.new("myspreadsheet.xls")           # creates an Excel Spreadsheet instance
         | 
| 24 | 
            +
                s = Roo::Google.new("myspreadsheetkey_at_google") # creates an Google Spreadsheet instance
         | 
| 25 | 
            +
                s = Roo::Excelx.new("myspreadsheet.xlsx")         # creates an Excel Spreadsheet instance for Excel .xlsx files
         | 
| 26 26 |  | 
| 27 | 
            -
                s.default_sheet = s.sheets.first | 
| 27 | 
            +
                s.default_sheet = s.sheets.first             # first sheet in the spreadsheet file will be used
         | 
| 28 28 |  | 
| 29 29 | 
             
                # s.sheet is an array which holds the names of the sheets within
         | 
| 30 30 | 
             
                # a spreadsheet.
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1.11. | 
| 1 | 
            +
            1.11.2
         | 
    
        data/lib/roo.rb
    CHANGED
    
    | @@ -2,29 +2,7 @@ module Roo | |
| 2 2 |  | 
| 3 3 | 
             
              VERSION = '1.10.3'
         | 
| 4 4 |  | 
| 5 | 
            -
               | 
| 6 | 
            -
                class << self
         | 
| 7 | 
            -
                  def open(file)
         | 
| 8 | 
            -
                    file = File === file ? file.path : file
         | 
| 9 | 
            -
                    case File.extname(file)
         | 
| 10 | 
            -
                    when '.xls'
         | 
| 11 | 
            -
                      Roo::Excel.new(file)
         | 
| 12 | 
            -
                    when '.xlsx'
         | 
| 13 | 
            -
                      Roo::Excelx.new(file)
         | 
| 14 | 
            -
                    when '.ods'
         | 
| 15 | 
            -
                      Roo::Openoffice.new(file)
         | 
| 16 | 
            -
                    when '.xml'
         | 
| 17 | 
            -
                      Roo::Excel2003XML.new(file)
         | 
| 18 | 
            -
                    when ''
         | 
| 19 | 
            -
                      Roo::Google.new(file)
         | 
| 20 | 
            -
                    when '.csv'
         | 
| 21 | 
            -
                      Roo::Csv.new(file)
         | 
| 22 | 
            -
                    else
         | 
| 23 | 
            -
                      raise ArgumentError, "Don't know how to open file #{file}"
         | 
| 24 | 
            -
                    end
         | 
| 25 | 
            -
                  end
         | 
| 26 | 
            -
                end
         | 
| 27 | 
            -
              end
         | 
| 5 | 
            +
              autoload :Spreadsheet, 'roo/spreadsheet'
         | 
| 28 6 |  | 
| 29 7 | 
             
              autoload :GenericSpreadsheet, 'roo/generic_spreadsheet'
         | 
| 30 8 | 
             
              autoload :Openoffice,         'roo/openoffice'
         | 
    
        data/lib/roo/csv.rb
    CHANGED
    
    | @@ -19,6 +19,8 @@ class Roo::Csv < Roo::GenericSpreadsheet | |
| 19 19 | 
             
                @last_column = Hash.new
         | 
| 20 20 | 
             
              end
         | 
| 21 21 |  | 
| 22 | 
            +
              attr_reader :filename
         | 
| 23 | 
            +
             | 
| 22 24 | 
             
              # Returns an array with the names of the sheets. In Csv class there is only
         | 
| 23 25 | 
             
              # one dummy sheet, because a csv file cannot have more than one sheet.
         | 
| 24 26 | 
             
              def sheets
         | 
| @@ -56,6 +58,17 @@ class Roo::Csv < Roo::GenericSpreadsheet | |
| 56 58 | 
             
                TYPE_MAP[value.class]
         | 
| 57 59 | 
             
              end
         | 
| 58 60 |  | 
| 61 | 
            +
              def data
         | 
| 62 | 
            +
                @data ||=
         | 
| 63 | 
            +
                  make_tmpdir do |tmpdir|
         | 
| 64 | 
            +
                    File.open(
         | 
| 65 | 
            +
                      uri?(filename) ?
         | 
| 66 | 
            +
                        open_from_uri(filename, tmpdir) :
         | 
| 67 | 
            +
                        filename
         | 
| 68 | 
            +
                    ) { |f| f.read }
         | 
| 69 | 
            +
                  end
         | 
| 70 | 
            +
              end
         | 
| 71 | 
            +
             | 
| 59 72 | 
             
              def read_cells(sheet=nil)
         | 
| 60 73 | 
             
                sheet ||= @default_sheet
         | 
| 61 74 | 
             
                @cell_type = {} unless @cell_type
         | 
| @@ -65,7 +78,7 @@ class Roo::Csv < Roo::GenericSpreadsheet | |
| 65 78 | 
             
                @first_column[sheet] = 1
         | 
| 66 79 | 
             
                @last_column[sheet] = 1
         | 
| 67 80 | 
             
                rownum = 1
         | 
| 68 | 
            -
                CSV. | 
| 81 | 
            +
                CSV.parse data do |row|
         | 
| 69 82 | 
             
                  row.each_with_index do |elem,i|
         | 
| 70 83 | 
             
                    @cell[[rownum,i+1]] = cell_postprocessing rownum,i+1, elem
         | 
| 71 84 | 
             
                    @cell_type[[rownum,i+1]] = celltype_class @cell[[rownum,i+1]]
         | 
| @@ -78,41 +91,25 @@ class Roo::Csv < Roo::GenericSpreadsheet | |
| 78 91 | 
             
                end
         | 
| 79 92 | 
             
                @cells_read[sheet] = true
         | 
| 80 93 | 
             
                #-- adjust @first_row if neccessary
         | 
| 81 | 
            -
                 | 
| 82 | 
            -
                   | 
| 83 | 
            -
                    @first_row[sheet] += 1
         | 
| 84 | 
            -
                  else
         | 
| 85 | 
            -
                    break
         | 
| 86 | 
            -
                  end
         | 
| 94 | 
            +
                while !row(@first_row[sheet]).any? and @first_row[sheet] < @last_row[sheet]
         | 
| 95 | 
            +
                  @first_row[sheet] += 1
         | 
| 87 96 | 
             
                end
         | 
| 88 97 | 
             
                #-- adjust @last_row if neccessary
         | 
| 89 | 
            -
                 | 
| 90 | 
            -
             | 
| 91 | 
            -
             | 
| 92 | 
            -
                    @last_row[sheet] -= 1
         | 
| 93 | 
            -
                  else
         | 
| 94 | 
            -
                    break
         | 
| 95 | 
            -
                  end
         | 
| 98 | 
            +
                while !row(@last_row[sheet]).any? and @last_row[sheet] and
         | 
| 99 | 
            +
                    @last_row[sheet] > @first_row[sheet]
         | 
| 100 | 
            +
                  @last_row[sheet] -= 1
         | 
| 96 101 | 
             
                end
         | 
| 97 102 | 
             
                #-- adjust @first_column if neccessary
         | 
| 98 | 
            -
                 | 
| 99 | 
            -
                  if !column(@first_column[sheet]).any? and
         | 
| 103 | 
            +
                while !column(@first_column[sheet]).any? and
         | 
| 100 104 | 
             
                      @first_column[sheet] and
         | 
| 101 105 | 
             
                      @first_column[sheet] < @last_column[sheet]
         | 
| 102 | 
            -
             | 
| 103 | 
            -
                  else
         | 
| 104 | 
            -
                    break
         | 
| 105 | 
            -
                  end
         | 
| 106 | 
            +
                  @first_column[sheet] += 1
         | 
| 106 107 | 
             
                end
         | 
| 107 108 | 
             
                #-- adjust @last_column if neccessary
         | 
| 108 | 
            -
                 | 
| 109 | 
            -
                  if !column(@last_column[sheet]).any? and
         | 
| 109 | 
            +
                while !column(@last_column[sheet]).any? and
         | 
| 110 110 | 
             
                      @last_column[sheet] and
         | 
| 111 111 | 
             
                      @last_column[sheet] > @first_column[sheet]
         | 
| 112 | 
            -
             | 
| 113 | 
            -
                  else
         | 
| 114 | 
            -
                    break
         | 
| 115 | 
            -
                  end
         | 
| 112 | 
            +
                  @last_column[sheet] -= 1
         | 
| 116 113 | 
             
                end
         | 
| 117 114 | 
             
              end
         | 
| 118 115 | 
             
            end # class Csv
         | 
    
        data/lib/roo/excel2003xml.rb
    CHANGED
    
    | @@ -2,6 +2,7 @@ require 'fileutils' | |
| 2 2 | 
             
            require 'date'
         | 
| 3 3 | 
             
            require 'base64'
         | 
| 4 4 | 
             
            require 'cgi'
         | 
| 5 | 
            +
            require 'nokogiri'
         | 
| 5 6 |  | 
| 6 7 | 
             
            class Roo::Excel2003XML < Roo::GenericSpreadsheet
         | 
| 7 8 |  | 
| @@ -118,7 +119,7 @@ class Roo::Excel2003XML < Roo::GenericSpreadsheet | |
| 118 119 |  | 
| 119 120 | 
             
              def sheets
         | 
| 120 121 | 
             
                @doc.xpath("/ss:Workbook/ss:Worksheet").map do |sheet|
         | 
| 121 | 
            -
                  sheet['Name']
         | 
| 122 | 
            +
                  sheet['ss:Name']
         | 
| 122 123 | 
             
                end
         | 
| 123 124 | 
             
              end
         | 
| 124 125 |  | 
| @@ -229,7 +230,7 @@ class Roo::Excel2003XML < Roo::GenericSpreadsheet | |
| 229 230 | 
             
                      end
         | 
| 230 231 | 
             
                      c.xpath('./ss:Data').each do |cell|
         | 
| 231 232 | 
             
                        formula = cell['Formula']
         | 
| 232 | 
            -
                        value_type = cell['Type'].downcase.to_sym
         | 
| 233 | 
            +
                        value_type = cell['ss:Type'].downcase.to_sym
         | 
| 233 234 | 
             
                        v =  cell.content
         | 
| 234 235 | 
             
                        str_v = v
         | 
| 235 236 | 
             
                        case value_type
         | 
    
        data/lib/roo/excelx.rb
    CHANGED
    
    | @@ -7,9 +7,6 @@ class Roo::Excelx < Roo::GenericSpreadsheet | |
| 7 7 | 
             
                EXCEPTIONAL_FORMATS = {
         | 
| 8 8 | 
             
                  'h:mm am/pm' => :date,
         | 
| 9 9 | 
             
                  'h:mm:ss am/pm' => :date,
         | 
| 10 | 
            -
                  'm/d/yy h:mm' => :date,
         | 
| 11 | 
            -
                  '#,##0 ;[red](#,##0)' => :float,
         | 
| 12 | 
            -
                  '#,##0.00;[red](#,##0.00)' => :float
         | 
| 13 10 | 
             
                }
         | 
| 14 11 |  | 
| 15 12 | 
             
                STANDARD_FORMATS = {
         | 
| @@ -47,6 +44,8 @@ class Roo::Excelx < Roo::GenericSpreadsheet | |
| 47 44 | 
             
                  format = format.to_s.downcase
         | 
| 48 45 | 
             
                  if type = EXCEPTIONAL_FORMATS[format]
         | 
| 49 46 | 
             
                    type
         | 
| 47 | 
            +
                  elsif format.include?('#')
         | 
| 48 | 
            +
                    :float
         | 
| 50 49 | 
             
                  elsif format.include?('d') || format.include?('y')
         | 
| 51 50 | 
             
                    if format.include?('h') || format.include?('s')
         | 
| 52 51 | 
             
                      :datetime
         | 
| @@ -405,7 +404,7 @@ class Roo::Excelx < Roo::GenericSpreadsheet | |
| 405 404 | 
             
                      # 2011-02-25 END
         | 
| 406 405 | 
             
                      # 2011-09-15 BEGIN
         | 
| 407 406 | 
             
                    when 'inlineStr'
         | 
| 408 | 
            -
             | 
| 407 | 
            +
                      :inlinestr
         | 
| 409 408 | 
             
                      # 2011-09-15 END
         | 
| 410 409 | 
             
                    else
         | 
| 411 410 | 
             
                      format = attribute2format(s_attribute)
         | 
| @@ -531,7 +530,7 @@ Datei xl/comments1.xml | |
| 531 530 |  | 
| 532 531 | 
             
              def read_labels
         | 
| 533 532 | 
             
                @label ||= Hash[@workbook_doc.xpath("//xmlns:definedName").map do |defined_name|
         | 
| 534 | 
            -
             | 
| 533 | 
            +
                  # "Sheet1!$C$5"
         | 
| 535 534 | 
             
                  sheet, coordinates = defined_name.text.split('!$', 2)
         | 
| 536 535 | 
             
                  col,row = coordinates.split('$')
         | 
| 537 536 | 
             
                  [defined_name['name'], [sheet,row,col]]
         | 
| @@ -549,10 +548,10 @@ Datei xl/comments1.xml | |
| 549 548 | 
             
                      }
         | 
| 550 549 | 
             
                    end
         | 
| 551 550 | 
             
                    # if entry.to_s.end_with?('sharedStrings.xml')
         | 
| 552 | 
            -
             | 
| 553 | 
            -
             | 
| 554 | 
            -
             | 
| 555 | 
            -
             | 
| 551 | 
            +
                    # at least one application creates this file with another (incorrect?)
         | 
| 552 | 
            +
                    # casing. It doesn't hurt, if we ignore here the correct casing - there
         | 
| 553 | 
            +
                    # won't be both names in the archive.
         | 
| 554 | 
            +
                    # Changed the casing of all the following filenames.
         | 
| 556 555 | 
             
                    if entry.to_s.downcase.end_with?('sharedstrings.xml')
         | 
| 557 556 | 
             
                      open(tmpdir+'/'+'roo_sharedStrings.xml','wb') {|f|
         | 
| 558 557 | 
             
                        f << zip.read(entry)
         | 
| @@ -524,6 +524,7 @@ class Roo::GenericSpreadsheet | |
| 524 524 | 
             
                  '.xls' => 'Roo::Excel.new',
         | 
| 525 525 | 
             
                  '.xlsx' => 'Roo::Excelx.new',
         | 
| 526 526 | 
             
                  '.csv' => 'Roo::Csv.new',
         | 
| 527 | 
            +
                  '.xml' => 'Roo::Excel2003XML.new',
         | 
| 527 528 | 
             
                }
         | 
| 528 529 | 
             
                if packed == :zip
         | 
| 529 530 | 
             
            	    # lalala.ods.zip => lalala.ods
         | 
| @@ -532,7 +533,7 @@ class Roo::GenericSpreadsheet | |
| 532 533 | 
             
            	    filename = File.basename(filename,File.extname(filename))
         | 
| 533 534 | 
             
                end
         | 
| 534 535 | 
             
                case ext
         | 
| 535 | 
            -
                when '.ods', '.xls', '.xlsx', '.csv'
         | 
| 536 | 
            +
                when '.ods', '.xls', '.xlsx', '.csv', '.xml'
         | 
| 536 537 | 
             
                  correct_class = "use #{new_expression[ext]} to handle #{ext} spreadsheet files. This has #{File.extname(filename).downcase}"
         | 
| 537 538 | 
             
                else
         | 
| 538 539 | 
             
                  raise "unknown file type: #{ext}"
         | 
| @@ -0,0 +1,25 @@ | |
| 1 | 
            +
            module Roo
         | 
| 2 | 
            +
              class Spreadsheet
         | 
| 3 | 
            +
                class << self
         | 
| 4 | 
            +
                  def open(file)
         | 
| 5 | 
            +
                    file = File === file ? file.path : file
         | 
| 6 | 
            +
                    case File.extname(file).downcase
         | 
| 7 | 
            +
                    when '.xls'
         | 
| 8 | 
            +
                      Roo::Excel.new(file)
         | 
| 9 | 
            +
                    when '.xlsx'
         | 
| 10 | 
            +
                      Roo::Excelx.new(file)
         | 
| 11 | 
            +
                    when '.ods'
         | 
| 12 | 
            +
                      Roo::Openoffice.new(file)
         | 
| 13 | 
            +
                    when '.xml'
         | 
| 14 | 
            +
                      Roo::Excel2003XML.new(file)
         | 
| 15 | 
            +
                    when ''
         | 
| 16 | 
            +
                      Roo::Google.new(file)
         | 
| 17 | 
            +
                    when '.csv'
         | 
| 18 | 
            +
                      Roo::Csv.new(file)
         | 
| 19 | 
            +
                    else
         | 
| 20 | 
            +
                      raise ArgumentError, "Don't know how to open file #{file}"
         | 
| 21 | 
            +
                    end
         | 
| 22 | 
            +
                  end
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
            end
         | 
    
        data/roo.gemspec
    CHANGED
    
    | @@ -5,11 +5,11 @@ | |
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 7 | 
             
              s.name = "roo"
         | 
| 8 | 
            -
              s.version = "1.11. | 
| 8 | 
            +
              s.version = "1.11.2"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 11 | 
             
              s.authors = ["Thomas Preymesser", "Hugh McGowan", "Ben Woosley"]
         | 
| 12 | 
            -
              s.date = "2013- | 
| 12 | 
            +
              s.date = "2013-04-10"
         | 
| 13 13 | 
             
              s.description = "Roo can access the contents of various spreadsheet files. It can handle\n* Openoffice\n* Excel\n* Google spreadsheets\n* Excelx\n* Libreoffice\n* CSV"
         | 
| 14 14 | 
             
              s.email = "ruby.ruby.ruby.roo@gmail.com"
         | 
| 15 15 | 
             
              s.extra_rdoc_files = [
         | 
| @@ -38,10 +38,13 @@ Gem::Specification.new do |s| | |
| 38 38 | 
             
                "lib/roo/google.rb",
         | 
| 39 39 | 
             
                "lib/roo/openoffice.rb",
         | 
| 40 40 | 
             
                "lib/roo/roo_rails_helper.rb",
         | 
| 41 | 
            +
                "lib/roo/spreadsheet.rb",
         | 
| 41 42 | 
             
                "lib/roo/worksheet.rb",
         | 
| 42 43 | 
             
                "roo.gemspec",
         | 
| 43 44 | 
             
                "scripts/txt2html",
         | 
| 45 | 
            +
                "spec/lib/roo/excel2003xml_spec.rb",
         | 
| 44 46 | 
             
                "spec/lib/roo/excelx/format_spec.rb",
         | 
| 47 | 
            +
                "spec/lib/roo/spreadsheet_spec.rb",
         | 
| 45 48 | 
             
                "spec/spec_helper.rb",
         | 
| 46 49 | 
             
                "test/all_ss.rb",
         | 
| 47 50 | 
             
                "test/files/1900_base.xls",
         | 
| @@ -162,7 +165,7 @@ Gem::Specification.new do |s| | |
| 162 165 | 
             
              s.rubyforge_project = "roo"
         | 
| 163 166 | 
             
              s.rubygems_version = "1.8.24"
         | 
| 164 167 | 
             
              s.summary = "Roo can access the contents of various spreadsheet files."
         | 
| 165 | 
            -
              s.test_files = ["spec/lib/roo/excelx/format_spec.rb", "spec/spec_helper.rb", "test/all_ss.rb", "test/files/1900_base.xls", "test/files/1904_base.xls", "test/files/ | 
| 168 | 
            +
              s.test_files = ["spec/lib/roo/excel2003xml_spec.rb", "spec/lib/roo/excelx/format_spec.rb", "spec/lib/roo/spreadsheet_spec.rb", "spec/spec_helper.rb", "test/all_ss.rb", "test/files/1900_base.xls", "test/files/1904_base.xls", "test/files/bad_excel_date.xls", "test/files/bbu.ods", "test/files/bbu.xls", "test/files/bbu.xlsx", "test/files/bbu.xml", "test/files/Bibelbund.csv", "test/files/Bibelbund.ods", "test/files/Bibelbund.xls", "test/files/Bibelbund.xlsx", "test/files/Bibelbund.xml", "test/files/Bibelbund1.ods", "test/files/bode-v1.ods.zip", "test/files/bode-v1.xls.zip", "test/files/boolean.ods", "test/files/boolean.xls", "test/files/boolean.xlsx", "test/files/boolean.xml", "test/files/borders.ods", "test/files/borders.xls", "test/files/borders.xlsx", "test/files/borders.xml", "test/files/bug-row-column-fixnum-float.xls", "test/files/bug-row-column-fixnum-float.xml", "test/files/comments.ods", "test/files/comments.xls", "test/files/comments.xlsx", "test/files/csvtypes.csv", "test/files/datetime.ods", "test/files/datetime.xls", "test/files/datetime.xlsx", "test/files/datetime.xml", "test/files/datetime_floatconv.xls", "test/files/datetime_floatconv.xml", "test/files/dreimalvier.ods", "test/files/emptysheets.ods", "test/files/emptysheets.xls", "test/files/emptysheets.xlsx", "test/files/emptysheets.xml", "test/files/excel2003.xml", "test/files/false_encoding.xls", "test/files/false_encoding.xml", "test/files/formula.ods", "test/files/formula.xls", "test/files/formula.xlsx", "test/files/formula.xml", "test/files/formula_parse_error.xls", "test/files/formula_parse_error.xml", "test/files/formula_string_error.xlsx", "test/files/html-escape.ods", "test/files/matrix.ods", "test/files/matrix.xls", "test/files/named_cells.ods", "test/files/named_cells.xls", "test/files/named_cells.xlsx", "test/files/no_spreadsheet_file.txt", "test/files/numbers1.csv", "test/files/numbers1.ods", "test/files/numbers1.xls", "test/files/numbers1.xlsx", "test/files/numbers1.xml", "test/files/only_one_sheet.ods", "test/files/only_one_sheet.xls", "test/files/only_one_sheet.xlsx", "test/files/only_one_sheet.xml", "test/files/paragraph.ods", "test/files/paragraph.xls", "test/files/paragraph.xlsx", "test/files/paragraph.xml", "test/files/Pfand_from_windows_phone.xlsx", "test/files/prova.xls", "test/files/ric.ods", "test/files/simple_spreadsheet.ods", "test/files/simple_spreadsheet.xls", "test/files/simple_spreadsheet.xlsx", "test/files/simple_spreadsheet.xml", "test/files/simple_spreadsheet_from_italo.ods", "test/files/simple_spreadsheet_from_italo.xls", "test/files/simple_spreadsheet_from_italo.xml", "test/files/so_datetime.csv", "test/files/style.ods", "test/files/style.xls", "test/files/style.xlsx", "test/files/style.xml", "test/files/time-test.csv", "test/files/time-test.ods", "test/files/time-test.xls", "test/files/time-test.xlsx", "test/files/time-test.xml", "test/files/type_excel.ods", "test/files/type_excel.xlsx", "test/files/type_excelx.ods", "test/files/type_excelx.xls", "test/files/type_openoffice.xls", "test/files/type_openoffice.xlsx", "test/files/whitespace.ods", "test/files/whitespace.xls", "test/files/whitespace.xlsx", "test/files/whitespace.xml", "test/rm_sub_test.rb", "test/rm_test.rb", "test/test_generic_spreadsheet.rb", "test/test_helper.rb", "test/test_roo.rb"]
         | 
| 166 169 |  | 
| 167 170 | 
             
              if s.respond_to? :specification_version then
         | 
| 168 171 | 
             
                s.specification_version = 3
         | 
| @@ -0,0 +1,15 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe Roo::Excel2003XML do
         | 
| 4 | 
            +
              describe '.new' do
         | 
| 5 | 
            +
                context 'with an xml file' do
         | 
| 6 | 
            +
                  let(:path) { 'test/files/datetime.xml' }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  it 'loads the file' do
         | 
| 9 | 
            +
                    expect {
         | 
| 10 | 
            +
                      Roo::Excel2003XML.new(path)
         | 
| 11 | 
            +
                    }.to_not raise_error
         | 
| 12 | 
            +
                  end
         | 
| 13 | 
            +
                end
         | 
| 14 | 
            +
              end
         | 
| 15 | 
            +
            end
         | 
| @@ -21,11 +21,12 @@ describe Roo::Excelx::Format do | |
| 21 21 | 
             
                  'h:mm:ss AM/PM' => :date,
         | 
| 22 22 | 
             
                  'h:mm' => :time,
         | 
| 23 23 | 
             
                  'h:mm:ss' => :time,
         | 
| 24 | 
            -
                  'm/d/yy h:mm' => : | 
| 24 | 
            +
                  'm/d/yy h:mm' => :datetime,
         | 
| 25 25 | 
             
                  '#,##0 ;(#,##0)' => :float,
         | 
| 26 26 | 
             
                  '#,##0 ;[Red](#,##0)' => :float,
         | 
| 27 27 | 
             
                  '#,##0.00;(#,##0.00)' => :float,
         | 
| 28 28 | 
             
                  '#,##0.00;[Red](#,##0.00)' => :float,
         | 
| 29 | 
            +
                  '#,##0_);[Red](#,##0)' => :float,
         | 
| 29 30 | 
             
                  'mm:ss' => :time,
         | 
| 30 31 | 
             
                  '[h]:mm:ss' => :time,
         | 
| 31 32 | 
             
                  'mmss.0' => :time,
         | 
| @@ -36,6 +37,7 @@ describe Roo::Excelx::Format do | |
| 36 37 | 
             
                  'dd/mm/yy' => :date,
         | 
| 37 38 | 
             
                  'hh:mm:ss' => :time,
         | 
| 38 39 | 
             
                  "dd/mm/yy\\ hh:mm" => :datetime,
         | 
| 40 | 
            +
                  'dd/mmm/yy\\ hh:mm' => :datetime,
         | 
| 39 41 | 
             
                  'dd/mmm/yy' => :date, # 2011-05-21
         | 
| 40 42 | 
             
                  'yyyy-mm-dd' => :date, # 2011-09-16
         | 
| 41 43 | 
             
                  'yyyy-mm-dd;@' => :date
         | 
| @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe Roo::Spreadsheet do
         | 
| 4 | 
            +
              describe '.open' do
         | 
| 5 | 
            +
                context 'when the file extension is uppercase' do
         | 
| 6 | 
            +
                  let(:filename) { 'file.XLS' }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  it 'loads the proper type' do
         | 
| 9 | 
            +
                    Roo::Excel.should_receive(:new).with(filename)
         | 
| 10 | 
            +
                    Roo::Spreadsheet.open(filename)
         | 
| 11 | 
            +
                  end
         | 
| 12 | 
            +
                end
         | 
| 13 | 
            +
              end
         | 
| 14 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: roo
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.11. | 
| 4 | 
            +
              version: 1.11.2
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -11,7 +11,7 @@ authors: | |
| 11 11 | 
             
            autorequire: 
         | 
| 12 12 | 
             
            bindir: bin
         | 
| 13 13 | 
             
            cert_chain: []
         | 
| 14 | 
            -
            date: 2013- | 
| 14 | 
            +
            date: 2013-04-10 00:00:00.000000000 Z
         | 
| 15 15 | 
             
            dependencies:
         | 
| 16 16 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 17 17 | 
             
              name: spreadsheet
         | 
| @@ -118,10 +118,13 @@ files: | |
| 118 118 | 
             
            - lib/roo/google.rb
         | 
| 119 119 | 
             
            - lib/roo/openoffice.rb
         | 
| 120 120 | 
             
            - lib/roo/roo_rails_helper.rb
         | 
| 121 | 
            +
            - lib/roo/spreadsheet.rb
         | 
| 121 122 | 
             
            - lib/roo/worksheet.rb
         | 
| 122 123 | 
             
            - roo.gemspec
         | 
| 123 124 | 
             
            - scripts/txt2html
         | 
| 125 | 
            +
            - spec/lib/roo/excel2003xml_spec.rb
         | 
| 124 126 | 
             
            - spec/lib/roo/excelx/format_spec.rb
         | 
| 127 | 
            +
            - spec/lib/roo/spreadsheet_spec.rb
         | 
| 125 128 | 
             
            - spec/spec_helper.rb
         | 
| 126 129 | 
             
            - test/all_ss.rb
         | 
| 127 130 | 
             
            - test/files/1900_base.xls
         | 
| @@ -260,23 +263,24 @@ signing_key: | |
| 260 263 | 
             
            specification_version: 3
         | 
| 261 264 | 
             
            summary: Roo can access the contents of various spreadsheet files.
         | 
| 262 265 | 
             
            test_files:
         | 
| 266 | 
            +
            - spec/lib/roo/excel2003xml_spec.rb
         | 
| 263 267 | 
             
            - spec/lib/roo/excelx/format_spec.rb
         | 
| 268 | 
            +
            - spec/lib/roo/spreadsheet_spec.rb
         | 
| 264 269 | 
             
            - spec/spec_helper.rb
         | 
| 265 270 | 
             
            - test/all_ss.rb
         | 
| 266 271 | 
             
            - test/files/1900_base.xls
         | 
| 267 272 | 
             
            - test/files/1904_base.xls
         | 
| 273 | 
            +
            - test/files/bad_excel_date.xls
         | 
| 274 | 
            +
            - test/files/bbu.ods
         | 
| 275 | 
            +
            - test/files/bbu.xls
         | 
| 276 | 
            +
            - test/files/bbu.xlsx
         | 
| 277 | 
            +
            - test/files/bbu.xml
         | 
| 268 278 | 
             
            - test/files/Bibelbund.csv
         | 
| 269 279 | 
             
            - test/files/Bibelbund.ods
         | 
| 270 280 | 
             
            - test/files/Bibelbund.xls
         | 
| 271 281 | 
             
            - test/files/Bibelbund.xlsx
         | 
| 272 282 | 
             
            - test/files/Bibelbund.xml
         | 
| 273 283 | 
             
            - test/files/Bibelbund1.ods
         | 
| 274 | 
            -
            - test/files/Pfand_from_windows_phone.xlsx
         | 
| 275 | 
            -
            - test/files/bad_excel_date.xls
         | 
| 276 | 
            -
            - test/files/bbu.ods
         | 
| 277 | 
            -
            - test/files/bbu.xls
         | 
| 278 | 
            -
            - test/files/bbu.xlsx
         | 
| 279 | 
            -
            - test/files/bbu.xml
         | 
| 280 284 | 
             
            - test/files/bode-v1.ods.zip
         | 
| 281 285 | 
             
            - test/files/bode-v1.xls.zip
         | 
| 282 286 | 
             
            - test/files/boolean.ods
         | 
| @@ -334,6 +338,7 @@ test_files: | |
| 334 338 | 
             
            - test/files/paragraph.xls
         | 
| 335 339 | 
             
            - test/files/paragraph.xlsx
         | 
| 336 340 | 
             
            - test/files/paragraph.xml
         | 
| 341 | 
            +
            - test/files/Pfand_from_windows_phone.xlsx
         | 
| 337 342 | 
             
            - test/files/prova.xls
         | 
| 338 343 | 
             
            - test/files/ric.ods
         | 
| 339 344 | 
             
            - test/files/simple_spreadsheet.ods
         |