spreadsheet 1.2.2 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 791f3a7c891c29fee7506b00457311bc4fcc1fe6
4
- data.tar.gz: bbf63401258ae34e9bcc81fc9bfe479d89d48356
2
+ SHA256:
3
+ metadata.gz: f3838959e9ca05cea64d92732af76a16989f192dee2ae8d6faa78f43f3148858
4
+ data.tar.gz: 6655bef2181febca0c1f052b557012f8ac08c35e1aa5a69d360e0b006b8231df
5
5
  SHA512:
6
- metadata.gz: bc5be7f5f24bc8f63388765f5eba89166db17406cad72c72c095537e1f7de9e32c8d22c365017eaba1725661c583eb4369bb2500f77046b35996fdfe372e296e
7
- data.tar.gz: 9d254c82d041143d28f5e2447d230439d040836a7bc6e1014934290c93cfda6921de11b030d5e695784c48b1ef4e6c506737214639695962a6bff98d7ce0c0a2
6
+ metadata.gz: d215eec2e59d1e51a3d895b2dde467b48e3c807fedb871cd08c2f014fda0ddfb13af7629e1cfd4b72a65e56816fd2c635ce9f57ed744c156be11601aaa0fc3dc
7
+ data.tar.gz: 39963a66c937f064717bdbbe861ac786a2b3a3541409c0852da17f13d63c1c3dc449fc4f9b40bc1e31ca68bedc3a1fe0c43bdba8a32091249eec8d7240ce1140
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'bundler' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("bundler", "bundler")
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'oletool' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("ruby-ole", "oletool")
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rake' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rake", "rake")
data/bin/sow ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'sow' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("hoe", "sow")
@@ -1,18 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'xlsopcodes' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
2
9
 
3
- require 'spreadsheet'
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
4
13
 
5
- source, target = ARGV
14
+ require "rubygems"
15
+ require "bundler/setup"
6
16
 
7
- if source.nil?
8
- puts "Usage: #{$0} <source> [<target>]"
9
- exit -1
10
- end
11
-
12
- target = target ? File.open(target, 'w') : STDOUT
13
-
14
- reader = Spreadsheet::Excel::Reader.new :print_opcodes => target
15
- reader.setup File.open(source)
16
-
17
- while tuple = reader.get_next_chunk
18
- end
17
+ load Gem.bin_path("spreadsheet", "xlsopcodes")
@@ -1,11 +1,5 @@
1
1
  require 'spreadsheet'
2
2
 
3
- warn <<-EOS
4
- [DEPRECATED] By requiring 'spreadsheet/excel' you are loading a Compatibility
5
- layer which provides a drop-in replacement for Spreadsheet::Excel
6
- versions <= 0.3.5.1. This code will be removed in Spreadsheet
7
- version 1.0.0
8
- EOS
9
3
  ##
10
4
  # Spreadsheet::Excel Compatibility Layer.
11
5
  # Drop-in replacement for Spreadsheet::Excel version <= 0.3.5.1
@@ -1275,11 +1275,11 @@ class Reader
1275
1275
  end
1276
1276
  def setup io
1277
1277
  ## Reading from StringIO fails without forced encoding
1278
- if io.respond_to?(:string) && (str = io.string) \
1279
- && str.respond_to?(:force_encoding)
1280
- str.force_encoding 'ASCII-8BIT'
1278
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.3.0')
1279
+ io.set_encoding('ASCII-8BIT')
1280
+ elsif io.respond_to?(:string) && (str = io.string) && str.respond_to?(:force_encoding)
1281
+ str.force_encoding('ASCII-8BIT')
1281
1282
  end
1282
- ##
1283
1283
  io.rewind
1284
1284
  @ole = Ole::Storage.open io
1285
1285
  @workbook = Workbook.new io, {}
@@ -101,12 +101,12 @@ module Spreadsheet
101
101
  @pattern_fg_color = :border
102
102
  @pattern_bg_color = :pattern_bg
103
103
  @regexes = {
104
- :date => Regexp.new(client("[YMD]", 'UTF-8')),
104
+ :date => Regexp.new(client("[YMD]|d{2}|m{3}|y{2}", 'UTF-8')),
105
105
  :date_or_time => Regexp.new(client("[hmsYMD]", 'UTF-8')),
106
106
  :datetime => Regexp.new(client("([YMD].*[HS])|([HS].*[YMD])", 'UTF-8')),
107
107
  :time => Regexp.new(client("[hms]", 'UTF-8')),
108
108
  :number => Regexp.new(client("([\#]|0+)", 'UTF-8')),
109
- :locale => Regexp.new(client(/\A\[\$\-\d+\]/.to_s, 'UTF-8')),
109
+ :locale => Regexp.new(client(/\A\[\$\-\S+\]/.to_s, 'UTF-8')),
110
110
  }
