robust_excel_ole 1.19.2 → 1.19.8

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: 6ba39d6930c0c0ba0391bd5a75bcbee0d5cfc33e8459ea0f45b383988a8b1621
4
- data.tar.gz: dc710437e2290d5caa21866349fe85d05752c7c5d2649010f150dce588f9ab90
3
+ metadata.gz: abc534eb60f4629b95641fec4dc39d4c7a5982f4370a776befc06ada55d93b30
4
+ data.tar.gz: 5c808790af7a4387ea4cd919b5f49ab3ab3961df035890ed077f18b84f23b9d9
5
5
  SHA512:
6
- metadata.gz: 7b227106e853e8395300f9c76886e7cf0d93e55ca52902eed745f0ca23874ff9af0c34214362c07da448c29b3e68a0817684cdc75b911b3d33711664915b1f4f
7
- data.tar.gz: aee9dac89259c407dd9b8f8ab5035af84bdc3c5561b40be6075af2602f590adcad0e45f945ff72ed5a4bf229a9b29c75e3cc16bf3d961f3d2ad669ce8a2e054c
6
+ metadata.gz: 2a20f134381fbc7cbaae809d315b0fcbbaabca56722f7cd4d81129e0d03824129e0de5314aa28dd3b6dc31dd844b92b8a3269054df34dc46031ed49db7c9c625
7
+ data.tar.gz: cb6e80d120c39a119e5424fe9b2d2cdcc5d5b71281bd53f56ee915a7deed14a6ef68be83011d3178d36f90974ba8df3d64b723454a34cc8ce137266d1a3f0238
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 ../lib/reo_console.rb
data/bin/reo CHANGED
@@ -1,21 +1,4 @@
1
- require 'pry'
2
- require 'robust_excel_ole'
3
- include REO
4
- # include RobustExcelOle
5
- include General
6
1
 
7
- puts 'REO console started'
8
- puts
2
+ @echo off
9
3
 
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
4
+ ruby ../lib/reo_console.rb
@@ -1,62 +1,20 @@
1
- require '../robust_excel_ole/lib/robust_excel_ole'
1
+ require 'pry'
2
+
2
3
  include REO
3
- # include RobustExcelOle
4
4
  include General
5
5
 
6
- require 'irb'
7
- require 'irb/completion'
8
- require 'irb/ext/save-history'
9
-
10
- ARGV.concat ['--readline',
11
- '--prompt-mode',
12
- 'simple']
13
-
14
- # 250 entries in the list
15
- IRB.conf[:SAVE_HISTORY] = 250
16
-
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
6
+ puts 'REO console started'
7
+ puts
8
+
9
+ # some pry configuration
10
+ Pry.config.windows_console_warning = false
11
+ Pry.config.history.should_save = true
12
+ Pry.config.color = false
13
+ #Pry.editor = 'notepad' # 'subl', 'vi'
14
+ #Pry.config.prompt =
15
+ # [
16
+ # ->(_obj, _nest_level, _) { ">> " },
17
+ # ->(*) { " " }
18
+ # ]
19
+
20
+ pry
@@ -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.2"
2
+ VERSION = "1.19.8"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robust_excel_ole
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.2
4
+ version: 1.19.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - traths
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
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,9 +48,8 @@ description: "RobustExcelOle helps controlling Excel. \n This
34
48
  email:
35
49
  - Thomas.Raths@gmx.net
36
50
  executables:
37
- - jreo.bat
51
+ - jreo
38
52
  - reo
39
- - reo.bat
40
53
  extensions: []
41
54
  extra_rdoc_files:
42
55
  - README.rdoc
@@ -65,9 +78,8 @@ files:
65
78
  - benchmarking/sample_excel_files/xlsx_500_rows.xlsx
66
79
  - benchmarking/simple_xlsx_reader_example.rb
67
80
  - benchmarking/spreadsheet_example.rb
68
- - bin/jreo.bat
81
+ - bin/jreo
69
82
  - bin/reo
70
- - bin/reo.bat
71
83
  - docs/README_excel.rdoc
72
84
  - docs/README_open.rdoc
73
85
  - docs/README_ranges.rdoc
@@ -101,7 +113,6 @@ files:
101
113
  - examples/open_save_close/example_simple.rb
102
114
  - examples/open_save_close/example_unobtrusively.rb
103
115
  - jreo.bat
104
- - lib/jreo_console.rb
105
116
  - lib/reo_console.rb
106
117
  - lib/robust_excel_ole.rb
107
118
  - lib/robust_excel_ole/address_tool.rb
@@ -121,7 +132,6 @@ files:
121
132
  - lib/robust_excel_ole/workbook.rb
122
133
  - lib/robust_excel_ole/worksheet.rb
123
134
  - lib/spec_helper.rb
124
- - reo.bat
125
135
  - robust_excel_ole.gemspec
126
136
  - spec/address_tool_spec.rb
127
137
  - spec/base_spec.rb
@@ -1,4 +0,0 @@
1
-
2
- @echo off
3
-
4
- jruby reo
@@ -1,4 +0,0 @@
1
-
2
- @echo off
3
-
4
- ruby reo
@@ -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