robust_excel_ole 1.19.1 → 1.19.7

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: cc09b14fea1e80ffe22d0f47b5b5155b044b669ecabdd882995a966480516085
4
- data.tar.gz: 85b55ef13fc3506b2fce3271e1f1c40cd97c3dd872dff4d79a953dbcef68d58b
3
+ metadata.gz: 902415638a1e88a9060ae003c0f470fd555fe064001993e92a20e4c3f89749e2
4
+ data.tar.gz: 89b78060bd55544926d1f521c9fa33cd9e8040b28abe59774be2f9497dc02487
5
5
  SHA512:
6
- metadata.gz: 7ec786a35f9ce637f0bdc745f6ef4bb3c683d9cbe6242a2a0bc9a27636c72b1d95e7b47bf8c49c3cc188d9e09406b5ef270abbce7a7d71ad32ec0e0277c15aae
7
- data.tar.gz: cb64cb1d4068da94c0ea6765e6626078c5cc8672bc40c5c18f6962cc5cbcf14c4be4a5032302e8936f5012a54d0891aff9a0914452d2400471ddece1a3a22865
6
+ metadata.gz: 2a8763d8a6b12ca7cccb7fa8dd79e5d49b1ebc2336a3b470a48121efb8d021417be97b6fbd6076430f6d1e9ff1a0326ebadbe0eb2eb5eeb023364c8e3c3d8ca8
7
+ data.tar.gz: 4607fa695e3802427e93baa8cb2de9ad4f53bb08ae0e474a35cc8f72a3812445223504b7cf9029363ed9fa906603163726cea4dcb157b6fe1e11a56177d60765
data/Changelog CHANGED
@@ -2,7 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
- ## [1.20] 2020-31.-8
5
+ ## [1.20] 2020-12-07
6
+
7
+ ### Changed
8
+ - using pry in console
6
9
 
7
10
  ### Added
8
11
  - ListObject
@@ -61,7 +61,11 @@ or as a console. You can start the console via the command
61
61
 
62
62
  reo
63
63
 
64
- You can use the command +jreo+ if you want to start the console under jruby and if you don't want to use a version manager to switch between ruby and jruby. The call of the console will include RobustExcelOle for you.
64
+ If you want to start the console under jruby, and if you don't want to use a version manager to switch between ruby and jruby, then use the command
65
+
66
+ jreo
67
+
68
+ The call of the console will include RobustExcelOle for you.
65
69
 
66
70
  The following examples can be used for both scripts and console. If you have started the console in the gem path, you can just put these examples.
67
71
 
@@ -0,0 +1,4 @@
1
+
2
+ @echo off
3
+
4
+ jruby reo
data/bin/reo CHANGED
@@ -1,4 +1,21 @@
1
- @echo off
1
+ require 'pry'
2
+ require '../lib/robust_excel_ole'
3
+ include REO
4
+ # include RobustExcelOle
5
+ include General
2
6
 
3
- irb -f -r ../lib/reo_console.rb
7
+ puts 'REO console started'
8
+ puts
4
9
 
10
+
11
+ # some pry configuration
12
+ Pry.config.windows_console_warning = false
13
+ Pry.config.history.should_save = true
14
+ #Pry.editor = 'notepad' # 'subl', 'vi'
15
+ #Pry.config.prompt =
16
+ # [
17
+ # ->(_obj, _nest_level, _) { ">> " },
18
+ # ->(*) { " " }
19
+ # ]
20
+
21
+ pry
@@ -0,0 +1,4 @@
1
+
2
+ @echo off
3
+
4
+ ruby reo
@@ -1,62 +1,21 @@
1
- require '../../robust_excel_ole/lib/robust_excel_ole'
1
+ require 'pry'
2
+ require 'robust_excel_ole'
2
3
  include REO
3
4
  # include RobustExcelOle
4
5
  include General
5
6
 
6
- require 'irb'
7
- require 'irb/completion'
8
- require 'irb/ext/save-history'
7
+ puts 'REO console started'
8
+ puts
9
9
 
10
- ARGV.concat ['--readline',
11
- '--prompt-mode',
12
- 'simple']
13
10
 
14
- # 250 entries in the list
15
- IRB.conf[:SAVE_HISTORY] = 250
11
+ # some pry configuration
12
+ Pry.config.windows_console_warning = false
13
+ Pry.config.history.should_save = true
14
+ #Pry.editor = 'notepad' # 'subl', 'vi'
15
+ #Pry.config.prompt =
16
+ # [
17
+ # ->(_obj, _nest_level, _) { ">> " },
18
+ # ->(*) { " " }
19
+ # ]
16
20
 
17
- # Store results in home directory with specified file name
18
- # IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
19
- IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.reo-history"
20
-
21
- IRB.conf[:PROMPT_MODE] = :SIMPLE
22
- #IRB.conf[:USE_READLINE] = true
23
- #IRB.conf[:AUTO_INDENT] = true
24
-
25
- # @private
26
- module Readline
27
- module Hist
28
- LOG = IRB.conf[:HISTORY_FILE]
29
- # LOG = "#{ENV['HOME']}/.irb-history"
30
-
31
- def self.write_log(line)
32
- File.open(LOG, 'ab') do |f|
33
- f << "#{line}
34
- "
35
- end
36
- end
37
-
38
- def self.start_session_log
39
- timestamp = proc { Time.now.strftime('%Y-%m-%d, %H:%M:%S') }
40
- # @private
41
- class <<timestamp
42
- alias_method :to_s, :call
43
- end
44
- write_log("###### session start: #{timestamp}")
45
- at_exit { write_log("###### session stop: #{timestamp}") }
46
- end
47
- end
48
-
49
- alias old_readline readline
50
- def readline(*args)
51
- ln = old_readline(*args)
52
- begin
53
- Hist.write_log(ln)
54
- rescue StandardError
55
- end
56
- ln
57
- end
58
- end
59
-
60
- Readline::Hist.start_session_log
61
- puts 'REO console started: the changed one'
62
- #IRB.start
21
+ pry
@@ -793,8 +793,3 @@ public
793
793
  Application = Excel
794
794
 
795
795
  end
796
-
797
- class WIN32OLE
798
- include Enumerable
799
- end
800
-
@@ -95,6 +95,8 @@ end
95
95
 
96
96
  # @private
97
97
  class WIN32OLE
98
+
99
+ include Enumerable
98
100
 
99
101
  # type-lifting WIN32OLE objects to RobustExcelOle objects
100
102
  def to_reo
@@ -121,6 +123,17 @@ class WIN32OLE
121
123
  end
122
124
  raise TypeREOError, "given object cannot be type-lifted to a RobustExcelOle object"
123
125
  end
126
+
127
+ alias method_missing_before_implicit_typelift method_missing
128
+ def xx_method_missing(name, *args, &blk)
129
+ begin
130
+ reo_obj = self.to_reo
131
+ rescue
132
+ puts "$!.message: #{$!.message}"
133
+ method_missing_before_implicit_typelift(name, *args, &blk)
134
+ end
135
+ reo_obj.send(name, *args, &blk)
136
+ end
124
137
  end
125
138
 
126
139
  # @private
@@ -74,6 +74,8 @@ module RobustExcelOle
74
74
  end
75
75
  end
76
76
 
77
+ private
78
+
77
79
  def define_getting_setting_method(ole_cell,name_str)
78
80
  if name_str[-1] != '='
79
81
  self.class.define_method(name_str) do
@@ -85,7 +87,7 @@ module RobustExcelOle
85
87
  end
86
88
  end
87
89
  end
88
- end
90
+ end
89
91
 
90
92
  # accesses a table row object
91
93
  # @param [Integer] a row number (>= 1)
@@ -96,6 +98,22 @@ module RobustExcelOle
96
98
 
97
99
  end
98
100
 
101
+ def column_names
102
+ @ole_table.HeaderRowRange.Value.first
103
+ end
104
+
105
+ # @private
106
+ def to_s
107
+ @ole_table.Name.to_s
108
+ end
109
+
110
+ # @private
111
+ def inspect
112
+ "#<ListObject:" + "#{@ole_table.Name}" +
113
+ " size:#{@ole_table.ListRows.Count}x#{@ole_table.ListColumns.Count}" +
114
+ " worksheet:#{@ole_table.Parent.Name}" + " workbook:#{@ole_table.Parent.Parent.Name}" + ">"
115
+ end
116
+
99
117
  private
100
118
 
101
119
  def method_missing(name, *args)
@@ -1,3 +1,3 @@
1
1
  module RobustExcelOle
2
- VERSION = "1.19.1"
2
+ VERSION = "1.19.7"
3
3
  end
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
33
33
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
34
34
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
35
35
  s.require_paths = ["lib"]
36
+ s.add_runtime_dependency "pry", '>= 0.12.1'
36
37
  s.add_development_dependency "rspec", '>= 2.6.0'
37
38
  s.required_ruby_version = '>= 2.1'
38
39
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robust_excel_ole
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.1
4
+ version: 1.19.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - traths
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-06 00:00:00.000000000 Z
11
+ date: 2020-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.12.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.12.1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rspec
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -34,8 +48,9 @@ description: "RobustExcelOle helps controlling Excel. \n This
34
48
  email:
35
49
  - Thomas.Raths@gmx.net
36
50
  executables:
37
- - jreo
51
+ - jreo.bat
38
52
  - reo
53
+ - reo.bat
39
54
  extensions: []
40
55
  extra_rdoc_files:
41
56
  - README.rdoc
@@ -64,8 +79,9 @@ files:
64
79
  - benchmarking/sample_excel_files/xlsx_500_rows.xlsx
65
80
  - benchmarking/simple_xlsx_reader_example.rb
66
81
  - benchmarking/spreadsheet_example.rb
67
- - bin/jreo
82
+ - bin/jreo.bat
68
83
  - bin/reo
84
+ - bin/reo.bat
69
85
  - docs/README_excel.rdoc
70
86
  - docs/README_open.rdoc
71
87
  - docs/README_ranges.rdoc
@@ -99,7 +115,6 @@ files:
99
115
  - examples/open_save_close/example_simple.rb
