robust_excel_ole 1.18.4 → 1.19
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/README.rdoc +19 -22
- data/bin/jreo +73 -2
- data/bin/reo +60 -2
- data/docs/README_ranges.rdoc +1 -1
- data/docs/README_sheet.rdoc +2 -1
- data/lib/reo_console.rb +8 -1
- data/lib/robust_excel_ole/version.rb +1 -1
- data/reo.bat +3 -1
- 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: c5ff7771ae8a35d2cf47dce37e92a9d4d720148faa91eb37dc2342b1239f7d0a
|
4
|
+
data.tar.gz: 4d50eb99f297d38a60845eca2550a36ae2734694b538c52eb23052a9e9db0077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ccd9358b7d0ca576c8120e249c7af4122c4040f51357efc339536f93cde6d8a6b9a2bb32071382f5c5d8ddc3f084920831eda36df0c1a8ed9698972cea9d516
|
7
|
+
data.tar.gz: f1b813c71610b01d3bfd7e70245a52b02522910b2d0cbd6a9742825c06a131f47bc7f9310c59749b0caf881fef6d8a8bc64336f709ba2104a4f78bff844a44b6
|
data/README.rdoc
CHANGED
@@ -14,23 +14,26 @@ Library references are supported.
|
|
14
14
|
RobustExcelOle works by sending VBA methods via Win32OLE.
|
15
15
|
Therefore, it runs on Windows only.
|
16
16
|
|
17
|
-
==
|
17
|
+
== Features
|
18
|
+
|
19
|
+
RobustExcelOle supports
|
18
20
|
|
19
21
|
- opening and processing workbooks across various Excel instances
|
20
|
-
- reading
|
21
|
-
-
|
22
|
-
-
|
23
|
-
- dealing with
|
24
|
-
even with simultanously happening user interactions
|
22
|
+
- standard tasks like opening, reading, writing, saving, closing workbooks
|
23
|
+
- dealing with various cases of Excel and user behaviour
|
24
|
+
- managing conflicts when opening workbooks (e.g. blocking or unsaved workbooks)
|
25
|
+
- dealing with simultanously happening user interactions
|
25
26
|
- workarounds for Excel bugs and JRuby bugs
|
26
|
-
-
|
27
|
-
-
|
28
|
-
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
- availability of all VBA methods
|
28
|
+
- availability of Excel constants (in form if Ruby constants: Excel constant.capitalize)
|
29
|
+
- standard Excel file formats (.xlsx, .xls, .xlsm)
|
30
|
+
- reopening workbooks after closing them
|
31
|
+
- unobtrusively opening workbooks, i.e. opening and processing workbooks
|
32
|
+
while preserving their status, e.g. saved status
|
33
|
+
- reading and writing workbooks, worksheets, cells, ranges, rows, columns
|
34
|
+
- naming, adding, and copying ranges and worksheets
|
35
|
+
- references to other Excel libraries
|
36
|
+
- console for interactive mode
|
34
37
|
|
35
38
|
== Requirements
|
36
39
|
|
@@ -53,17 +56,11 @@ RobustExcelOle can be used either for scripts
|
|
53
56
|
require 'robust_excel_ole'
|
54
57
|
include RobustExcelOle
|
55
58
|
|
56
|
-
or as a console.
|
57
|
-
|
58
|
-
gem env
|
59
|
-
|
60
|
-
and go into the path of the gem 'robust_excel_ole'. There you start the console via the command
|
59
|
+
or as a console. You can start the console via the command
|
61
60
|
|
62
61
|
reo
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
The call of the console will include RobustExcelOle for you.
|
63
|
+
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.
|
67
64
|
|
68
65
|
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.
|
69
66
|
|
data/bin/jreo
CHANGED
@@ -1,3 +1,74 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env jruby
|
2
|
+
# -*- mode: jruby -*-
|
2
3
|
|
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
|
data/bin/reo
CHANGED
@@ -1,3 +1,61 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env jruby
|
2
|
+
# -*- mode: jruby -*-
|
2
3
|
|
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
|
+
|
13
|
+
ARGV.concat ['--readline',
|
14
|
+
'--prompt-mode',
|
15
|
+
'simple']
|
16
|
+
|
17
|
+
# 250 entries in the list
|
18
|
+
IRB.conf[:SAVE_HISTORY] = 250
|
19
|
+
|
20
|
+
# Store results in home directory with specified file name
|
21
|
+
# IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
|
22
|
+
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.reo-history"
|
23
|
+
|
24
|
+
# @private
|
25
|
+
module Readline
|
26
|
+
module Hist
|
27
|
+
LOG = IRB.conf[:HISTORY_FILE]
|
28
|
+
# LOG = "#{ENV['HOME']}/.irb-history"
|
29
|
+
|
30
|
+
def self.write_log(line)
|
31
|
+
File.open(LOG, 'ab') do |f|
|
32
|
+
f << "#{line}
|
33
|
+
"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.start_session_log
|
38
|
+
timestamp = proc { Time.now.strftime('%Y-%m-%d, %H:%M:%S') }
|
39
|
+
# @private
|
40
|
+
class <<timestamp
|
41
|
+
alias_method :to_s, :call
|
42
|
+
end
|
43
|
+
write_log("###### session start: #{timestamp}")
|
44
|
+
at_exit { write_log("###### session stop: #{timestamp}") }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
alias old_readline readline
|
49
|
+
def readline(*args)
|
50
|
+
ln = old_readline(*args)
|
51
|
+
begin
|
52
|
+
Hist.write_log(ln)
|
53
|
+
rescue StandardError
|
54
|
+
end
|
55
|
+
ln
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
Readline::Hist.start_session_log
|
60
|
+
puts 'REO console started'
|
61
|
+
IRB.start
|
data/docs/README_ranges.rdoc
CHANGED
data/docs/README_sheet.rdoc
CHANGED
@@ -124,7 +124,8 @@ Within a row or column range you can access a certain cell.
|
|
124
124
|
|
125
125
|
=== Deleting and inserting rows and columns
|
126
126
|
|
127
|
-
|
127
|
+
For the following standard tasks no RobustExcelOle commands are provided, but VBA methods can be used.
|
128
|
+
Here are some examples:
|
128
129
|
|
129
130
|
row1 = worksheet.row_range(1)
|
130
131
|
row1.Delete
|
data/lib/reo_console.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
require '../robust_excel_ole/lib/robust_excel_ole'
|
2
2
|
include REO
|
3
3
|
# include RobustExcelOle
|
4
4
|
include General
|
5
5
|
|
6
|
+
require 'irb'
|
6
7
|
require 'irb/completion'
|
7
8
|
require 'irb/ext/save-history'
|
8
9
|
|
@@ -17,6 +18,10 @@ IRB.conf[:SAVE_HISTORY] = 250
|
|
17
18
|
# IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
|
18
19
|
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.reo-history"
|
19
20
|
|
21
|
+
IRB.conf[:PROMPT_MODE] = 'ert' #:SIMPLE
|
22
|
+
#IRB.conf[:USE_READLINE] = true
|
23
|
+
#IRB.conf[:AUTO_INDENT] = true
|
24
|
+
|
20
25
|
# @private
|
21
26
|
module Readline
|
22
27
|
module Hist
|
@@ -54,3 +59,5 @@ end
|
|
54
59
|
|
55
60
|
Readline::Hist.start_session_log
|
56
61
|
puts 'REO console started'
|
62
|
+
IRB.start
|
63
|
+
|
data/reo.bat
CHANGED
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.19'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- traths
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|