robust_excel_ole 1.28 → 1.29
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/reo +2 -2
- data/lib/robust_excel_ole/address_tool.rb +2 -0
- data/lib/robust_excel_ole/general.rb +55 -4
- data/lib/robust_excel_ole/list_object.rb +1 -1
- data/lib/robust_excel_ole/version.rb +1 -1
- data/spec/data/more_data/workbook.xls +0 -0
- data/spec/workbook_specs/workbook_unobtr_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73ad362b2dfdd26980d413527196770cd2fb7a48b62120c2f760534c34b50f63
|
4
|
+
data.tar.gz: 40913cb74eebf1f37a60eb54d3cae2d9ceaabaf21c9a8ce29a16c8a90d10be0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee1041c26230fbf1d0406f2a4a7ac31116f01c3e28c40aa05d15f7fd19c78dcf27ca812c345e7dfe9f0c6aa8acb1ca5b48856565ec337e82e2a81cc7420a69d
|
7
|
+
data.tar.gz: 5606ffb364e94adbfb5654ef146ce67127a302d237c85422eaf0ca4a58fac4d6113798fb155bf316af6e6430d7b90ab4bd8971d5481993daef323996ae3d3d8c
|
data/bin/reo
CHANGED
@@ -16,11 +16,11 @@ Pry.config.prompt_name = "REO "
|
|
16
16
|
#Pry.editor = 'notepad' # 'subl', 'vi'
|
17
17
|
|
18
18
|
prompt_proc1 = proc { |target_self, nest_level, pry|
|
19
|
-
|
19
|
+
"[#{pry.input_ring.count}] #{pry.config.prompt_name}(#{Pry.view_clip(target_self)})#{":#{nest_level}" unless nest_level.zero?}> "
|
20
20
|
}
|
21
21
|
|
22
22
|
prompt_proc2 = proc { |target_self, nest_level, pry|
|
23
|
-
"[#{pry.input_ring.count}] #{pry.config.prompt_name}(#{Pry.view_clip(target_self
|
23
|
+
"[#{pry.input_ring.count}] #{pry.config.prompt_name}(#{Pry.view_clip(target_self)})#{":#{nest_level}" unless nest_level.zero?}* "
|
24
24
|
}
|
25
25
|
|
26
26
|
Pry.config.prompt = if RUBY_PLATFORM =~ /java/
|
@@ -79,10 +79,9 @@ module General
|
|
79
79
|
|
80
80
|
# enable RobustExcelOle methods to Win32Ole objects
|
81
81
|
def init_reo_for_win32ole
|
82
|
-
exclude_list = [:each, :inspect]
|
82
|
+
exclude_list = [:each, :each_with_index, :inspect, :Calculation=]
|
83
83
|
class2method.each do |element|
|
84
84
|
classname = element.first.first
|
85
|
-
method = element.first.last
|
86
85
|
classname.instance_methods(false).each do |inst_method|
|
87
86
|
if !exclude_list.include?(inst_method)
|
88
87
|
WIN32OLE.send(:define_method, inst_method) do |*args, &blk|
|
@@ -94,10 +93,12 @@ module General
|
|
94
93
|
nil
|
95
94
|
end
|
96
95
|
|
97
|
-
module_function :absolute_path, :canonize, :normalize, :change_current_binding, :class2method,
|
96
|
+
module_function :absolute_path, :canonize, :normalize, :change_current_binding, :class2method,
|
97
|
+
:init_reo_for_win32ole, :hostnameshare2networkpath
|
98
98
|
|
99
99
|
end
|
100
100
|
|
101
|
+
|
101
102
|
# @private
|
102
103
|
class Pry
|
103
104
|
|
@@ -159,7 +160,6 @@ class Pry
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
|
162
|
-
# @private
|
163
163
|
class Integer
|
164
164
|
|
165
165
|
alias old_spaceship <=>
|
@@ -202,6 +202,57 @@ class Array
|
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
205
|
+
=begin
|
206
|
+
# @private
|
207
|
+
module RefinedSpaceship
|
208
|
+
|
209
|
+
refine Integer do
|
210
|
+
|
211
|
+
alias old_spaceship <=>
|
212
|
+
|
213
|
+
def <=> other
|
214
|
+
# p other
|
215
|
+
if other.is_a? Array
|
216
|
+
self <=> other.first
|
217
|
+
else
|
218
|
+
old_spaceship other
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
refine Array do
|
224
|
+
|
225
|
+
alias old_spaceship <=>
|
226
|
+
|
227
|
+
def <=> other
|
228
|
+
# p other
|
229
|
+
if other.is_a? Integer
|
230
|
+
self <=> [other]
|
231
|
+
else
|
232
|
+
old_spaceship other
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
=end
|
238
|
+
|
239
|
+
# @private
|
240
|
+
class Array
|
241
|
+
|
242
|
+
def find_all_indices elem
|
243
|
+
found, index, result = -1, -1, []
|
244
|
+
while found
|
245
|
+
found = self[index+1..-1].index(elem)
|
246
|
+
if found
|
247
|
+
index = index + found + 1
|
248
|
+
result << index
|
249
|
+
end
|
250
|
+
end
|
251
|
+
result
|
252
|
+
end
|
253
|
+
|
254
|
+
end
|
255
|
+
|
205
256
|
# @private
|
206
257
|
class WIN32OLE
|
207
258
|
|
@@ -351,7 +351,7 @@ module RobustExcelOle
|
|
351
351
|
listrows = @ole_table.ListRows
|
352
352
|
result = []
|
353
353
|
(1..listrows.Count).each do |row_number|
|
354
|
-
row_values(row_number).
|
354
|
+
row_values(row_number).find_all_indices(value).each do |col_number|
|
355
355
|
result << @ole_table.Application.Intersect(listrows.Item(row_number).Range,
|
356
356
|
@ole_table.ListColumns.Item(col_number+1).Range).to_reo
|
357
357
|
end
|
Binary file
|
@@ -935,7 +935,7 @@ describe Workbook do
|
|
935
935
|
book.ReadOnly.should be true
|
936
936
|
book.should == @book
|
937
937
|
book.filename.should == @book.filename
|
938
|
-
book.excel.
|
938
|
+
book.excel.should == @book.excel
|
939
939
|
book.sheet(1)[1,1] = book.sheet(1)[1,1].Value == "foo" ? "bar" : "foo"
|
940
940
|
end
|
941
941
|
}.to raise_error(WorkbookReadOnly)
|
@@ -1013,7 +1013,7 @@ describe Workbook do
|
|
1013
1013
|
book.Readonly.should be false
|
1014
1014
|
book.should == @book
|
1015
1015
|
book.filename.should == @book.filename
|
1016
|
-
book.excel.
|
1016
|
+
book.excel.should == @book.excel
|
1017
1017
|
book.sheet(1)[1,1] = book.sheet(1)[1,1].Value == "foo" ? "bar" : "foo"
|
1018
1018
|
end
|
1019
1019
|
@book.close
|
@@ -1026,7 +1026,7 @@ describe Workbook do
|
|
1026
1026
|
book.Readonly.should be false
|
1027
1027
|
book.should == @book
|
1028
1028
|
book.filename.should == @book.filename
|
1029
|
-
book.excel.
|
1029
|
+
book.excel.should == @book.excel
|
1030
1030
|
book.sheet(1)[1,1] = book.sheet(1)[1,1].Value == "foo" ? "bar" : "foo"
|
1031
1031
|
end
|
1032
1032
|
@book.close
|
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.29'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- traths
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|