100
116
  - examples/open_save_close/example_unobtrusively.rb
101
117
  - jreo.bat
102
- - lib/jreo_console.rb
103
118
  - lib/reo_console.rb
104
119
  - lib/robust_excel_ole.rb
105
120
  - lib/robust_excel_ole/address_tool.rb
@@ -119,7 +134,6 @@ files:
119
134
  - lib/robust_excel_ole/workbook.rb
120
135
  - lib/robust_excel_ole/worksheet.rb
121
136
  - lib/spec_helper.rb
122
- - reo.bat
123
137
  - robust_excel_ole.gemspec
124
138
  - spec/address_tool_spec.rb
125
139
  - spec/base_spec.rb
data/bin/jreo DELETED
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env jruby
2
- # -*- mode: jruby -*-
3
-
4
- require 'robust_excel_ole'
5
- include REO
6
- # include RobustExcelOle
7
- include General
8
-
9
- require 'irb'
10
- require 'irb/completion'
11
- require 'irb/ext/save-history'
12
- #gem 'jruby-readline'
13
-
14
- ARGV.concat ['--readline',
15
- '--prompt-mode',
16
- 'simple']
17
- # '-rjruby-readline']
18
-
19
- #IRB.conf[:PROMPT_MODE] = :SIMPLE
20
- #IRB.conf[:USE_READLINE] = true
21
- #IRB.conf[:AUTO_INDENT] = true
22
-
23
-
24
-
25
-
26
- # 250 entries in the list
27
- IRB.conf[:SAVE_HISTORY] = 250
28
-
29
- # Store results in home directory with specified file name
30
- # IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
31
- #IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
32
-
33
- IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.reo-history"
34
-
35
- # @private
36
- module Readline
37
- module Hist
38
- LOG = IRB.conf[:HISTORY_FILE]
39
- # LOG = "#{ENV['HOME']}/.irb-history"
40
-
41
- def self.write_log(line)
42
- File.open(LOG, 'ab') do |f|
43
- f << "#{line}
44
- "
45
- end
46
- end
47
-
48
- def self.start_session_log
49
- timestamp = proc { Time.now.strftime('%Y-%m-%d, %H:%M:%S') }
50
- # @private
51
- class <<timestamp
52
- alias_method :to_s, :call
53
- end
54
- write_log("###### session start: #{timestamp}")
55
- at_exit { write_log("###### session stop: #{timestamp}") }
56
- end
57
- end
58
-
59
- alias old_readline readline
60
- def readline(*args)
61
- ln = old_readline(*args)
62
- begin
63
- Hist.write_log(ln)
64
- rescue StandardError
65
- end
66
- ln
67
- end
68
- end
69
-
70
- Readline::Hist.start_session_log
71
- puts 'JREO console started'
72
-
73
-
74
- IRB.start
@@ -1,67 +0,0 @@
1
- # require '../robust_excel_ole/lib/robust_excel_ole'
2
- include REO
3
- # include RobustExcelOle
4
- include General
5
-
6
- require 'irb/completion'
7
- require 'irb/ext/save-history'
8
- gem 'jruby-readline'
9
-
10
- ARGV.concat ['--readline',
11
- '--prompt-mode',
12
- 'simple',
13
- '-rjruby-readline']
14
-
15
- #IRB.conf[:PROMPT_MODE] = :SIMPLE
16
- #IRB.conf[:USE_READLINE] = true
17
- #IRB.conf[:AUTO_INDENT] = true
18
-
19
-
20
-
21
-
22
- # 250 entries in the list
23
- IRB.conf[:SAVE_HISTORY] = 250
24
-
25
- # Store results in home directory with specified file name
26
- # IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
27
- #IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
28
-
29
- IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.reo-history"
30
-
31
- # @private
32
- module Readline
33
- module Hist
34
- LOG = IRB.conf[:HISTORY_FILE]
35
- # LOG = "#{ENV['HOME']}/.irb-history"
36
-
37
- def self.write_log(line)
38
- File.open(LOG, 'ab') do |f|
39
- f << "#{line}
40
- "
41
- end
42
- end
43
-
44
- def self.start_session_log
45
- timestamp = proc { Time.now.strftime('%Y-%m-%d, %H:%M:%S') }
46
- # @private
47
- class <<timestamp
48
- alias_method :to_s, :call
49
- end
50
- write_log("###### session start: #{timestamp}")
51
- at_exit { write_log("###### session stop: #{timestamp}") }
52
- end
53
- end
54
-
55
- alias old_readline readline
56
- def readline(*args)
57
- ln = old_readline(*args)
58
- begin
59
- Hist.write_log(ln)
60
- rescue StandardError
61
- end
62
- ln
63
- end
64
- end
65
-
66
- Readline::Hist.start_session_log
67
- puts 'JREO console started'
data/reo.bat DELETED
@@ -1,5 +0,0 @@
1
- @echo off
2
-
3
- irb -f -r ./lib/reo_console.rb
4
-
5
- #irb -f -r ./lib/robust_excel_ole -r ./lib/reo_console.rb