rubyexcel 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubyexcel/excel_tools.rb +10 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80bb23913c3b7ba62ca2aa77d5790e24a8dc610b
|
4
|
+
data.tar.gz: c1ff697b448df786dfb8f29cf6c3f43f37f8e6ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da3bd961b2bed9df6cc63bbf8604ada00d19dd509c0e1afe9fd0178adfd63fa4ea5a8fe594464b589c5a9e2af60c6209e9f08a38d597a3275d2352c574262b0c
|
7
|
+
data.tar.gz: f5fbdd7e132b5c2b87f88a3a45904f33346c2f1047a07a6939a292d9b64da31eda73a2bf6d11965b4373e2465a58ce3e667eb377c15266db182dc89252b35d0d
|
@@ -123,10 +123,11 @@ module RubyExcel
|
|
123
123
|
# Filename
|
124
124
|
File.exists?( other ) || fail( ArgumentError, "Unable to find file: #{ other }" )
|
125
125
|
|
126
|
-
#Open
|
126
|
+
#Open Excel
|
127
127
|
excel = WIN32OLE.new( 'excel.application' )
|
128
128
|
excel.displayalerts = false
|
129
129
|
|
130
|
+
# Open the file
|
130
131
|
begin
|
131
132
|
wb = excel.workbooks.open({'filename'=> other, 'readOnly' => true})
|
132
133
|
rescue WIN32OLERuntimeError
|
@@ -136,10 +137,14 @@ module RubyExcel
|
|
136
137
|
|
137
138
|
# Only one sheet, or the entire Workbook?
|
138
139
|
if sheetname
|
140
|
+
|
139
141
|
add( sheetname ).load( wb.sheets( sheetname ).usedrange.send( operation ) )
|
142
|
+
|
140
143
|
else
|
144
|
+
|
141
145
|
self.name = File.basename( other, '.*' )
|
142
|
-
wb.sheets.each { |sh| add( sh.name ).load( sh.usedrange.send( operation ) ) }
|
146
|
+
wb.sheets.each { |sh| add( sh.name ).tap{ |s| s.load( sh.usedrange.send( operation ) ) unless sh.application.worksheetfunction.counta(sh.cells).zero? } }
|
147
|
+
|
143
148
|
end
|
144
149
|
|
145
150
|
# Cleanup
|
@@ -156,16 +161,16 @@ module RubyExcel
|
|
156
161
|
|
157
162
|
# Only one sheet, or the entire Workbook?
|
158
163
|
if sheetname
|
159
|
-
add( sheetname ).
|
164
|
+
add( sheetname ).tap{ |s| s.load( sh.usedrange.send( operation ) ) unless sh.application.worksheetfunction.counta(sh.cells).zero? }
|
160
165
|
else
|
161
166
|
self.name = File.basename( other.name, '.*' )
|
162
|
-
other.sheets.each { |sh| add( sh.name ).load( sh.usedrange.send( operation ) ) }
|
167
|
+
other.sheets.each { |sh| add( sh.name ).tap{ |s| s.load( sh.usedrange.send( operation ) ) unless sh.application.worksheetfunction.counta(sh.cells).zero? } }
|
163
168
|
end
|
164
169
|
|
165
170
|
elsif other.ole_respond_to?( :usedrange )
|
166
171
|
|
167
172
|
# Sheet
|
168
|
-
add( other.name ).load(
|
173
|
+
add( other.name ).tap{ |s| s.load( sh.usedrange.send( operation ) ) unless sh.application.worksheetfunction.counta(sh.cells).zero? }
|
169
174
|
|
170
175
|
else
|
171
176
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyexcel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Pearson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A tabular data structure in Ruby, with header-based helper methods for
|
14
14
|
analysis and editing, and some of Excel's API style. Can output as 2D Array, HTML
|