spreadsheet 1.3.3 → 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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/bin/irb +29 -0
  3. data/bin/racc +29 -0
  4. data/bin/rdbg +29 -0
  5. data/bin/rdoc +29 -0
  6. data/bin/ri +29 -0
  7. data/bin/rubocop +29 -0
  8. data/bin/ruby-parse +29 -0
  9. data/bin/ruby-rewrite +29 -0
  10. data/bin/standardrb +29 -0
  11. data/bin/test-unit +29 -0
  12. data/lib/parseexcel/parseexcel.rb +66 -58
  13. data/lib/parseexcel/parser.rb +1 -1
  14. data/lib/parseexcel.rb +1 -1
  15. data/lib/spreadsheet/column.rb +13 -10
  16. data/lib/spreadsheet/compatibility.rb +3 -1
  17. data/lib/spreadsheet/datatypes.rb +150 -147
  18. data/lib/spreadsheet/encodings.rb +20 -16
  19. data/lib/spreadsheet/errors.rb +2 -2
  20. data/lib/spreadsheet/excel/error.rb +23 -22
  21. data/lib/spreadsheet/excel/internals/biff5.rb +11 -11
  22. data/lib/spreadsheet/excel/internals/biff8.rb +13 -13
  23. data/lib/spreadsheet/excel/internals.rb +451 -451
  24. data/lib/spreadsheet/excel/offset.rb +34 -31
  25. data/lib/spreadsheet/excel/password_hash.rb +18 -18
  26. data/lib/spreadsheet/excel/reader/biff5.rb +34 -35
  27. data/lib/spreadsheet/excel/reader/biff8.rb +235 -222
  28. data/lib/spreadsheet/excel/reader.rb +1331 -1274
  29. data/lib/spreadsheet/excel/rgb.rb +91 -91
  30. data/lib/spreadsheet/excel/row.rb +99 -91
  31. data/lib/spreadsheet/excel/sst_entry.rb +41 -38
  32. data/lib/spreadsheet/excel/workbook.rb +87 -76
  33. data/lib/spreadsheet/excel/worksheet.rb +126 -107
  34. data/lib/spreadsheet/excel/writer/biff8.rb +57 -55
  35. data/lib/spreadsheet/excel/writer/format.rb +274 -256
  36. data/lib/spreadsheet/excel/writer/n_worksheet.rb +838 -798
  37. data/lib/spreadsheet/excel/writer/workbook.rb +672 -635
  38. data/lib/spreadsheet/excel/writer/worksheet.rb +899 -861
  39. data/lib/spreadsheet/excel/writer.rb +1 -1
  40. data/lib/spreadsheet/excel.rb +19 -12
  41. data/lib/spreadsheet/font.rb +31 -26
  42. data/lib/spreadsheet/format.rb +75 -59
  43. data/lib/spreadsheet/link.rb +8 -5
  44. data/lib/spreadsheet/note.rb +7 -6
  45. data/lib/spreadsheet/noteObject.rb +6 -5
  46. data/lib/spreadsheet/row.rb +35 -24
  47. data/lib/spreadsheet/version.rb +1 -1
  48. data/lib/spreadsheet/workbook.rb +28 -13
  49. data/lib/spreadsheet/worksheet.rb +103 -68
  50. data/lib/spreadsheet/writer.rb +3 -0
  51. data/lib/spreadsheet.rb +12 -15
  52. data/test/data/test_row_record_empty_range.xls +0 -0
  53. data/test/excel/reader.rb +8 -8
  54. data/test/excel/row.rb +35 -31
  55. data/test/excel/writer/workbook.rb +18 -16
  56. data/test/excel/writer/worksheet.rb +10 -8
  57. data/test/font.rb +44 -32
  58. data/test/format.rb +38 -33
  59. data/test/integration.rb +641 -598
  60. data/test/row.rb +5 -3
  61. data/test/suite.rb +7 -7
  62. data/test/workbook.rb +15 -14
  63. data/test/workbook_protection.rb +5 -5
  64. data/test/worksheet.rb +36 -34
  65. metadata +59 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1985e7bfda006e29f36e9ccce2df3374c88a04e3ac606bf62208de1cd15a3525
4
- data.tar.gz: df643d0506f09bc2ac1b7e2c533a1ddd3c989aa7da565b2b9fa9df5fca52136e
3
+ metadata.gz: f244d6b1694de3b2590286a2b047de226f36cd855dd534a2db47d221da62ec59
4
+ data.tar.gz: e7043746b2683555f602be54ad7e3b68495e5bf7e9abaae5df5c839c139ecc74
5
5
  SHA512:
6
- metadata.gz: 50dccecf6a5293f572ce3e7083ead295dd5611779a440e5ca82b28426bc7258141ea70b66fae1976b7dd690a32bdc03b90996fd27a20c11d7b074b6412c7089f
7
- data.tar.gz: a723371de4c218625d69ee8ef53940fd903f6713f414ff7ce30ce66bebae05c98a0215469159a579f2d8d061739f04d8118a0f2dff9136f8710b1da447963376
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")
@@ -1,11 +1,11 @@
1
- require 'spreadsheet'
1
+ require "spreadsheet"
2
2
 
3
- warn <<-EOS
4
- [DEPRECATED] By requiring 'parseexcel', 'parseexcel/parseexcel' and/or
5
- 'parseexcel/parser' you are loading a Compatibility layer which
6
- provides a drop-in replacement for the ParseExcel library. This
7
- code makes the reading of Spreadsheet documents less efficient and
8
- will be removed in Spreadsheet version 1.0.0
3
+ warn <<~EOS
4
+ [DEPRECATED] By requiring 'parseexcel', 'parseexcel/parseexcel' and/or
5
+ 'parseexcel/parser' you are loading a Compatibility layer which
6
+ provides a drop-in replacement for the ParseExcel library. This
7
+ code makes the reading of Spreadsheet documents less efficient and
8
+ will be removed in Spreadsheet version 1.0.0
9
9
  EOS
10
10
 
11
11
  module Spreadsheet
@@ -14,62 +14,70 @@ module Spreadsheet
14
14
  # ParseExcel library. This code is deprecated and will be removed in
15
15
  # Spreadsheet version 1.0.0
16
16
  module ParseExcel
17
- def ParseExcel.parse path
18
- Spreadsheet.open path
19
- end
20
- class Worksheet
21
- class Cell
22
- attr_accessor :value, :kind, :numeric, :code, :book,
23
- :format, :rich, :encoding, :annotation
24
- def initialize value, format, row, idx
25
- @format = format
26
- @idx = idx
27
- @row = row
28
- @value = value
29
- @encoding = Spreadsheet.client_encoding
30
- end
31
- def date
32
- @row.date @idx
33
- end
34
- def datetime
35
- @row.datetime @idx
36
- end
37
- def to_i
38
- @value.to_i
17
+ def self.parse path
18
+ Spreadsheet.open path
39
19
  end
40
- def to_f
41
- @value.to_f
42
- end
43
- def to_s(target_encoding=nil)
44
- if(target_encoding)
45
- begin
46
- Iconv.new(target_encoding, @encoding).iconv(@value)
47
- rescue
48
- Iconv.new(target_encoding, 'ascii').iconv(@value.to_s)
20
+
21
+ class Worksheet
22
+ class Cell
23
+ attr_accessor :value, :kind, :numeric, :code, :book,
24
+ :format, :rich, :encoding, :annotation
25
+ def initialize value, format, row, idx
26
+ @format = format
27
+ @idx = idx
28
+ @row = row
29
+ @value = value
30
+ @encoding = Spreadsheet.client_encoding
31
+ end
32
+
33
+ def date
34
+ @row.date @idx
35
+ end
36
+
37
+ def datetime
38
+ @row.datetime @idx
39
+ end
40
+
41
+ def to_i
42
+ @value.to_i
43
+ end
44
+
45
+ def to_f
46
+ @value.to_f
47
+ end
48
+
49
+ def to_s(target_encoding = nil)
50
+ if target_encoding
51
+ begin
52
+ Iconv.new(target_encoding, @encoding).iconv(@value)
53
+ rescue
54
+ Iconv.new(target_encoding, "ascii").iconv(@value.to_s)
55
+ end
56
+ else
57
+ @value.to_s
58
+ end
59
+ end
60
+
61
+ def type
62
+ if @format && (@format.date? || @format.time?)
63
+ :date
64
+ elsif @value.is_a?(Numeric)
65
+ :numeric
66
+ else
67
+ :text
68
+ end
49
69
  end
50
- else
51
- @value.to_s
52
- end
53
- end
54
- def type
55
- if @format && (@format.date? || @format.time?)
56
- :date
57
- elsif @value.is_a?(Numeric)
58
- :numeric
59
- else
60
- :text
61
70
  end
62
71
  end
63
72
  end
64
- end
65
- end
73
+
66
74
  module Excel
67
- class Reader # :nodoc: all
68
- def set_cell worksheet, row, column, xf, value=nil
69
- cells = @current_row_block[row] ||= Row.new(nil, row)
70
- cells.formats[column] = xf = @workbook.format(xf)
71
- cells[column] = ParseExcel::Worksheet::Cell.new(value, xf, cells, column)
72
- end
73
- end
75
+ class Reader # :nodoc: all
76
+ def set_cell worksheet, row, column, xf, value = nil
77
+ cells = @current_row_block[row] ||= Row.new(nil, row)
78
+ cells.formats[column] = xf = @workbook.format(xf)
79
+ cells[column] = ParseExcel::Worksheet::Cell.new(value, xf, cells, column)
80
+ end
81
+ end
74
82
  end
75
83
  end
@@ -1,4 +1,4 @@
1
- require 'parseexcel'
1
+ require "parseexcel"
2
2
 
3
3
  module Spreadsheet
4
4
  module ParseExcel # :nodoc: all
data/lib/parseexcel.rb CHANGED
@@ -24,4 +24,4 @@
24
24
  # 8006 Zürich
25
25
  ### Switzerland
26
26
 
27
- require 'parseexcel/parseexcel'
27
+ require "parseexcel/parseexcel"
@@ -1,4 +1,4 @@
1
- require 'spreadsheet/datatypes'
1
+ require "spreadsheet/datatypes"
2
2
 
3
3
  module Spreadsheet
4
4
  ##
@@ -20,11 +20,11 @@ module Spreadsheet
20
20
  class << self
21
21
  def updater *keys
22
22
  keys.each do |key|
23
- unless instance_methods.include? "unupdated_#{key}="
23
+ unless method_defined?("unupdated_#{key}=")
24
24
  alias_method :"unupdated_#{key}=", :"#{key}="
25
- define_method "#{key}=" do |value|
26
- send "unupdated_#{key}=", value
27
- @worksheet.column_updated @idx, self if @worksheet
25
+ define_method :"#{key}=" do |value|
26
+ send :"unupdated_#{key}=", value
27
+ @worksheet&.column_updated @idx, self
28
28
  value
29
29
  end
30
30
  end
@@ -33,28 +33,30 @@ 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
39
40
  enum :outline_level, 0, Integer
40
41
  updater :collapsed, :hidden, :outline_level, :width
41
- def initialize idx, format, opts={}
42
+ def initialize idx, format, opts = {}
42
43
  @worksheet = nil
43
44
  @idx = idx
44
45
  opts[:width] ||= 10
45
46
  opts.each do |key, value|
46
- self.send "#{key}=", value
47
+ send :"#{key}=", value
47
48
  end
48
49
  self.default_format = format
49
50
  end
51
+
50
52
  ##
51
53
  # Set the default Format for Cells in this Column.
52
54
  def default_format= format
53
- @worksheet.add_format format if @worksheet
55
+ @worksheet&.add_format format
54
56
  @default_format = format
55
- @worksheet.column_updated @idx, self if @worksheet
56
- format
57
+ @worksheet&.column_updated @idx, self
57
58
  end
59
+
58
60
  ##
59
61
  # Iterate over all cells in this column.
60
62
  def each
@@ -62,6 +64,7 @@ module Spreadsheet
62
64
  yield row[idx]
63
65
  end
64
66
  end
67
+
65
68
  def == other # :nodoc:
66
69
  other.is_a?(Column) && default_format == other.default_format \
67
70
  && width == other.width && hidden == other.hidden \
@@ -4,10 +4,11 @@ module Spreadsheet
4
4
  # One of the most incisive changes in terms of meta-programming in Ruby 1.9
5
5
  # is the switch from representing instance-variable names as Strings to
6
6
  # presenting them as Symbols. ivar_name provides compatibility.
7
- if RUBY_VERSION >= '1.9'
7
+ if RUBY_VERSION >= "1.9"
8
8
  def ivar_name symbol
9
9
  :"@#{symbol}"
10
10
  end
11
+
11
12
  def method_name symbol
12
13
  symbol.to_sym
13
14
  end
@@ -15,6 +16,7 @@ module Spreadsheet
15
16
  def ivar_name symbol
16
17
  "@#{symbol}"
17
18
  end
19
+
18
20
  def method_name symbol
19
21
  symbol.to_s
20
22
  end