111
111
 
112
112
  # Temp code to prevent merged formats in non-merged cells.
@@ -3,5 +3,5 @@
3
3
  module Spreadsheet
4
4
  ##
5
5
  # The version of Spreadsheet you are using.
6
- VERSION = '1.2.2'
6
+ VERSION = '1.2.7'
7
7
  end
@@ -76,7 +76,7 @@ module Spreadsheet
76
76
  # Returns the count of total worksheets present.
77
77
  # Takes no arguments. Just returns the length of @worksheets array.
78
78
  def sheet_count
79
- @worksheets.length
79
+ @worksheets.length
80
80
  end
81
81
  ##
82
82
  # The Font at _idx_
@@ -232,6 +232,9 @@ module Spreadsheet
232
232
  updated_from idx
233
233
  res
234
234
  end
235
+ def << cells=[]
236
+ insert_row last_row_index + 1, cells
237
+ end
235
238
  def inspect
236
239
  names = instance_variables
237
240
  names.delete '@rows'
Binary file
@@ -25,6 +25,19 @@ module Spreadsheet
25
25
  reader.setup not_empty_io
26
26
  end
27
27
  end
28
+
29
+ def test_not_frozen_stream_error_on_setup
30
+ return if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0')
31
+
32
+ reader = Spreadsheet::Excel::Reader.new
33
+ data = File.expand_path File.join('test', 'data')
34
+ path = File.join data, 'test_empty.xls'
35
+ content_string = File.read path
36
+ frozen_io = StringIO.new(content_string.freeze)
37
+ assert_nothing_thrown do
38
+ reader.setup(frozen_io)
39
+ end
40
+ end
28
41
  end
29
42
  end
30
43
  end
@@ -25,6 +25,8 @@ module Spreadsheet
25
25
  assert_equal false, @format.date?
26
26
  @format.number_format = "0.00;[RED]\\-0.00"
27
27
  assert_equal false, @format.date?
28
+ @format.number_format = "[$-C0A]dd\\-mmm\\-yy"
29
+ assert_equal true, @format.date?
28
30
  end
29
31
  def test_date_or_time?
30
32
  assert_equal false, @format.date_or_time?
@@ -3,6 +3,8 @@
3
3
  require 'rubygems'
4
4
  require 'bundler'
5
5
  require 'find'
6
+ require 'simplecov'
7
+ SimpleCov.start
6
8
 
7
9
  $VERBOSE = true
8
10
 
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.2.2
4
+ version: 1.2.7
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: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-ole
@@ -16,78 +16,71 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rdoc
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.0'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '7'
33
+ version: '0'
37
34
  type: :development
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - ">="
42
39
  - !ruby/object:Gem::Version
43
- version: '4.0'
44
- - - "<"
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
45
53
  - !ruby/object:Gem::Version
46
- version: '7'
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
- name: hoe
56
+ name: simplecov
49
57
  requirement: !ruby/object:Gem::Requirement
50
58
  requirements:
51
- - - "~>"
59
+ - - ">="
52
60
  - !ruby/object:Gem::Version
53
- version: '3.17'
61
+ version: '0'
54
62
  type: :development
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
65
  requirements:
58
- - - "~>"
66
+ - - ">="
59
67
  - !ruby/object:Gem::Version
60
- version: '3.17'
61
- description: |-
62
- The Spreadsheet Library is designed to read and write Spreadsheet Documents.
63
- As of version 0.6.0, only Microsoft Excel compatible spreadsheets are
64
- supported. Spreadsheet is a combination/complete rewrite of the
65
- Spreadsheet::Excel Library by Daniel J. Berger and the ParseExcel Library by
66
- Hannes Wyss. Spreadsheet can read, write and modify Spreadsheet Documents.
67
- email: zdavatz@ywesee.com
68
+ version: '0'
69
+ description: As of version 0.6.0, only Microsoft Excel compatible spreadsheets are
70
+ supported
71
+ email: hannes.wyss@gmail.com, mhatakeyama@ywesee.com, zdavatz@ywesee.com
68
72
  executables:
69
73
  - xlsopcodes
70
74
  extensions: []
71
- extra_rdoc_files:
72
- - GUIDE.md
73
- - History.md
74
- - LICENSE.txt
75
- - Manifest.txt
76
- - README.md
75
+ extra_rdoc_files: []
77
76
  files:
78
- - ".gitignore"
79
- - ".travis.yml"
80
- - Excel97-2007BinaryFileFormatSpecification.pdf
81
- - GUIDE.md
82
- - Gemfile
83
- - Gemfile.lock
84
- - History.md
85
77
  - LICENSE.txt
86
78
  - Manifest.txt
87
- - README.md
88
- - Rakefile
79
+ - bin/bundler
80
+ - bin/oletool
81
+ - bin/rake
82
+ - bin/sow
89
83
  - bin/xlsopcodes
