spreadsheet 1.3.4 → 1.3.5
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 +4 -4
- data/bin/irb +29 -0
- data/bin/racc +29 -0
- data/bin/rdbg +29 -0
- data/bin/rdoc +29 -0
- data/bin/ri +29 -0
- data/bin/rubocop +29 -0
- data/bin/ruby-parse +29 -0
- data/bin/ruby-rewrite +29 -0
- data/bin/standardrb +29 -0
- data/bin/test-unit +29 -0
- data/lib/spreadsheet/column.rb +2 -1
- data/lib/spreadsheet/datatypes.rb +2 -1
- data/lib/spreadsheet/excel/offset.rb +3 -1
- data/lib/spreadsheet/excel/reader/biff8.rb +1 -0
- data/lib/spreadsheet/excel/reader.rb +11 -0
- data/lib/spreadsheet/excel/sst_entry.rb +1 -0
- data/lib/spreadsheet/excel/workbook.rb +1 -0
- data/lib/spreadsheet/excel/worksheet.rb +2 -1
- data/lib/spreadsheet/excel/writer/biff8.rb +1 -0
- data/lib/spreadsheet/excel/writer/format.rb +1 -0
- data/lib/spreadsheet/excel/writer/n_worksheet.rb +1 -0
- data/lib/spreadsheet/excel/writer/workbook.rb +1 -0
- data/lib/spreadsheet/excel/writer/worksheet.rb +1 -0
- data/lib/spreadsheet/excel.rb +1 -1
- data/lib/spreadsheet/font.rb +1 -0
- data/lib/spreadsheet/format.rb +1 -0
- data/lib/spreadsheet/link.rb +1 -0
- data/lib/spreadsheet/note.rb +1 -0
- data/lib/spreadsheet/noteObject.rb +1 -0
- data/lib/spreadsheet/row.rb +2 -1
- data/lib/spreadsheet/version.rb +1 -1
- data/lib/spreadsheet/workbook.rb +1 -0
- data/lib/spreadsheet/worksheet.rb +1 -0
- data/test/data/test_row_record_empty_range.xls +0 -0
- data/test/integration.rb +14 -0
- metadata +13 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f244d6b1694de3b2590286a2b047de226f36cd855dd534a2db47d221da62ec59
|
|
4
|
+
data.tar.gz: e7043746b2683555f602be54ad7e3b68495e5bf7e9abaae5df5c839c139ecc74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97e1b3679d5693891b5a3caba131de68cbac2783067ebd4d318c457db924008b0100209a4d218ebd4357f80bf4cb70b8a1482ae5ea51fec1ec7fd23ccef89fd7
|
|
7
|
+
data.tar.gz: eee493446105db70f89be23210bafff8683c068cb1a0e319fe4ab356aa0af2ce4904d5e545e79eae4a15af898c9d5b69df9f6e0307a07f94ee5d3d7d09d9b083
|
data/bin/irb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'irb' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("irb", "irb")
|
data/bin/racc
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'racc' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("racc", "racc")
|
data/bin/rdbg
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'rdbg' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("debug", "rdbg")
|
data/bin/rdoc
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'rdoc' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("rdoc", "rdoc")
|
data/bin/ri
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'ri' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("rdoc", "ri")
|
data/bin/rubocop
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/bin/ruby-parse
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'ruby-parse' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("parser", "ruby-parse")
|
data/bin/ruby-rewrite
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'ruby-rewrite' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("parser", "ruby-rewrite")
|
data/bin/standardrb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'standardrb' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("standard", "standardrb")
|
data/bin/test-unit
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'test-unit' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "pathname"
|
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require "rubygems"
|
|
27
|
+
require "bundler/setup"
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path("test-unit", "test-unit")
|
data/lib/spreadsheet/column.rb
CHANGED
|
@@ -20,7 +20,7 @@ module Spreadsheet
|
|
|
20
20
|
class << self
|
|
21
21
|
def updater *keys
|
|
22
22
|
keys.each do |key|
|
|
23
|
-
unless
|
|
23
|
+
unless method_defined?("unupdated_#{key}=")
|
|
24
24
|
alias_method :"unupdated_#{key}=", :"#{key}="
|
|
25
25
|
define_method :"#{key}=" do |value|
|
|
26
26
|
send :"unupdated_#{key}=", value
|
|
@@ -33,6 +33,7 @@ module Spreadsheet
|
|
|
33
33
|
end
|
|
34
34
|
include Datatypes
|
|
35
35
|
include Enumerable
|
|
36
|
+
|
|
36
37
|
attr_accessor :width, :worksheet
|
|
37
38
|
attr_reader :default_format, :idx
|
|
38
39
|
boolean :hidden, :collapsed
|
|
@@ -6,6 +6,7 @@ module Spreadsheet
|
|
|
6
6
|
# attributes (boolean, colors and enumerations)
|
|
7
7
|
module Datatypes
|
|
8
8
|
include Compatibility
|
|
9
|
+
|
|
9
10
|
def self.append_features mod
|
|
10
11
|
super
|
|
11
12
|
mod.module_eval do
|
|
@@ -142,7 +143,7 @@ module Spreadsheet
|
|
|
142
143
|
define_method :"#{key}=" do |arg|
|
|
143
144
|
if arg
|
|
144
145
|
arg = aliases.fetch arg do
|
|
145
|
-
aliases.fetch arg.to_s.downcase.gsub(/[
|
|
146
|
+
aliases.fetch arg.to_s.downcase.gsub(/[ -]/, "_").to_sym, arg
|
|
146
147
|
end
|
|
147
148
|
if values.any? { |val| val === arg }
|
|
148
149
|
instance_variable_set(ivar_name(key), arg)
|
|
@@ -7,6 +7,7 @@ module Spreadsheet
|
|
|
7
7
|
# Considered internal and subject to change without notice.
|
|
8
8
|
module Offset
|
|
9
9
|
include Compatibility
|
|
10
|
+
|
|
10
11
|
attr_reader :changes, :offsets
|
|
11
12
|
def initialize *args
|
|
12
13
|
super
|
|
@@ -19,9 +20,10 @@ module Spreadsheet
|
|
|
19
20
|
mod.module_eval do
|
|
20
21
|
class << self
|
|
21
22
|
include Compatibility
|
|
23
|
+
|
|
22
24
|
def offset *keys
|
|
23
25
|
keys.each do |key|
|
|
24
|
-
attr_reader key unless
|
|
26
|
+
attr_reader key unless method_defined?(method_name(key))
|
|
25
27
|
define_method :"#{key}=" do |value|
|
|
26
28
|
@changes.store key, true
|
|
27
29
|
instance_variable_set ivar_name(key), value
|
|
@@ -7,6 +7,7 @@ module Spreadsheet
|
|
|
7
7
|
# of Excel grows and methods get moved here for disambiguation.
|
|
8
8
|
module Biff8
|
|
9
9
|
include Spreadsheet::Excel::Internals
|
|
10
|
+
|
|
10
11
|
##
|
|
11
12
|
# When a String is too long for one Opcode, it is continued in a Continue
|
|
12
13
|
# Opcode. Excel may reconsider compressing the remainder of the string.
|
|
@@ -18,6 +18,7 @@ module Spreadsheet
|
|
|
18
18
|
class Reader
|
|
19
19
|
include Spreadsheet::Encodings
|
|
20
20
|
include Spreadsheet::Excel::Internals
|
|
21
|
+
|
|
21
22
|
ROW_BLOCK_OPS = {
|
|
22
23
|
blank: true, boolerr: true, dbcell: true, formula: true,
|
|
23
24
|
label: true, labelsst: true, mulblank: true, mulrk: true,
|
|
@@ -1308,6 +1309,15 @@ module Spreadsheet
|
|
|
1308
1309
|
xf = (flags & 0x0fff0000) >> 16
|
|
1309
1310
|
attrs.store :default_format, @workbook.format(xf)
|
|
1310
1311
|
end
|
|
1312
|
+
# When a ROW record claims no cells (`first_used` == `first_unused`) but
|
|
1313
|
+
# `set_missing_row_address` already recorded a valid offset from cell
|
|
1314
|
+
# records found earlier in the stream, preserve the original offset.
|
|
1315
|
+
# Some XLS writers emit ROW records after cell data with zeroed column
|
|
1316
|
+
# ranges; without this fix, `read_row` would seek to the wrong position.
|
|
1317
|
+
if first_used == first_unused && (existing = worksheet.row_addresses[index])
|
|
1318
|
+
attrs[:offset] = existing[:offset]
|
|
1319
|
+
attrs[:row_block] = existing[:row_block]
|
|
1320
|
+
end
|
|
1311
1321
|
# TODO: Row spacing
|
|
1312
1322
|
worksheet.set_row_address index, attrs
|
|
1313
1323
|
end
|
|
@@ -1345,6 +1355,7 @@ module Spreadsheet
|
|
|
1345
1355
|
def extend_internals version
|
|
1346
1356
|
require "spreadsheet/excel/internals/biff%i" % version
|
|
1347
1357
|
extend Internals.const_get("Biff%i" % version)
|
|
1358
|
+
|
|
1348
1359
|
## spreadsheets may not include a codepage record.
|
|
1349
1360
|
@workbook.encoding = encoding 850 if version < 8
|
|
1350
1361
|
rescue LoadError
|
|
@@ -10,8 +10,9 @@ module Spreadsheet
|
|
|
10
10
|
# to use any of these.
|
|
11
11
|
class Worksheet < Spreadsheet::Worksheet
|
|
12
12
|
include Spreadsheet::Excel::Offset
|
|
13
|
+
|
|
13
14
|
offset :dimensions
|
|
14
|
-
attr_reader :offset, :ole, :links, :guts, :notes
|
|
15
|
+
attr_reader :offset, :ole, :links, :guts, :notes, :row_addresses
|
|
15
16
|
def initialize opts = {}
|
|
16
17
|
@row_addresses = nil
|
|
17
18
|
super
|
|
@@ -9,6 +9,7 @@ module Spreadsheet
|
|
|
9
9
|
# of Excel grows and methods get moved here for disambiguation.
|
|
10
10
|
module Biff8
|
|
11
11
|
include Spreadsheet::Encodings
|
|
12
|
+
|
|
12
13
|
##
|
|
13
14
|
# Check whether the string _data_ can be compressed (i.e. every second byte
|
|
14
15
|
# is a Null-byte) and perform compression.
|
data/lib/spreadsheet/excel.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Spreadsheet
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
class Worksheet
|
|
35
|
-
unless
|
|
35
|
+
unless method_defined?(:new_format_column)
|
|
36
36
|
alias_method :new_format_column, :format_column
|
|
37
37
|
def format_column column, width = nil, format = nil
|
|
38
38
|
if width.is_a? Format
|
data/lib/spreadsheet/font.rb
CHANGED
data/lib/spreadsheet/format.rb
CHANGED
data/lib/spreadsheet/link.rb
CHANGED
data/lib/spreadsheet/note.rb
CHANGED
data/lib/spreadsheet/row.rb
CHANGED
|
@@ -18,10 +18,11 @@ module Spreadsheet
|
|
|
18
18
|
# #height:: The height of this Row in points (defaults to 12).
|
|
19
19
|
class Row < Array
|
|
20
20
|
include Datatypes
|
|
21
|
+
|
|
21
22
|
class << self
|
|
22
23
|
def format_updater *keys
|
|
23
24
|
keys.each do |key|
|
|
24
|
-
unless
|
|
25
|
+
unless method_defined?("unupdated_#{key}=")
|
|
25
26
|
alias_method :"unupdated_#{key}=", :"#{key}="
|
|
26
27
|
define_method :"#{key}=" do |value|
|
|
27
28
|
send :"unupdated_#{key}=", value
|
data/lib/spreadsheet/version.rb
CHANGED
data/lib/spreadsheet/workbook.rb
CHANGED
|
@@ -12,6 +12,7 @@ module Spreadsheet
|
|
|
12
12
|
# Row#default_format or Worksheet#default_format.
|
|
13
13
|
class Workbook
|
|
14
14
|
include Spreadsheet::Encodings
|
|
15
|
+
|
|
15
16
|
attr_reader :io, :worksheets, :formats, :fonts, :palette
|
|
16
17
|
attr_accessor :active_worksheet, :encoding, :default_format, :version
|
|
17
18
|
def initialize io = nil, opts = {default_format: Format.new}
|
|
@@ -28,6 +28,7 @@ module Spreadsheet
|
|
|
28
28
|
include Spreadsheet::Encodings
|
|
29
29
|
include Spreadsheet::Datatypes
|
|
30
30
|
include Enumerable
|
|
31
|
+
|
|
31
32
|
attr_accessor :name, :selected, :workbook, :password_hash
|
|
32
33
|
attr_reader :rows, :columns, :merged_cells, :margins, :pagesetup
|
|
33
34
|
attr_reader :froze_top, :froze_left
|
|
Binary file
|
data/test/integration.rb
CHANGED
|
@@ -1217,6 +1217,20 @@ module Spreadsheet
|
|
|
1217
1217
|
assert_not_nil sheet[2, 1]
|
|
1218
1218
|
end
|
|
1219
1219
|
|
|
1220
|
+
def test_row_record_with_empty_cell_range
|
|
1221
|
+
# Some XLS writers emit ROW records with `first_used` == `first_unused` (claiming
|
|
1222
|
+
# no cells) even though cell records (e.g. `LABELSST`) exist for that row
|
|
1223
|
+
# earlier in the stream. Previously this caused `read_row` to seek to the wrong
|
|
1224
|
+
# offset, returning an empty row despite valid cell data being present.
|
|
1225
|
+
path = File.join @data, "test_row_record_empty_range.xls"
|
|
1226
|
+
book = Spreadsheet.open path
|
|
1227
|
+
sheet = book.worksheet 0
|
|
1228
|
+
row0 = sheet.row(0).to_a.compact
|
|
1229
|
+
assert_operator row0.length, :>, 0, "Row 0 should not be empty"
|
|
1230
|
+
assert_equal "Name", row0[0]
|
|
1231
|
+
assert_equal ["Name", "Code", "Description", "Reference", "Date", "Quantity"], row0
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1220
1234
|
def test_changes
|
|
1221
1235
|
path = File.join @data, "test_changes.xls"
|
|
1222
1236
|
book = Spreadsheet.open path
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spreadsheet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hannes F. Wyss, Masaomi Hatakeyama, Zeno R.R. Davatz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-04-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: logger
|
|
@@ -134,9 +134,19 @@ files:
|
|
|
134
134
|
- Manifest.txt
|
|
135
135
|
- bin/bundle
|
|
136
136
|
- bin/bundler
|
|
137
|
+
- bin/irb
|
|
137
138
|
- bin/oletool
|
|
139
|
+
- bin/racc
|
|
138
140
|
- bin/rake
|
|
141
|
+
- bin/rdbg
|
|
142
|
+
- bin/rdoc
|
|
143
|
+
- bin/ri
|
|
144
|
+
- bin/rubocop
|
|
145
|
+
- bin/ruby-parse
|
|
146
|
+
- bin/ruby-rewrite
|
|
139
147
|
- bin/sow
|
|
148
|
+
- bin/standardrb
|
|
149
|
+
- bin/test-unit
|
|
140
150
|
- bin/xlsopcodes
|
|
141
151
|
- lib/parseexcel.rb
|
|
142
152
|
- lib/parseexcel/parseexcel.rb
|
|
@@ -197,6 +207,7 @@ files:
|
|
|
197
207
|
- test/data/test_missing_format.xls
|
|
198
208
|
- test/data/test_missing_row.xls
|
|
199
209
|
- test/data/test_pagesetup.xls
|
|
210
|
+
- test/data/test_row_record_empty_range.xls
|
|
200
211
|
- test/data/test_sizes.xls
|
|
201
212
|
- test/data/test_text_drawing.xls
|
|
202
213
|
- test/data/test_version_excel5.xls
|