robust_excel_ole 1.19.6 → 1.19.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b949aa2fed26a88132ccdca420cc2f313944e5229859baf28868dd9b4ff877d
4
- data.tar.gz: 7af761e4080a48e9191b0f430c32abc5af63ec9415fb345253e9aa28b68c8a72
3
+ metadata.gz: 3a834f5ca858ecdc71fee9cc5a6b6d146755910c5dbc64720465540cc1e964d9
4
+ data.tar.gz: 377ef0d7047756df9a64384c25d6cc13e40454a428ae8302b7bac73a0dacd0f2
5
5
  SHA512:
6
- metadata.gz: 1a79bf3958fbd615cdb97e7310e6ef9d9b64f37e1e130eea5f1a1c21b9444e49444ebfcf794d492b6f99b019716150d2c2d4b59db4b681c92ea71ed129a044cf
7
- data.tar.gz: 482eaaaaa91608e0da49a241e34489e0717226f9ef123bd81785f2e1187fd67f5cea5aff9ff0e885a2fe7b28c0abb55aeaaed2879f67403d5f4c4b01e109203d
6
+ metadata.gz: cdbe008783fb6c781a9e6b20408fc820f32e8308e501c86f025bf22f43c50b8da5f595766e217b4c295e447adc89905d9ebcd89533883257d621e6688eb4a13c
7
+ data.tar.gz: 3e5a3c904854aca246f269be56eba6c19394900dccee6d6a08dda702a4ede2605ff62cd14b3687921e8b13275fc33e5141859ca4b3fed60aa4dd819a27f0879b
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env jruby
2
+ # -*- jruby -*-
3
+
4
+ require 'pry'
5
+ require '../lib/robust_excel_ole'
6
+
7
+ include REO
8
+ include General
9
+
10
+ puts 'REO console started'
11
+ puts
12
+
13
+ # some pry configuration
14
+ Pry.config.windows_console_warning = false
15
+ Pry.config.history.should_save = true
16
+ Pry.config.color = false
17
+ #Pry.editor = 'notepad' # 'subl', 'vi'
18
+ #Pry.config.prompt =
19
+ # [
20
+ # ->(_obj, _nest_level, _) { ">> " },
21
+ # ->(*) { " " }
22
+ # ]
23
+
24
+ pry
data/bin/reo ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- ruby -*-
3
+
4
+ require 'pry'
5
+ require '../lib/robust_excel_ole'
6
+
7
+ include REO
8
+ include General
9
+
10
+ puts 'REO console started'
11
+ puts
12
+
13
+ # some pry configuration
14
+ Pry.config.windows_console_warning = false
15
+ Pry.config.history.should_save = true
16
+ Pry.config.color = false
17
+ #Pry.editor = 'notepad' # 'subl', 'vi'
18
+ #Pry.config.prompt =
19
+ # [
20
+ # ->(_obj, _nest_level, _) { ">> " },
21
+ # ->(*) { " " }
22
+ # ]
23
+
24
+ pry
@@ -1,16 +1,16 @@
1
1
  require 'pry'
2
2
  require 'robust_excel_ole'
3
+
3
4
  include REO
4
- # include RobustExcelOle
5
5
  include General
6
6
 
7
7
  puts 'REO console started'
8
8
  puts
9
9
 
10
-
11
10
  # some pry configuration
12
11
  Pry.config.windows_console_warning = false
13
12
  Pry.config.history.should_save = true
13
+ Pry.config.color = false
14
14
  #Pry.editor = 'notepad' # 'subl', 'vi'
15
15
  #Pry.config.prompt =
16
16
  # [
@@ -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,48 @@ module RobustExcelOle
96
98
 
97
99
  end
98
100
 
101
+ def column_names
102
+ @ole_table.HeaderRowRange.Value.first
103
+ end
104
+
105
+ def insert_column(position = 1, column_name = "")
106
+ @ole_table.ListColumns.Add
107
+ rename_column(position,column_name)
108
+ end
109
+
110
+ def delete_column(column_name_or_number)
111
+ @ole_table.ListColumns.Item(row_number).Delete
112
+ end
113
+
114
+ # insert row below row_number
115
+ def insert_row(position = 1)
116
+ @ole_table.ListRows.Add(position)
117
+ end
118
+
119
+ def delete_row(row_number)
120
+ @ole_table.ListRows.Item(row_number).Delete
121
+ end
122
+
123
+ def rename_column(name_or_number, new_name)
124
+ column_names = @ole_table.HeaderRowRange.Value.first
125
+ position = name_or_number.respond_to?(:abs) ? name_or_number : (column_names.index(name_or_number) + 1)
126
+ column_names[position-1] = new_name
127
+ @ole_table.HeaderRowRange.Value = [column_names]
128
+ new_name
129
+ end
130
+
131
+ # @private
132
+ def to_s
133
+ @ole_table.Name.to_s
134
+ end
135
+
136
+ # @private
137
+ def inspect
138
+ "#<ListObject:" + "#{@ole_table.Name}" +
139
+ " size:#{@ole_table.ListRows.Count}x#{@ole_table.ListColumns.Count}" +
140
+ " worksheet:#{@ole_table.Parent.Name}" + " workbook:#{@ole_table.Parent.Parent.Name}" + ">"
141
+ end
142
+
99
143
  private
100
144
 
101
145
  def method_missing(name, *args)
@@ -1,3 +1,3 @@
1
1
  module RobustExcelOle
2
- VERSION = "1.19.6"
2
+ VERSION = "1.19.11"
3
3
  end
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.19.6
4
+ version: 1.19.11
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-12 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -47,7 +47,9 @@ description: "RobustExcelOle helps controlling Excel. \n This
47
47
  are supported.\n It runs on Windows and uses the win32ole library."
48
48
  email:
49
49
  - Thomas.Raths@gmx.net
50
- executables: []
50
+ executables:
51
+ - jreo
52
+ - reo
51
53
  extensions: []
52
54
  extra_rdoc_files:
53
55
  - README.rdoc
@@ -76,6 +78,8 @@ files:
76
78
  - benchmarking/sample_excel_files/xlsx_500_rows.xlsx
77
79
  - benchmarking/simple_xlsx_reader_example.rb
78
80
  - benchmarking/spreadsheet_example.rb
81
+ - bin/jreo
82
+ - bin/reo
79
83
  - docs/README_excel.rdoc
80
84
  - docs/README_open.rdoc
81
85
  - docs/README_ranges.rdoc
@@ -128,7 +132,6 @@ files:
128
132
  - lib/robust_excel_ole/workbook.rb
129
133
  - lib/robust_excel_ole/worksheet.rb
130
134
  - lib/spec_helper.rb
131
- - reo.bat
132
135
  - robust_excel_ole.gemspec
133
136
  - spec/address_tool_spec.rb
134
137
  - spec/base_spec.rb
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