robust_excel_ole 1.27 → 1.28

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: bf42835b0febd0db61ca5f87c473f63256d97d2dbaaf05cbe8b97be01fc6f17e
4
- data.tar.gz: 81c4e849c1aceca218207e04577e8857098c1c68482c209515a79e2ead44c5ed
3
+ metadata.gz: 07c975ffbb28abda163753fff25e0949c0aafeddefa24d5d840993a8fc8fea02
4
+ data.tar.gz: 5ac54be9b6ecfcede48a9d9bf0dc67f0ebe86528d41a44e032b29a244a9e3e0d
5
5
  SHA512:
6
- metadata.gz: 88fadf70ac1ec5fab7e133d21fe9a6e9f0ed5399fec3dd0d5198d9c639ebde470dde7f657778564c8a7b9a326fe6b0d177e3cfeca66c4f3642ca97fccfd9314e
7
- data.tar.gz: 578aa3c80a722c10b2d4cdc390a45f1286775586fc58ac4c67dfe7dedb1da0939b4e79fea366bc6bf49034d9631f1b8cfaac3eb54c56b6dab3385f1811f86254
6
+ metadata.gz: a324a7ab9da6e19e91f0da418e61c19c5cc52cf941763b3f4fac781d03e84f554d4dfe52839f41c6df225dca92157ef644700aa6ed2b3b24d4e3998952ad0872
7
+ data.tar.gz: b856effb28b64db2d3b22496f229e8b76c24806264b514772424afdbcdb71abb2f0106274bedc994f5145695d8e8b231eeb568f2c82dc7acc6a1762aa459df3d
data/Changelog CHANGED
@@ -1,7 +1,9 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [1.27] 2020-20-10
4
+ ## [1.28] 2020-23-10
5
+
6
+ ## [1.27] 2020-16-10
5
7
 
6
8
  ## [1.26] 2020-09-10
7
9
 
@@ -335,7 +335,7 @@ or
335
335
  However, this command also starts another pry repl (with another binding). Moreover, local variables in the previous binding are forgotten.
336
336
 
337
337
 
338
- 2. The method +General.update_to_reo+ extends the class Win32Ole such that RobustExcelOle methods can be applied to Win32Ole objects. As mentioned above, the RobustExcelOle objects are wrapper of corresponding WIN32OLE objects. With help of +update_to_reo+ the RobustExcelOle objects and their wrapped Win32Ole objects are interchangeable. One example would be
338
+ 2. The class Win32Ole is being extended such that RobustExcelOle methods can be applied to Win32Ole objects. As mentioned above, the RobustExcelOle objects are wrapper of corresponding WIN32OLE objects. With help of +update_to_reo+ the RobustExcelOle objects and their wrapped Win32Ole objects are interchangeable. One example would be
339
339
 
340
340
  range.ole_range.copy([4,3])
341
341
 
data/bin/jreo CHANGED
@@ -15,10 +15,29 @@ Pry.config.prompt_name = "REO "
15
15
  #Pry.config.history_save = true
16
16
  #Pry.editor = 'notepad' # 'subl', 'vi'
17
17
 
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?}> "
20
+ }
21
+
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?}* "
24
+ }
25
+
26
+ Pry.config.prompt = if RUBY_PLATFORM =~ /java/
27
+ [prompt_proc1, prompt_proc2]
28
+ else
29
+ Pry::Prompt.new(
30
+ "REO",
31
+ "The RobustExcelOle Prompt. Besides the standard information it puts the current object",
32
+ [prompt_proc1, prompt_proc2]
33
+ )
34
+ end
35
+
18
36
  hooks = Pry::Hooks.new
19
37
 
20
38
  hooks.add_hook :when_started, :hook12 do
21
39
  puts 'REO console started'
22
40
  puts
23
41
  end
42
+
24
43
  Pry.start(nil, hooks: hooks)
data/bin/reo CHANGED
@@ -15,10 +15,29 @@ Pry.config.prompt_name = "REO "
15
15
  #Pry.config.history_save = true
16
16
  #Pry.editor = 'notepad' # 'subl', 'vi'