90
- - excelfileformat.pdf
91
84
  - lib/parseexcel.rb
92
85
  - lib/parseexcel/parseexcel.rb
93
86
  - lib/parseexcel/parser.rb
@@ -130,11 +123,12 @@ files:
130
123
  - lib/spreadsheet/workbook.rb
131
124
  - lib/spreadsheet/worksheet.rb
132
125
  - lib/spreadsheet/writer.rb
133
- - spreadsheet.gemspec
134
126
  - test/data/test_adding_data_to_existing_file.xls
135
127
  - test/data/test_borders.xls
136
128
  - test/data/test_changes.xls
137
129
  - test/data/test_comment.xls
130
+ - test/data/test_compact_format_date.xls
131
+ - test/data/test_compact_many_rows.xls
138
132
  - test/data/test_copy.xls
139
133
  - test/data/test_datetime.xls
140
134
  - test/data/test_empty.xls
@@ -143,8 +137,10 @@ files:
143
137
  - test/data/test_margin.xls
144
138
  - test/data/test_merged_and_protected.xls
145
139
  - test/data/test_merged_cells.xls
140
+ - test/data/test_missing_format.xls
146
141
  - test/data/test_missing_row.xls
147
142
  - test/data/test_pagesetup.xls
143
+ - test/data/test_sizes.xls
148
144
  - test/data/test_text_drawing.xls
149
145
  - test/data/test_version_excel5.xls
150
146
  - test/data/test_version_excel95.xls
@@ -163,14 +159,12 @@ files:
163
159
  - test/workbook.rb
164
160
  - test/workbook_protection.rb
165
161
  - test/worksheet.rb
166
- homepage: https://github.com/zdavatz/spreadsheet
162
+ homepage: https://github.com/zdavatz/spreadsheet/
167
163
  licenses:
168
164
  - GPL-3.0
169
165
  metadata: {}
170
166
  post_install_message:
171
- rdoc_options:
172
- - "--main"
173
- - README.md
167
+ rdoc_options: []
174
168
  require_paths:
175
169
  - lib
176
170
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -184,9 +178,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
178
  - !ruby/object:Gem::Version
185
179
  version: '0'
186
180
  requirements: []
187
- rubyforge_project:
188
- rubygems_version: 2.6.8
181
+ rubygems_version: 3.2.3
189
182
  signing_key:
190
183
  specification_version: 4
191
184
  summary: The Spreadsheet Library is designed to read and write Spreadsheet Documents
192
- test_files: []
185
+ test_files:
186
+ - test/suite.rb
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- tags
2
- *.swp
@@ -1,51 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- cache: bundler
4
- before_install:
5
- - "if $(ruby -e 'exit(RUBY_VERSION >= \"2.3.0\")'); then env -u RUBYOPT gem update --system; fi"
6
- - "if $(ruby -e 'exit(RUBY_VERSION >= \"2.3.0\")'); then env -u RUBYOPT gem install bundler --no-document; fi"
7
- - "if $(ruby -e 'exit(RUBY_VERSION < \"2.3.0\")'); then gem install bundler -v 1.17.3 --no-document; fi"
8
- bundler_args: --binstubs
9
- script: "bundle exec ruby test/suite.rb"
10
- rvm:
11
- - ruby-head
12
- - 2.6.1
13
- - 2.5.3
14
- - 2.4.5
15
- - 2.3.8
16
- - 2.2.6
17
- - 2.1.10
18
- - 2.0.0
19
- - 1.9.3
20
- - 1.9.2
21
- - 1.8.7
22
- - rbx-19mode
23
- - rbx-18mode
24
- - jruby-head
25
- - jruby-19mode
26
- - jruby-18mode
27
- - ree
28
- matrix:
29
- include:
30
- - rvm: 2.4.5
31
- env: RUBYOPT='--enable-frozen-string-literal --debug-frozen-string-literal' USE_LATEST_RUBY_OLE=yes
32
- - rvm: 2.5.3
33
- env: RUBYOPT='--enable-frozen-string-literal --debug-frozen-string-literal' USE_LATEST_RUBY_OLE=yes
34
- - rvm: 2.6.1
35
- env: RUBYOPT='--enable-frozen-string-literal --debug-frozen-string-literal' USE_LATEST_RUBY_OLE=yes
36
- allow_failures:
37
- - rvm: ruby-head
38
- - rvm: rbx-19mode
39
- - rvm: rbx-18mode
40
- - rvm: jruby-head
41
- - rvm: jruby-19mode
42
- - rvm: jruby-18mode
43
- - rvm: ree
44
- #notifications:
45
- # email:
46
- # recipients:
47
- # - yasaka@ywesee.com
48
- # - zdavatz@ywesee.com
49
-
50
- email:
51
- false # temp