robust_excel_ole 1.10 → 1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +8 -0
- data/README.rdoc +6 -4
- data/docs/README_open.rdoc +18 -13
- data/lib/robust_excel_ole/bookstore.rb +95 -9
- data/lib/robust_excel_ole/excel.rb +12 -7
- data/lib/robust_excel_ole/general.rb +20 -7
- data/lib/robust_excel_ole/range.rb +6 -0
- data/lib/robust_excel_ole/reo_common.rb +8 -0
- data/lib/robust_excel_ole/version.rb +1 -1
- data/lib/robust_excel_ole/workbook.rb +201 -165
- data/lib/robust_excel_ole/worksheet.rb +6 -0
- data/spec/bookstore_spec.rb +92 -2
- data/spec/data/more_data/workbook.xls +0 -0
- data/spec/excel_spec.rb +86 -3
- data/spec/range_spec.rb +12 -0
- data/spec/workbook_spec.rb +56 -3
- data/spec/workbook_specs/workbook_open_spec.rb +332 -195
- data/spec/workbook_specs/workbook_unobtr_spec.rb +41 -1
- data/spec/worksheet_spec.rb +14 -0
- metadata +2 -2
@@ -25,7 +25,7 @@ describe Workbook do
|
|
25
25
|
@simple_file_other_path = @dir + '/more_data/workbook.xls'
|
26
26
|
@another_simple_file = @dir + '/another_workbook.xls'
|
27
27
|
@linked_file = @dir + '/workbook_linked.xlsm'
|
28
|
-
@simple_file_xlsm = @dir + '/workbook.
|
28
|
+
@simple_file_xlsm = @dir + '/workbook.xlsm'
|
29
29
|
@simple_file_xlsx = @dir + '/workbook.xlsx'
|
30
30
|
@simple_file1 = @simple_file
|
31
31
|
end
|
@@ -296,6 +296,46 @@ describe Workbook do
|
|
296
296
|
|
297
297
|
end
|
298
298
|
|
299
|
+
describe "excels number" do
|
300
|
+
|
301
|
+
it "should open one excel instance and workbook should be closed" do
|
302
|
+
Workbook.unobtrusively(@simple_file1){ |book| nil }
|
303
|
+
Excel.excels_number.should == 1
|
304
|
+
end
|
305
|
+
|
306
|
+
end
|
307
|
+
|
308
|
+
describe "closed workbook" do
|
309
|
+
|
310
|
+
it "should close the workbook by default" do
|
311
|
+
Workbook.unobtrusively(@simple_file1){ |book| nil}
|
312
|
+
Excel.current.Workbooks.Count.should == 0
|
313
|
+
end
|
314
|
+
|
315
|
+
end
|
316
|
+
|
317
|
+
describe "connecting to unknown workbooks" do
|
318
|
+
|
319
|
+
context "with one unknown workbook" do
|
320
|
+
|
321
|
+
before do
|
322
|
+
ole_e1 = WIN32OLE.new('Excel.Application')
|
323
|
+
ws = ole_e1.Workbooks
|
324
|
+
abs_filename = General.absolute_path(@simple_file1).tr('/','\\')
|
325
|
+
@ole_wb = ws.Open(abs_filename)
|
326
|
+
end
|
327
|
+
|
328
|
+
it "should connect to an unknown workbook" do
|
329
|
+
Workbook.unobtrusively(@simple_file1) do |book|
|
330
|
+
book.filename.should == @simple_file1
|
331
|
+
book.excel.ole_excel.Hwnd.should == @ole_wb.Application.Hwnd
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
end
|
336
|
+
|
337
|
+
end
|
338
|
+
|
299
339
|
describe "writability" do
|
300
340
|
|
301
341
|
context "with no book" do
|
data/spec/worksheet_spec.rb
CHANGED
@@ -102,6 +102,20 @@ describe Worksheet do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
end
|
105
|
+
|
106
|
+
describe "==" do
|
107
|
+
|
108
|
+
it "should return true for identical worksheets" do
|
109
|
+
sheet2 = @book.sheet(1)
|
110
|
+
@sheet.should == sheet2
|
111
|
+
end
|
112
|
+
|
113
|
+
it "should return false for non-identical worksheets" do
|
114
|
+
sheet2 = @book.sheet(2)
|
115
|
+
@sheet.should_not == sheet2
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
105
119
|
|
106
120
|
describe "access sheet name" do
|
107
121
|
describe "#name" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: robust_excel_ole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- traths
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|