saxlsx 1.6.1 → 1.10.0
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.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +20 -0
- data/Gemfile +1 -1
- data/README.md +15 -17
- data/Rakefile +0 -1
- data/lib/saxlsx.rb +1 -0
- data/lib/saxlsx/boolean_parser.rb +2 -1
- data/lib/saxlsx/column_name_generator.rb +2 -1
- data/lib/saxlsx/file_system.rb +10 -3
- data/lib/saxlsx/rows_collection.rb +2 -15
- data/lib/saxlsx/rows_collection_count_parser.rb +37 -0
- data/lib/saxlsx/rows_collection_parser.rb +1 -0
- data/lib/saxlsx/sax_parser.rb +3 -2
- data/lib/saxlsx/shared_string_collection.rb +2 -1
- data/lib/saxlsx/shared_string_collection_parser.rb +3 -2
- data/lib/saxlsx/sheet.rb +2 -1
- data/lib/saxlsx/sheet_collection.rb +2 -1
- data/lib/saxlsx/sheet_collection_parser.rb +2 -1
- data/lib/saxlsx/style_collection.rb +2 -1
- data/lib/saxlsx/style_collection_parser.rb +3 -2
- data/lib/saxlsx/version.rb +2 -1
- data/lib/saxlsx/workbook.rb +5 -4
- data/saxlsx.gemspec +5 -4
- data/spec/benchmarks.rb +1 -0
- data/spec/column_name_generator_spec.rb +2 -1
- data/spec/data/Spec.xlsx +0 -0
- data/spec/data/SpecMultiline10.xlsx +0 -0
- data/spec/data/SpecMultilineN.xlsx +0 -0
- data/spec/data/SpecSloppy.xlsx +0 -0
- data/spec/sheet_spec.rb +45 -3
- data/spec/spec_helper.rb +5 -2
- data/spec/workbook_spec.rb +10 -2
- metadata +35 -15
- data/.travis.yml +0 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: dbf7deaac6c1374b387a2a4bd3ec2afe156a653d7fea428c7aaf7c03750d4467
         | 
| 4 | 
            +
              data.tar.gz: 8f6438c71ac90906eb744cd6088aa9d068a6af50f4a4c10385ec58340c016c34
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 71f9a9d1a87543144bd80c6478dcc4b2ab48cf6a22b25bbf617564f2bf2538fff0889c9fff0db4f7821d8929213a48f42fe56fad8e209a296d0b77274bb83c75
         | 
| 7 | 
            +
              data.tar.gz: e40bbc6c0d587f913a88ce588bdf5c90ac3e7d4b60ca134d1f1c65e5fcd21bfbef0d7707fa83d1d5e12141479484523fbf1b2ac85811dfc6dcb5feec77284f67
         | 
| @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            name: Ruby
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            on: [push, pull_request]
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            jobs:
         | 
| 6 | 
            +
              test:
         | 
| 7 | 
            +
                runs-on: ubuntu-latest
         | 
| 8 | 
            +
                strategy:
         | 
| 9 | 
            +
                  matrix:
         | 
| 10 | 
            +
                    ruby-version: ['2.5', '2.6', '2.7', '3.0']
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                steps:
         | 
| 13 | 
            +
                - uses: actions/checkout@v2
         | 
| 14 | 
            +
                - name: Set up Ruby
         | 
| 15 | 
            +
                  uses: ruby/setup-ruby@v1
         | 
| 16 | 
            +
                  with:
         | 
| 17 | 
            +
                    ruby-version: ${{ matrix.ruby-version }}
         | 
| 18 | 
            +
                    bundler-cache: true # runs 'bundle install' and caches installed gems automatically
         | 
| 19 | 
            +
                - name: Run tests
         | 
| 20 | 
            +
                  run: bundle exec rake
         | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -2,8 +2,6 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            [](https://gitter.im/mak-it/saxlsx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
         | 
| 4 4 |  | 
| 5 | 
            -
            [](https://travis-ci.org/mak-it/saxlsx)
         | 
| 6 | 
            -
             | 
| 7 5 | 
             
            **Fast** and memory efficient XLSX reader on top of Ox SAX parser.
         | 
| 8 6 |  | 
| 9 7 | 
             
            It reads row by row and doesn't store the whole sheet in memory, so this
         | 
| @@ -52,30 +50,30 @@ using `auto_format: false`. | |
| 52 50 | 
             
            $ rake bench
         | 
| 53 51 | 
             
            ```
         | 
| 54 52 |  | 
| 55 | 
            -
            ruby 2. | 
| 53 | 
            +
            ruby 2.7 on OS X
         | 
| 56 54 |  | 
| 57 55 | 
             
            ```
         | 
| 58 56 | 
             
            Shared Strings
         | 
| 59 57 |  | 
| 60 58 | 
             
                                       user     system      total        real
         | 
| 61 | 
            -
            creek                   | 
| 62 | 
            -
            dullard                 | 
| 63 | 
            -
            oxcelix                 | 
| 64 | 
            -
            roo | 
| 65 | 
            -
            rubyXL                  | 
| 66 | 
            -
            saxlsx                 0. | 
| 67 | 
            -
            simple_xlsx_reader     1. | 
| 59 | 
            +
            creek                  1.296539   0.029374   1.325913 (  1.340820)
         | 
| 60 | 
            +
            dullard                1.178981   0.025073   1.204054 (  1.221381)
         | 
| 61 | 
            +
            oxcelix                0.985258   0.025028   1.010286 (  1.023730)
         | 
| 62 | 
            +
            roo                    0.971155   0.029964   1.001119 (  1.016452)
         | 
| 63 | 
            +
            rubyXL                 2.979334   0.055708   3.035042 (  3.079301)
         | 
| 64 | 
            +
            saxlsx                 0.473398   0.011342   0.484740 (  0.490247)
         | 
| 65 | 
            +
            simple_xlsx_reader     1.209074   0.024579   1.233653 (  1.249957)
         | 
| 68 66 |  | 
| 69 67 | 
             
            Inline Strings
         | 
| 70 68 |  | 
| 71 69 | 
             
                                       user     system      total        real
         | 
| 72 | 
            -
            creek                   | 
| 73 | 
            -
            dullard                 | 
| 74 | 
            -
            oxcelix | 
| 75 | 
            -
            roo | 
| 76 | 
            -
            rubyXL                  | 
| 77 | 
            -
            saxlsx                 0. | 
| 78 | 
            -
            simple_xlsx_reader     1. | 
| 70 | 
            +
            creek                  1.471115   0.075182   1.546297 (  1.567045)
         | 
| 71 | 
            +
            dullard                1.338499   0.085116   1.423615 (  1.443386)
         | 
| 72 | 
            +
            oxcelix                ERROR
         | 
| 73 | 
            +
            roo                    1.133878   0.052834   1.186712 (  1.208369)
         | 
| 74 | 
            +
            rubyXL                 3.213630   0.070255   3.283885 (  3.324428)
         | 
| 75 | 
            +
            saxlsx                 0.667601   0.024265   0.691866 (  0.696603)
         | 
| 76 | 
            +
            simple_xlsx_reader     1.350298   0.028411   1.378709 (  1.396583)
         | 
| 79 77 | 
             
            ```
         | 
| 80 78 |  | 
| 81 79 | 
             
            ## Contributing
         | 
    
        data/Rakefile
    CHANGED
    
    
    
        data/lib/saxlsx.rb
    CHANGED
    
    
    
        data/lib/saxlsx/file_system.rb
    CHANGED
    
    | @@ -1,5 +1,7 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 1 2 | 
             
            module Saxlsx
         | 
| 2 3 | 
             
              class FileSystem
         | 
| 4 | 
            +
                IO_METHODS = [:tell, :seek, :read, :close]
         | 
| 3 5 |  | 
| 4 6 | 
             
                def self.open(filename)
         | 
| 5 7 | 
             
                  begin
         | 
| @@ -11,11 +13,16 @@ module Saxlsx | |
| 11 13 | 
             
                end
         | 
| 12 14 |  | 
| 13 15 | 
             
                def initialize(filename)
         | 
| 14 | 
            -
                   | 
| 16 | 
            +
                  if IO_METHODS.map { |method| filename.respond_to?(method) }.all?
         | 
| 17 | 
            +
                    @zip = Zip::File.open_buffer filename
         | 
| 18 | 
            +
                    @io = true
         | 
| 19 | 
            +
                  else
         | 
| 20 | 
            +
                    @zip = Zip::File.open filename
         | 
| 21 | 
            +
                  end
         | 
| 15 22 | 
             
                end
         | 
| 16 23 |  | 
| 17 24 | 
             
                def close
         | 
| 18 | 
            -
                  @zip.close
         | 
| 25 | 
            +
                  @zip.close unless @io
         | 
| 19 26 | 
             
                end
         | 
| 20 27 |  | 
| 21 28 | 
             
                def workbook
         | 
| @@ -36,4 +43,4 @@ module Saxlsx | |
| 36 43 | 
             
                end
         | 
| 37 44 |  | 
| 38 45 | 
             
              end
         | 
| 39 | 
            -
            end
         | 
| 46 | 
            +
            end
         | 
| @@ -1,3 +1,4 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 1 2 | 
             
            module Saxlsx
         | 
| 2 3 | 
             
              class RowsCollection
         | 
| 3 4 |  | 
| @@ -15,21 +16,7 @@ module Saxlsx | |
| 15 16 | 
             
                end
         | 
| 16 17 |  | 
| 17 18 | 
             
                def count
         | 
| 18 | 
            -
                   | 
| 19 | 
            -
                    @count = 0
         | 
| 20 | 
            -
                    begin
         | 
| 21 | 
            -
                      @sheet.each_line('>') do |line|
         | 
| 22 | 
            -
                        matches = line.match(/<dimension ref="[^:]+:[A-Z]*(\d+)"/)
         | 
| 23 | 
            -
                        if matches
         | 
| 24 | 
            -
                          @count = matches[1].to_i
         | 
| 25 | 
            -
                          break if @count
         | 
| 26 | 
            -
                        end
         | 
| 27 | 
            -
                      end
         | 
| 28 | 
            -
                    ensure
         | 
| 29 | 
            -
                      @sheet.rewind
         | 
| 30 | 
            -
                    end
         | 
| 31 | 
            -
                  end
         | 
| 32 | 
            -
                  @count
         | 
| 19 | 
            +
                  @count ||= RowsCollectionCountParser.count @sheet
         | 
| 33 20 | 
             
                end
         | 
| 34 21 |  | 
| 35 22 | 
             
                alias :size :count
         | 
| @@ -0,0 +1,37 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
            module Saxlsx
         | 
| 3 | 
            +
              class RowsCollectionCountParser < Ox::Sax
         | 
| 4 | 
            +
                def self.count(data, &block)
         | 
| 5 | 
            +
                  parser = new
         | 
| 6 | 
            +
                  catch :abort do
         | 
| 7 | 
            +
                    SaxParser.parse parser, data
         | 
| 8 | 
            +
                  end
         | 
| 9 | 
            +
                  parser.count
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                attr_reader :count
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                def initialize
         | 
| 15 | 
            +
                  @count = 0
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                def start_element(name)
         | 
| 19 | 
            +
                  @current_element = name
         | 
| 20 | 
            +
                  if name == :row
         | 
| 21 | 
            +
                    @count += 1
         | 
| 22 | 
            +
                  end
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                def attr(name, value)
         | 
| 26 | 
            +
                  if @current_element == :dimension
         | 
| 27 | 
            +
                    if name == :ref && value
         | 
| 28 | 
            +
                      matches = value.match(/[^:]+:[A-Z]*(\d+)/)
         | 
| 29 | 
            +
                      if matches
         | 
| 30 | 
            +
                        @count = matches[1].to_i
         | 
| 31 | 
            +
                        throw :abort
         | 
| 32 | 
            +
                      end
         | 
| 33 | 
            +
                    end
         | 
| 34 | 
            +
                  end
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
              end
         | 
| 37 | 
            +
            end
         | 
    
        data/lib/saxlsx/sax_parser.rb
    CHANGED
    
    
| @@ -1,3 +1,4 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 1 2 | 
             
            module Saxlsx
         | 
| 2 3 | 
             
              class SharedStringCollectionParser < Ox::Sax
         | 
| 3 4 |  | 
| @@ -15,7 +16,7 @@ module Saxlsx | |
| 15 16 | 
             
                end
         | 
| 16 17 |  | 
| 17 18 | 
             
                def start_element(name)
         | 
| 18 | 
            -
                  @current_string =  | 
| 19 | 
            +
                  @current_string = String.new if name == :si
         | 
| 19 20 | 
             
                end
         | 
| 20 21 |  | 
| 21 22 | 
             
                def end_element(name)
         | 
| @@ -30,4 +31,4 @@ module Saxlsx | |
| 30 31 | 
             
                end
         | 
| 31 32 |  | 
| 32 33 | 
             
              end
         | 
| 33 | 
            -
            end
         | 
| 34 | 
            +
            end
         | 
    
        data/lib/saxlsx/sheet.rb
    CHANGED
    
    
| @@ -1,3 +1,4 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 1 2 | 
             
            module Saxlsx
         | 
| 2 3 | 
             
              class StyleCollectionParser < Ox::Sax
         | 
| 3 4 | 
             
                def self.parse(file_system, &block)
         | 
| @@ -32,7 +33,7 @@ module Saxlsx | |
| 32 33 | 
             
                      if custom_num_fmt_code
         | 
| 33 34 | 
             
                        @block.call custom_num_fmt_code
         | 
| 34 35 | 
             
                      else
         | 
| 35 | 
            -
                        @block.call @num_fmt_id
         | 
| 36 | 
            +
                        @block.call @num_fmt_id.to_i
         | 
| 36 37 | 
             
                      end
         | 
| 37 38 | 
             
                    end
         | 
| 38 39 | 
             
                  when :numFmt
         | 
| @@ -49,4 +50,4 @@ module Saxlsx | |
| 49 50 | 
             
                  end
         | 
| 50 51 | 
             
                end
         | 
| 51 52 | 
             
              end
         | 
| 52 | 
            -
            end
         | 
| 53 | 
            +
            end
         | 
    
        data/lib/saxlsx/version.rb
    CHANGED
    
    
    
        data/lib/saxlsx/workbook.rb
    CHANGED
    
    | @@ -1,3 +1,4 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 1 2 | 
             
            module Saxlsx
         | 
| 2 3 | 
             
              class Workbook
         | 
| 3 4 | 
             
                DATE_SYSTEM_1900 = DateTime.new(1899, 12, 30)
         | 
| @@ -6,12 +7,12 @@ module Saxlsx | |
| 6 7 | 
             
                attr_accessor :date1904
         | 
| 7 8 | 
             
                attr_reader :auto_format
         | 
| 8 9 |  | 
| 9 | 
            -
                def self.open( | 
| 10 | 
            +
                def self.open(filename, **kw_args)
         | 
| 10 11 | 
             
                  begin
         | 
| 11 | 
            -
                    workbook =  | 
| 12 | 
            +
                    workbook = new(filename, **kw_args)
         | 
| 12 13 | 
             
                    yield workbook
         | 
| 13 14 | 
             
                  ensure
         | 
| 14 | 
            -
                    workbook.close
         | 
| 15 | 
            +
                    workbook.close if workbook
         | 
| 15 16 | 
             
                  end
         | 
| 16 17 | 
             
                end
         | 
| 17 18 |  | 
| @@ -50,4 +51,4 @@ module Saxlsx | |
| 50 51 | 
             
                end
         | 
| 51 52 |  | 
| 52 53 | 
             
              end
         | 
| 53 | 
            -
            end
         | 
| 54 | 
            +
            end
         | 
    
        data/saxlsx.gemspec
    CHANGED
    
    | @@ -18,13 +18,14 @@ Gem::Specification.new do |spec| | |
| 18 18 | 
             
              spec.test_files    = spec.files.grep(%r{^spec/})
         | 
| 19 19 | 
             
              spec.require_paths = ["lib"]
         | 
| 20 20 |  | 
| 21 | 
            -
              spec.required_ruby_version = '>= 2. | 
| 21 | 
            +
              spec.required_ruby_version = '>= 2.5.0'
         | 
| 22 22 |  | 
| 23 23 | 
             
              spec.add_dependency 'rubyzip', '~> 1.0'
         | 
| 24 24 | 
             
              spec.add_dependency 'ox', '~> 2.1'
         | 
| 25 25 |  | 
| 26 | 
            -
              spec.add_development_dependency 'bundler', " | 
| 27 | 
            -
              spec.add_development_dependency 'rake', '~>  | 
| 28 | 
            -
              spec.add_development_dependency 'rspec', '~>  | 
| 26 | 
            +
              spec.add_development_dependency 'bundler', ">= 1.5"
         | 
| 27 | 
            +
              spec.add_development_dependency 'rake', '~> 13.0'
         | 
| 28 | 
            +
              spec.add_development_dependency 'rspec', '~> 3.10'
         | 
| 29 | 
            +
              spec.add_development_dependency 'rspec-collection_matchers'
         | 
| 29 30 | 
             
              spec.add_development_dependency 'simplecov', '~> 0.8'
         | 
| 30 31 | 
             
            end
         | 
    
        data/spec/benchmarks.rb
    CHANGED
    
    
    
        data/spec/data/Spec.xlsx
    CHANGED
    
    | Binary file | 
| Binary file | 
| Binary file | 
| Binary file | 
    
        data/spec/sheet_spec.rb
    CHANGED
    
    | @@ -1,3 +1,4 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 1 2 | 
             
            # encoding: UTF-8
         | 
| 2 3 | 
             
            require 'spec_helper'
         | 
| 3 4 |  | 
| @@ -35,7 +36,7 @@ describe Sheet do | |
| 35 36 | 
             
                      3,
         | 
| 36 37 | 
             
                      DateTime.new(2013, 12, 13, 8, 0, 58),
         | 
| 37 38 | 
             
                      DateTime.new(1970, 1, 1),
         | 
| 38 | 
            -
                      BigDecimal | 
| 39 | 
            +
                      BigDecimal('3.4028236692093801E+38'),
         | 
| 39 40 | 
             
                      DateTime.new(2015, 2, 13, 12, 40, 5)
         | 
| 40 41 | 
             
                    ]
         | 
| 41 42 | 
             
                    s.rows[1].should eq [
         | 
| @@ -92,6 +93,19 @@ describe Sheet do | |
| 92 93 | 
             
                end
         | 
| 93 94 | 
             
              end
         | 
| 94 95 |  | 
| 96 | 
            +
              it 'Handle missing fonts and dimension tags' do
         | 
| 97 | 
            +
                filename = "#{File.dirname(__FILE__)}/data/SpecSloppy.xlsx"
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                Workbook.open filename do |w|
         | 
| 100 | 
            +
                  w.sheets[0].rows.count.should eq 85
         | 
| 101 | 
            +
                  headers = w.sheets[0].rows.first
         | 
| 102 | 
            +
                  headers.count.should eq 52
         | 
| 103 | 
            +
                  headers.each do |str|
         | 
| 104 | 
            +
                    str.should eq "X"
         | 
| 105 | 
            +
                  end
         | 
| 106 | 
            +
                end
         | 
| 107 | 
            +
              end
         | 
| 108 | 
            +
             | 
| 95 109 | 
             
              context 'with 1904 date system' do
         | 
| 96 110 | 
             
                let(:filename) { "#{File.dirname(__FILE__)}/data/Spec1904.xlsx" }
         | 
| 97 111 |  | 
| @@ -107,6 +121,34 @@ describe Sheet do | |
| 107 121 | 
             
                end
         | 
| 108 122 | 
             
              end
         | 
| 109 123 |  | 
| 124 | 
            +
              context 'with mutliline strings (
)' do
         | 
| 125 | 
            +
                let(:filename) { "#{File.dirname(__FILE__)}/data/SpecMultiline10.xlsx" }
         | 
| 126 | 
            +
             | 
| 127 | 
            +
                it 'should return multiline cells' do
         | 
| 128 | 
            +
                  Workbook.open filename do |w|
         | 
| 129 | 
            +
                    w.sheets[0].tap do |s|
         | 
| 130 | 
            +
                      s.rows[0].should eq [
         | 
| 131 | 
            +
                        "Test\nTest1\nTest3"
         | 
| 132 | 
            +
                      ]
         | 
| 133 | 
            +
                    end
         | 
| 134 | 
            +
                  end
         | 
| 135 | 
            +
                end
         | 
| 136 | 
            +
              end
         | 
| 137 | 
            +
             | 
| 138 | 
            +
              context 'with mutliline strings (\n)' do
         | 
| 139 | 
            +
                let(:filename) { "#{File.dirname(__FILE__)}/data/SpecMultilineN.xlsx" }
         | 
| 140 | 
            +
             | 
| 141 | 
            +
                it 'should return multiline cells' do
         | 
| 142 | 
            +
                  Workbook.open filename do |w|
         | 
| 143 | 
            +
                    w.sheets[0].tap do |s|
         | 
| 144 | 
            +
                      s.rows[0].should eq [
         | 
| 145 | 
            +
                        "Test\nTest1\nTest3"
         | 
| 146 | 
            +
                      ]
         | 
| 147 | 
            +
                    end
         | 
| 148 | 
            +
                  end
         | 
| 149 | 
            +
                end
         | 
| 150 | 
            +
              end
         | 
| 151 | 
            +
             | 
| 110 152 | 
             
              context 'with inline strings' do
         | 
| 111 153 | 
             
                let(:filename) { "#{File.dirname(__FILE__)}/data/SpecInlineStrings.xlsx" }
         | 
| 112 154 |  | 
| @@ -133,7 +175,7 @@ describe Sheet do | |
| 133 175 | 
             
                  ["Time",       DateTime.new(2015, 2, 13, 12, 40, 5)],
         | 
| 134 176 | 
             
                  ["Percentage", 0.9999],
         | 
| 135 177 | 
             
                  ["Fraction",   0.5],
         | 
| 136 | 
            -
                  ["Scientific", BigDecimal | 
| 178 | 
            +
                  ["Scientific", BigDecimal('3.4028236692093801E+38')],
         | 
| 137 179 | 
             
                  ["Custom",     123.0],
         | 
| 138 180 | 
             
                ].each.with_index do |row, i|
         | 
| 139 181 | 
             
                  name, value = row
         | 
| @@ -160,7 +202,7 @@ describe Sheet do | |
| 160 202 | 
             
                  ["Time",       DateTime.new(2015, 2, 13, 12, 40, 5)],
         | 
| 161 203 | 
             
                  ["Percentage", 0.9999],
         | 
| 162 204 | 
             
                  ["Fraction",   0.5],
         | 
| 163 | 
            -
                  ["Scientific", BigDecimal | 
| 205 | 
            +
                  ["Scientific", BigDecimal('3.4028236692093801E+38')],
         | 
| 164 206 | 
             
                  ["Custom",     123.0],
         | 
| 165 207 | 
             
                ].each.with_index do |row, i|
         | 
| 166 208 | 
             
                  name, value = row
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        data/spec/workbook_spec.rb
    CHANGED
    
    | @@ -1,9 +1,17 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 1 2 | 
             
            require 'spec_helper'
         | 
| 2 3 |  | 
| 3 4 | 
             
            describe Workbook do
         | 
| 4 5 |  | 
| 5 6 | 
             
              let(:filename) { "#{File.dirname(__FILE__)}/data/Spec.xlsx" }
         | 
| 6 7 |  | 
| 8 | 
            +
              it 'Reads from StringIO' do
         | 
| 9 | 
            +
                io = StringIO.new File.read(filename)
         | 
| 10 | 
            +
                Workbook.open io do |w|
         | 
| 11 | 
            +
                  w.should have(5).sheets
         | 
| 12 | 
            +
                end
         | 
| 13 | 
            +
              end
         | 
| 14 | 
            +
             | 
| 7 15 | 
             
              it 'Sheets count' do
         | 
| 8 16 | 
             
                Workbook.open filename do |w|
         | 
| 9 17 | 
             
                  w.should have(5).sheets
         | 
| @@ -39,8 +47,8 @@ describe Workbook do | |
| 39 47 | 
             
              it 'Shared strings' do
         | 
| 40 48 | 
             
                Workbook.open filename do |w|
         | 
| 41 49 | 
             
                  w.should have(56).shared_strings
         | 
| 42 | 
            -
                  w.shared_strings | 
| 43 | 
            -
                  w.shared_strings | 
| 50 | 
            +
                  w.shared_strings.should include 'LevenshteinDistance'
         | 
| 51 | 
            +
                  w.shared_strings.should include 'TST_ModMan_Insulto_SU_Normal'
         | 
| 44 52 | 
             
                end
         | 
| 45 53 | 
             
              end
         | 
| 46 54 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: saxlsx
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.10.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Edgars Beigarts
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2021-01-12 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rubyzip
         | 
| @@ -42,14 +42,14 @@ dependencies: | |
| 42 42 | 
             
              name: bundler
         | 
| 43 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 44 | 
             
                requirements:
         | 
| 45 | 
            -
                - - " | 
| 45 | 
            +
                - - ">="
         | 
| 46 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 47 | 
             
                    version: '1.5'
         | 
| 48 48 | 
             
              type: :development
         | 
| 49 49 | 
             
              prerelease: false
         | 
| 50 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 | 
            -
                - - " | 
| 52 | 
            +
                - - ">="
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 54 | 
             
                    version: '1.5'
         | 
| 55 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -58,28 +58,42 @@ dependencies: | |
| 58 58 | 
             
                requirements:
         | 
| 59 59 | 
             
                - - "~>"
         | 
| 60 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: ' | 
| 61 | 
            +
                    version: '13.0'
         | 
| 62 62 | 
             
              type: :development
         | 
| 63 63 | 
             
              prerelease: false
         | 
| 64 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 65 | 
             
                requirements:
         | 
| 66 66 | 
             
                - - "~>"
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            -
                    version: ' | 
| 68 | 
            +
                    version: '13.0'
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 70 | 
             
              name: rspec
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 72 | 
             
                requirements:
         | 
| 73 73 | 
             
                - - "~>"
         | 
| 74 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            -
                    version: ' | 
| 75 | 
            +
                    version: '3.10'
         | 
| 76 76 | 
             
              type: :development
         | 
| 77 77 | 
             
              prerelease: false
         | 
| 78 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 79 | 
             
                requirements:
         | 
| 80 80 | 
             
                - - "~>"
         | 
| 81 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            -
                    version: ' | 
| 82 | 
            +
                    version: '3.10'
         | 
| 83 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            +
              name: rspec-collection_matchers
         | 
| 85 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 | 
            +
                requirements:
         | 
| 87 | 
            +
                - - ">="
         | 
| 88 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            +
                    version: '0'
         | 
| 90 | 
            +
              type: :development
         | 
| 91 | 
            +
              prerelease: false
         | 
| 92 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 | 
            +
                requirements:
         | 
| 94 | 
            +
                - - ">="
         | 
| 95 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 96 | 
            +
                    version: '0'
         | 
| 83 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 98 | 
             
              name: simplecov
         | 
| 85 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -102,8 +116,8 @@ executables: | |
| 102 116 | 
             
            extensions: []
         | 
| 103 117 | 
             
            extra_rdoc_files: []
         | 
| 104 118 | 
             
            files:
         | 
| 119 | 
            +
            - ".github/workflows/ruby.yml"
         | 
| 105 120 | 
             
            - ".gitignore"
         | 
| 106 | 
            -
            - ".travis.yml"
         | 
| 107 121 | 
             
            - Gemfile
         | 
| 108 122 | 
             
            - LICENSE.txt
         | 
| 109 123 | 
             
            - README.md
         | 
| @@ -114,6 +128,7 @@ files: | |
| 114 128 | 
             
            - lib/saxlsx/column_name_generator.rb
         | 
| 115 129 | 
             
            - lib/saxlsx/file_system.rb
         | 
| 116 130 | 
             
            - lib/saxlsx/rows_collection.rb
         | 
| 131 | 
            +
            - lib/saxlsx/rows_collection_count_parser.rb
         | 
| 117 132 | 
             
            - lib/saxlsx/rows_collection_parser.rb
         | 
| 118 133 | 
             
            - lib/saxlsx/sax_parser.rb
         | 
| 119 134 | 
             
            - lib/saxlsx/shared_string_collection.rb
         | 
| @@ -131,7 +146,10 @@ files: | |
| 131 146 | 
             
            - spec/data/Spec.xlsx
         | 
| 132 147 | 
             
            - spec/data/Spec1904.xlsx
         | 
| 133 148 | 
             
            - spec/data/SpecInlineStrings.xlsx
         | 
| 149 | 
            +
            - spec/data/SpecMultiline10.xlsx
         | 
| 150 | 
            +
            - spec/data/SpecMultilineN.xlsx
         | 
| 134 151 | 
             
            - spec/data/SpecNumberFormat.xlsx
         | 
| 152 | 
            +
            - spec/data/SpecSloppy.xlsx
         | 
| 135 153 | 
             
            - spec/sheet_spec.rb
         | 
| 136 154 | 
             
            - spec/spec_helper.rb
         | 
| 137 155 | 
             
            - spec/workbook_spec.rb
         | 
| @@ -139,7 +157,7 @@ homepage: https://github.com/mak-it/saxlsx | |
| 139 157 | 
             
            licenses:
         | 
| 140 158 | 
             
            - MIT
         | 
| 141 159 | 
             
            metadata: {}
         | 
| 142 | 
            -
            post_install_message: | 
| 160 | 
            +
            post_install_message:
         | 
| 143 161 | 
             
            rdoc_options: []
         | 
| 144 162 | 
             
            require_paths:
         | 
| 145 163 | 
             
            - lib
         | 
| @@ -147,16 +165,15 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 147 165 | 
             
              requirements:
         | 
| 148 166 | 
             
              - - ">="
         | 
| 149 167 | 
             
                - !ruby/object:Gem::Version
         | 
| 150 | 
            -
                  version: 2. | 
| 168 | 
            +
                  version: 2.5.0
         | 
| 151 169 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 152 170 | 
             
              requirements:
         | 
| 153 171 | 
             
              - - ">="
         | 
| 154 172 | 
             
                - !ruby/object:Gem::Version
         | 
| 155 173 | 
             
                  version: '0'
         | 
| 156 174 | 
             
            requirements: []
         | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 159 | 
            -
            signing_key: 
         | 
| 175 | 
            +
            rubygems_version: 3.1.4
         | 
| 176 | 
            +
            signing_key:
         | 
| 160 177 | 
             
            specification_version: 4
         | 
| 161 178 | 
             
            summary: Fast xlsx reader on top of Ox SAX parser
         | 
| 162 179 | 
             
            test_files:
         | 
| @@ -165,7 +182,10 @@ test_files: | |
| 165 182 | 
             
            - spec/data/Spec.xlsx
         | 
| 166 183 | 
             
            - spec/data/Spec1904.xlsx
         | 
| 167 184 | 
             
            - spec/data/SpecInlineStrings.xlsx
         | 
| 185 | 
            +
            - spec/data/SpecMultiline10.xlsx
         | 
| 186 | 
            +
            - spec/data/SpecMultilineN.xlsx
         | 
| 168 187 | 
             
            - spec/data/SpecNumberFormat.xlsx
         | 
| 188 | 
            +
            - spec/data/SpecSloppy.xlsx
         | 
| 169 189 | 
             
            - spec/sheet_spec.rb
         | 
| 170 190 | 
             
            - spec/spec_helper.rb
         | 
| 171 191 | 
             
            - spec/workbook_spec.rb
         |