17
17
 
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?}> "
20
+ }
21
+
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?}* "
24
+ }
25
+
26
+ Pry.config.prompt = if RUBY_PLATFORM =~ /java/
27
+ [prompt_proc1, prompt_proc2]
28
+ else
29
+ Pry::Prompt.new(
30
+ "REO",
31
+ "The RobustExcelOle Prompt. Besides the standard information it puts the current object",
32
+ [prompt_proc1, prompt_proc2]
33
+ )
34
+ end
35
+
18
36
  hooks = Pry::Hooks.new
19
37
 
20
38
  hooks.add_hook :when_started, :hook12 do
21
39
  puts 'REO console started'
22
40
  puts
23
41
  end
42
+
24
43
  Pry.start(nil, hooks: hooks)
@@ -3,8 +3,8 @@ if RUBY_PLATFORM =~ /java/
3
3
  else
4
4
  require 'win32ole'
5
5
  end
6
- require File.join(File.dirname(__FILE__), 'robust_excel_ole/base')
7
6
  require File.join(File.dirname(__FILE__), 'robust_excel_ole/general')
7
+ require File.join(File.dirname(__FILE__), 'robust_excel_ole/base')
8
8
  require File.join(File.dirname(__FILE__), 'robust_excel_ole/vba_objects')
9
9
  require File.join(File.dirname(__FILE__), 'robust_excel_ole/range_owners')
10
10
  require File.join(File.dirname(__FILE__), 'robust_excel_ole/address_tool')
@@ -18,5 +18,4 @@ require File.join(File.dirname(__FILE__), 'robust_excel_ole/list_object')
18
18
  require File.join(File.dirname(__FILE__), 'robust_excel_ole/cygwin') if RUBY_PLATFORM =~ /cygwin/
19
19
  require File.join(File.dirname(__FILE__), 'robust_excel_ole/version')
20
20
 
21
- #include RobustExcelOle
22
- include General
21
+ General.init_reo_for_win32ole
@@ -65,6 +65,8 @@ module RobustExcelOle
65
65
 
66
66
  class Base
67
67
 
68
+ include General
69
+
68
70
  # @private
69
71
  def own_methods
70
72
  (self.methods - Object.methods).sort
@@ -110,3 +112,6 @@ module RobustExcelOle
110
112
  end
111
113
 
112
114
  end
115
+
116
+ REO = RobustExcelOle
117
+
@@ -69,16 +69,16 @@ module General
69
69
  end
70
70
 
71
71
  def class2method
72
- [{Excel => :Hwnd},
73
- {Workbook => :FullName},
74
- {Worksheet => :UsedRange},
72
+ [{RobustExcelOle::Excel => :Hwnd},
73
+ {RobustExcelOle::Workbook => :FullName},
74
+ {RobustExcelOle::Worksheet => :UsedRange},
75
75
  {RobustExcelOle::Range => :Row},
76
- {ListObject => :ListRows}]
76
+ {RobustExcelOle::ListObject => :ListRows}]
77
77
  end
78
78
 
79
79
 
80
80
  # enable RobustExcelOle methods to Win32Ole objects
81
- def uplift_to_reo
81
+ def init_reo_for_win32ole
82
82
  exclude_list = [:each, :inspect]
83
83
  class2method.each do |element|
84
84
  classname = element.first.first
@@ -94,7 +94,7 @@ module General
94
94
  nil
95
95
  end
96
96
 
97
- module_function :absolute_path, :canonize, :normalize, :change_current_binding, :class2method, :uplift_to_reo
97
+ module_function :absolute_path, :canonize, :normalize, :change_current_binding, :class2method, :init_reo_for_win32ole
98
98
 
99
99
  end
100
100
 
@@ -226,37 +226,6 @@ class WIN32OLE
226
226
  raise TypeREOError, "given object cannot be type-lifted to a RobustExcelOle object"
227
227
  end
228
228
 
229
- =begin
230
- def to_reo
231
- case ole_type.name
232
- when 'Range' then RobustExcelOle::Range.new(self)
233
- when '_Worksheet' then RobustExcelOle::Worksheet.new(self)
234
- when '_Workbook' then RobustExcelOle::Workbook.new(self)
235
- when '_Application' then RobustExcelOle::Excel.new(self)
236
- else
237
- self
238
- end
239
- end
240
- =end
241
-
242
- =begin
243
- alias method_missing_before_implicit_typelift method_missing
244
-
245
- def method_missing(name, *args, &blk)
246
- puts "method_missing:"
247
- puts "name: #{name.inspect}"
248
- #raise NoMethodError if name.to_s == "Hwnd" or name.to_s == "FullName" or name.to_s == "UsedRange" or name.to_s == "Row" or name.to_s == "ListRows"
249
- begin
250
- reo_obj = self.to_reo
251
- puts "reo_obj: #{reo_obj.inspect}"
252
- rescue
253
- puts "$!.message: #{$!.message}"
254
- method_missing_before_implicit_typelift(name, *args, &blk)
255
- end
256
- reo_obj.send(name, *args, &blk)
257
- end
258
- =end
259
-
260
229
  end
261
230
 
262
231
  # @private
@@ -382,5 +351,3 @@ module MethodHelpers
382
351
  end
383
352
  end
384
353
  end
385
-
386
- REO = RobustExcelOle
@@ -1,3 +1,3 @@
1
1
  module RobustExcelOle
2
- VERSION = "1.27"
2
+ VERSION = "1.28"
3
3
  end
@@ -96,14 +96,13 @@ module RobustExcelOle
96
96
 
97
97
  end
98
98
 
99
- describe "General.uplift_to_reo" do
99
+ describe "General.init_reo_for_win32ole" do
100
100
 
101
101
  before do
102
102
  @book1 = Workbook.open(@simple_file, :visible => true)
103
103
  end
104
104
 
105
105
  it "should apply reo-methods to win32ole objects" do
106
- General.uplift_to_reo
107
106
  ole_book1 = @book1.ole_workbook
108
107
  sheet1 = ole_book1.sheet(1)
109
108
  sheet1.should be_a Worksheet
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.27'
4
+ version: '1.28'
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-21 00:00:00.000000000 Z
11
+ date: 2020-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -126,7 +126,6 @@ files:
126
126
  - examples/open_save_close/example_reuse.rb
127
127
  - examples/open_save_close/example_simple.rb
128
128
  - examples/open_save_close/example_unobtrusively.rb
129
- - lib/reo_console.rb
130
129
  - lib/robust_excel_ole.rb
131
130
  - lib/robust_excel_ole/address_tool.rb
132
131
  - lib/robust_excel_ole/base.rb
@@ -1,42 +0,0 @@
1
- require 'pry'
2
- require '../robust_excel_ole/lib/robust_excel_ole'
3
-
4
- include REO
5
- include General
6
-
7
- # some pry configuration
8
- Pry.config.windows_console_warning = false
9
- Pry.config.color = false
10
- Pry.config.prompt_name = "REO "
11
-
12
- #Pry.config.history_save = true
13
- #Pry.editor = 'notepad' # 'subl', 'vi'
14
-
15
- prompt_proc1 = proc { |target_self, nest_level, pry|
16
- "[#{pry.input_ring.count}] #{pry.config.prompt_name}(#{Pry.view_clip(target_self.inspect)})#{":#{nest_level}" unless nest_level.zero?}> "
17
- }
18
-
19
- prompt_proc2 = proc { |target_self, nest_level, pry|
20
- "[#{pry.input_ring.count}] #{pry.config.prompt_name}(#{Pry.view_clip(target_self.inspect)})#{":#{nest_level}" unless nest_level.zero?}* "
21
- }
22
-
23
- Pry.config.prompt = if RUBY_PLATFORM =~ /java/
24
- [prompt_proc1, prompt_proc2]
25
- else
26
- Pry::Prompt.new(
27
- "REO",
28
- "The RobustExcelOle Prompt. Besides the standard information it puts the current object",
29
- [prompt_proc1, prompt_proc2]
30
- )
31
- end
32
-
33
- hooks = Pry::Hooks.new
34
-
35
- hooks.add_hook :when_started, :hook12 do
36
- puts 'REO console started'
37
- puts
38
- end
39
-
40
- General.uplift_to_reo
41
-
42
- Pry.start(nil, hooks: hooks)