robust_excel_ole 1.18.4 → 1.19

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: cf35f3fb5a6a208f408a41bfb4dd72424030458ecbbf51590e457ce63cdaef55
4
- data.tar.gz: 04357d405ae6d393480457ffb4d2e21fde6cd8b87a123be6467f1389c83d6727
3
+ metadata.gz: c5ff7771ae8a35d2cf47dce37e92a9d4d720148faa91eb37dc2342b1239f7d0a
4
+ data.tar.gz: 4d50eb99f297d38a60845eca2550a36ae2734694b538c52eb23052a9e9db0077
5
5
  SHA512:
6
- metadata.gz: 8702bb3c42465b1c3c04ccb248fdc6d17f415193fba5ef12d05820517420970b8da04f042de4a562390e21ee8b1f90325eb5826bd012d3aeea0ca3a8640292e5
7
- data.tar.gz: 84ce7e871aeb7005441832c97ef68e67da3ef46e20c024ae3c7a51dcef946de13d89902e6a40c8173bd486d9c2a44a9db2e3f8139c2ed0501133b503066821af
6
+ metadata.gz: 2ccd9358b7d0ca576c8120e249c7af4122c4040f51357efc339536f93cde6d8a6b9a2bb32071382f5c5d8ddc3f084920831eda36df0c1a8ed9698972cea9d516
7
+ data.tar.gz: f1b813c71610b01d3bfd7e70245a52b02522910b2d0cbd6a9742825c06a131f47bc7f9310c59749b0caf881fef6d8a8bc64336f709ba2104a4f78bff844a44b6
@@ -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
- == Feature list
17
+ == Features
18
+
19
+ RobustExcelOle supports
18
20
 
19
21
  - opening and processing workbooks across various Excel instances
20
- - reading and writing workbooks (cells and ranges)
21
- - reopening and unobtrusively opening workbooks
22
- - convenient methods for standard tasks (like opening, reading, writing, closing, saving workbooks, naming, adding, and copying ranges and worksheets)
23
- - dealing with various cases of Excel and user behaviour, e.g. managing conflicts when opening workbooks (e.g. blocking or unsaved workbooks),
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
- - various workbook formats, e.g. .xlsx, .xls, .xlsm are supported
27
- - library references are supported
28
- - console for convenient usage
29
-
30
- == What's new?
31
-
32
- - removing methods to operate on ranges directly from an Excel instance. However, you can use the method Excel.active_workbook to do so.
33
- See ChangeLogs.
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. If you want to use RobustExcelOle as a console, you go (using 'cd') into the gem path that you find with help of
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
- If you don't want to use a version manager to switch between ruby and jruby, you can apply the command +reo+ when using ruby, and +jreo+ when using jruby.
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
- @echo off
1
+ #!/usr/bin/env jruby
2
+ # -*- mode: jruby -*-
2
3
 
3
- jirb -f -r ../lib/robust_excel_ole -r ../lib/jreo_console.rb
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
- @echo off
1
+ #!/usr/bin/env jruby
2
+ # -*- mode: jruby -*-
2
3
 
3
- irb -f -r ../lib/robust_excel_ole -r ../lib/reo_console.rb
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
@@ -67,7 +67,7 @@ or
67
67
 
68
68
  Now we copy the range. With help of VBA methods you would do
69
69
 
70
- range.Copy(:destination => sheet.range([4..6,5..8]).ole_range)
70
+ range.Copy(:destination => sheet.range([4,5]).ole_range)
71
71
 
72
72
  or with help of RobustExcelOle
73
73
 
@@ -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
- As mentioned above, VBA methods can be applied to the RobustExcelOle objects, e.g. when deleting or inserting rows and columns.
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
@@ -1,8 +1,9 @@
1
- # require '../robust_excel_ole/lib/robust_excel_ole'
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
+
@@ -1,3 +1,3 @@
1
1
  module RobustExcelOle
2
- VERSION = "1.18.4"
2
+ VERSION = "1.19"
3
3
  end
data/reo.bat CHANGED
@@ -1,3 +1,5 @@
1
1
  @echo off
2
2
 
3
- irb -f -r ./lib/robust_excel_ole -r ./lib/reo_console.rb
3
+ irb -f -r ./lib/reo_console.rb
4
+
5
+ #irb -f -r ./lib/robust_excel_ole -r ./lib/reo_console.rb
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.18.4
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-09 00:00:00.000000000 Z
11
+ date: 2020-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec