robust_excel_ole 1.28 → 1.29

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
2
  SHA256:
3
- metadata.gz: 07c975ffbb28abda163753fff25e0949c0aafeddefa24d5d840993a8fc8fea02
4
- data.tar.gz: 5ac54be9b6ecfcede48a9d9bf0dc67f0ebe86528d41a44e032b29a244a9e3e0d
3
+ metadata.gz: 73ad362b2dfdd26980d413527196770cd2fb7a48b62120c2f760534c34b50f63
4
+ data.tar.gz: 40913cb74eebf1f37a60eb54d3cae2d9ceaabaf21c9a8ce29a16c8a90d10be0b
5
5
  SHA512:
6
- metadata.gz: a324a7ab9da6e19e91f0da418e61c19c5cc52cf941763b3f4fac781d03e84f554d4dfe52839f41c6df225dca92157ef644700aa6ed2b3b24d4e3998952ad0872
7
- data.tar.gz: b856effb28b64db2d3b22496f229e8b76c24806264b514772424afdbcdb71abb2f0106274bedc994f5145695d8e8b231eeb568f2c82dc7acc6a1762aa459df3d
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
- "[#{pry.input_ring.count}] #{pry.config.prompt_name}(#{Pry.view_clip(target_self)})#{":#{nest_level}" unless nest_level.zero?}> "
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.inspect.gsub(/\"/, ''))})})#{":#{nest_level}" unless nest_level.zero?}* "
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/
@@ -1,5 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
+ #using RefinedSpaceship
4
+
3
5
  module RobustExcelOle
4
6
 
5
7
  class AddressTool < Base
@@ -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, :init_reo_for_win32ole
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).find_each_index(value).each do |col_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
@@ -1,3 +1,3 @@
1
1
  module RobustExcelOle
2
- VERSION = "1.28"
2
+ VERSION = "1.29"
3
3
  end
@@ -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.should_not == @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.should_not == @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.should_not == @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.28'
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-10-23 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry