robust_excel_ole 1.7 → 1.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
  SHA1:
3
- metadata.gz: 395fcac0e9c786c579758cb0b93c02d2e1ae0226
4
- data.tar.gz: e1d901e048a027c84fd75a8154c413340db3a61b
3
+ metadata.gz: 2bdbfacd559753a2e1126c1ff1a28520a6c6cd57
4
+ data.tar.gz: a5cdf8708f6862cda1630fc9152f65a498e446b0
5
5
  SHA512:
6
- metadata.gz: c8c91c3d9e2e2074abfa6dd56841aac9cc76f12a20943bd202e9ee584753e659d1402cc08ea4b30999be162680a710d82cdc838c4dfeb4046e7ead79955a91d6
7
- data.tar.gz: 5af76ba942addc3b31eba65c78fd8db1a75722f805490af36ba7f86b843048c68c703db6f289dce40820ab185a094606be8c107c2ec8d7848faa25da83b11ead
6
+ metadata.gz: 830ff59640559e837e7d15daf2ee5ec18c734aaebaba3a56189ea837f755deb8d4e7f7bf06aa01365ea59f633837ef4faa27bf1951a6af0f7ba834c083fd0e79
7
+ data.tar.gz: 4aea6e53ba40c1c14a26ce2bef43591e0a39194d65a1b90b4acc6623206bfad9796b8a69351d35aa7f99bca2201f8b23eac55a951f0d23b42a34f9f93fd91b03
data/.yardopts CHANGED
@@ -1 +1,2 @@
1
- --legacy
1
+ --legacy
2
+ --no-private
@@ -17,8 +17,9 @@ IRB.conf[:SAVE_HISTORY] = 250
17
17
  # IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
18
18
  IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.reo-history"
19
19
 
20
- module Readline # :nodoc:
21
- module Hist # :nodoc:
20
+ # @private
21
+ module Readline
22
+ module Hist
22
23
  LOG = IRB.conf[:HISTORY_FILE]
23
24
  # LOG = "#{ENV['HOME']}/.irb-history"
24
25
 
@@ -31,7 +32,8 @@ module Readline # :nodoc:
31
32
 
32
33
  def self.start_session_log
33
34
  timestamp = proc { Time.now.strftime('%Y-%m-%d, %H:%M:%S') }
34
- class <<timestamp # :nodoc:
35
+ # @private
36
+ class <<timestamp
35
37
  alias_method :to_s, :call
36
38
  end
37
39
  write_log("###### session start: #{timestamp}")
@@ -73,7 +73,8 @@ module RobustExcelOle
73
73
  end
74
74
 
75
75
  # creates and returns a separate Excel instance with Visible and DisplayAlerts equal false
76
- def hidden_excel # :nodoc:
76
+ # @private
77
+ def hidden_excel
77
78
  unless @hidden_excel_instance && @hidden_excel_instance.weakref_alive? && @hidden_excel_instance.__getobj__.alive?
78
79
  @hidden_excel_instance = WeakRef.new(Excel.create)
79
80
  end
@@ -95,16 +96,18 @@ module RobustExcelOle
95
96
  result
96
97
  end
97
98
 
98
- private
99
+ private
99
100
 
100
- def try_hidden_excel # :nodoc:
101
+ # @private
102
+ def try_hidden_excel
101
103
  @hidden_excel_instance.__getobj__ if @hidden_excel_instance && @hidden_excel_instance.weakref_alive? && @hidden_excel_instance.__getobj__.alive?
102
104
  end
103
105
 
104
- public
106
+ public
105
107
 
106
108
  # prints the book store
107
- def print # :nodoc:
109
+ # @private
110
+ def print
108
111
  # trace "@filename2books:"
109
112
  if @filename2books
110
113
  @filename2books.each do |_filename,books|
@@ -126,7 +129,8 @@ module RobustExcelOle
126
129
  end
127
130
  end
128
131
 
129
- class BookstoreError < WIN32OLERuntimeError # :nodoc:
132
+ # @private
133
+ class BookstoreError < WIN32OLERuntimeError
130
134
  end
131
135
 
132
136
  end
@@ -16,7 +16,8 @@ module RobustExcelOle
16
16
  self.Value
17
17
  end
18
18
 
19
- def method_missing(name, *args) # :nodoc:
19
+ # @private
20
+ def method_missing(name, *args)
20
21
  #if name.to_s[0,1] =~ /[A-Z]/
21
22
  begin
22
23
  @cell.send(name, *args)
@@ -11,7 +11,8 @@ module RobustExcelOle
11
11
  @conv_to_win32_path =
12
12
  Win32API.new('cygwin1.dll', 'cygwin_conv_to_win32_path', 'PP', 'I')
13
13
 
14
- def cygpath(options, path) # :nodoc:
14
+ # @private
15
+ def cygpath(options, path)
15
16
  absolute = shortname = false
16
17
  func = nil
17
18
  options.delete(" \t-").chars do |opt|
@@ -140,7 +140,8 @@ module RobustExcelOle
140
140
  # returns a Win32OLE object that represents a Excel instance to which Excel connects
141
141
  # connects to the first opened Excel instance
142
142
  # if this Excel instance is being closed, then Excel creates a new Excel instance
143
- def self.current_excel # :nodoc:
143
+ # @private
144
+ def self.current_excel
144
145
  result = begin
145
146
  WIN32OLE.connect('Excel.Application')
146
147
  rescue
@@ -352,7 +353,8 @@ module RobustExcelOle
352
353
  end
353
354
 
354
355
  # frees all OLE objects in the object space
355
- def self.free_all_ole_objects # :nodoc:
356
+ # @private
357
+ def self.free_all_ole_objects
356
358
  anz_objekte = 0
357
359
  ObjectSpace.each_object(WIN32OLE) do |o|
358
360
  anz_objekte += 1
@@ -430,11 +432,13 @@ module RobustExcelOle
430
432
  result
431
433
  end
432
434
 
433
- def excel # :nodoc:
435
+ # @private
436
+ def excel
434
437
  self
435
438
  end
436
439
 
437
- def self.hwnd2excel(hwnd) # :nodoc:
440
+ # @private
441
+ def self.hwnd2excel(hwnd)
438
442
  excel_weakref = @@hwnd2excel[hwnd]
439
443
  if excel_weakref
440
444
  if excel_weakref.weakref_alive?
@@ -451,13 +455,15 @@ module RobustExcelOle
451
455
  end
452
456
  end
453
457
 
454
- def hwnd # :nodoc:
458
+ # @private
459
+ def hwnd
455
460
  self.Hwnd
456
461
  rescue
457
462
  nil
458
463
  end
459
464
 
460
- def self.print_hwnd2excel # :nodoc:
465
+ # @private
466
+ def self.print_hwnd2excel
461
467
  @@hwnd2excel.each do |hwnd,wr_excel|
462
468
  excel_string = (wr_excel.weakref_alive? ? wr_excel.__getobj__.to_s : 'weakref not alive')
463
469
  printf("hwnd: %8i => excel: %s\n", hwnd, excel_string)
@@ -480,7 +486,8 @@ module RobustExcelOle
480
486
  end
481
487
 
482
488
  # returns unsaved workbooks in known (not opened by user) Excel instances
483
- def self.unsaved_known_workbooks # :nodoc:
489
+ # @private
490
+ def self.unsaved_known_workbooks
484
491
  result = []
485
492
  @@hwnd2excel.each do |_hwnd,wr_excel|
486
493
  excel = wr_excel.__getobj__ if wr_excel.weakref_alive?
@@ -489,12 +496,14 @@ module RobustExcelOle
489
496
  result
490
497
  end
491
498
 
492
- def print_workbooks # :nodoc:
499
+ # @private
500
+ def print_workbooks
493
501
  self.Workbooks.each { |w| trace "#{w.Name} #{w}" }
494
502
  end
495
503
 
496
504
  # generates, saves, and closes empty workbook
497
- def generate_workbook file_name # :nodoc:
505
+ # @private
506
+ def generate_workbook file_name
498
507
  raise FileNameNotGiven, 'filename is nil' if file_name.nil?
499
508
 
500
509
  self.Workbooks.Add
@@ -547,20 +556,19 @@ module RobustExcelOle
547
556
  # retains the saved-status of the workbooks when set to manual
548
557
  def calculation= calculation_mode
549
558
  return if calculation_mode.nil?
550
-
551
559
  @calculation = calculation_mode
552
560
  calc_mode_changable = @ole_excel.Workbooks.Count > 0 && @ole_excel.Calculation.is_a?(Integer)
553
561
  if calc_mode_changable
554
- if calculation_mode == :manual
562
+ #if calculation_mode == :manual
555
563
  saved = []
556
564
  (1..@ole_excel.Workbooks.Count).each { |i| saved << @ole_excel.Workbooks(i).Saved }
557
- end
565
+ #end
558
566
  @ole_excel.CalculateBeforeSave = false
559
567
  @ole_excel.Calculation =
560
568
  calculation_mode == :automatic ? XlCalculationAutomatic : XlCalculationManual
561
- if calculation_mode == :manual
569
+ #if calculation_mode == :manual
562
570
  (1..@ole_excel.Workbooks.Count).each { |i| @ole_excel.Workbooks(i).Saved = true if saved[i - 1] }
563
- end
571
+ #end
564
572
  end
565
573
  end
566
574
 
@@ -636,15 +644,18 @@ module RobustExcelOle
636
644
  set_namevalue_glob(name,value, :color => 42) # 42 - aqua-marin, 7-green
637
645
  end
638
646
 
639
- def to_s # :nodoc:
647
+ # @private
648
+ def to_s
640
649
  '#<Excel: ' + hwnd.to_s + ('not alive' unless alive?).to_s + '>'
641
650
  end
642
651
 
643
- def inspect # :nodoc:
652
+ # @private
653
+ def inspect
644
654
  to_s
645
655
  end
646
656
 
647
- def self.workbook_class # :nodoc:
657
+ # @private
658
+ def self.workbook_class
648
659
  @workbook_class ||= begin
649
660
  module_name = parent_name
650
661
  "#{module_name}::Workbook".constantize
@@ -653,15 +664,17 @@ module RobustExcelOle
653
664
  end
654
665
  end
655
666
 
656
- def workbook_class # :nodoc:
667
+ # @private
668
+ def workbook_class
657
669
  self.class.workbook_class
658
670
  end
659
671
 
660
672
  include MethodHelpers
661
673
 
662
- private
674
+ private
663
675
 
664
- def method_missing(name, *args) # :nodoc:
676
+ # @private
677
+ def method_missing(name, *args)
665
678
  if name.to_s[0,1] =~ /[A-Z]/
666
679
  begin
667
680
  raise ObjectNotAlive, 'method missing: Excel not alive' unless alive?
@@ -2,19 +2,22 @@
2
2
 
3
3
  module General
4
4
 
5
- def absolute_path(file) # :nodoc:
5
+ # @private
6
+ def absolute_path(file)
6
7
  file = File.expand_path(file)
7
8
  file = RobustExcelOle::Cygwin.cygpath('-w', file) if RUBY_PLATFORM =~ /cygwin/
8
9
  WIN32OLE.new('Scripting.FileSystemObject').GetAbsolutePathName(file)
9
10
  end
10
11
 
11
- def canonize(filename) # :nodoc:
12
+ # @private
13
+ def canonize(filename)
12
14
  raise TypeREOError, "No string given to canonize, but #{filename.inspect}" unless filename.is_a?(String)
13
15
 
14
16
  normalize(filename).downcase
15
17
  end
16
18
 
17
- def normalize(path) # :nodoc:
19
+ # @private
20
+ def normalize(path)
18
21
  path = path.gsub('/./', '/') + '/'
19
22
  path = path.gsub(/[\/\\]+/, '/')
20
23
  nil while path.gsub!(/(\/|^)(?!\.\.?)([^\/]+)\/\.\.\//, '\1')
@@ -24,11 +27,13 @@ module General
24
27
 
25
28
  module_function :absolute_path, :canonize, :normalize
26
29
 
27
- class VBAMethodMissingError < RuntimeError # :nodoc:
30
+ # @private
31
+ class VBAMethodMissingError < RuntimeError
28
32
  end
29
33
 
30
34
  end
31
35
 
36
+ # @private
32
37
  class WIN32OLE
33
38
  # promoting WIN32OLE objects to RobustExcelOle objects
34
39
  def to_reo
@@ -43,7 +48,8 @@ class WIN32OLE
43
48
  end
44
49
  end
45
50
 
46
- class ::String # :nodoc:
51
+ # @private
52
+ class ::String
47
53
  def / path_part
48
54
  if empty?
49
55
  path_part
@@ -106,7 +112,8 @@ class ::String # :nodoc:
106
112
  end
107
113
 
108
114
  # taken from http://api.rubyonrails.org/v2.3.8/classes/ActiveSupport/CoreExtensions/Module.html#M000806
109
- class Module # :nodoc:
115
+ # @private
116
+ class Module
110
117
  def parent_name
111
118
  unless defined? @parent_name
112
119
  @parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil
@@ -121,7 +128,8 @@ end
121
128
 
122
129
  module MethodHelpers
123
130
 
124
- def respond_to?(meth_name, include_private = false) # :nodoc:
131
+ # @private
132
+ def respond_to?(meth_name, include_private = false)
125
133
  if alive?
126
134
  methods.include?(meth_name.to_s)
127
135
  else
@@ -129,7 +137,8 @@ module MethodHelpers
129
137
  end
130
138
  end
131
139
 
132
- def methods # :nodoc:
140
+ # @private
141
+ def methods
133
142
  if alive?
134
143
  (super.map { |m| m.to_s } + ole_object.ole_methods.map { |m| m.to_s }).uniq.select { |m| m =~ /^(?!\_)/ }.sort
135
144
  else
@@ -165,34 +165,8 @@ module RobustExcelOle
165
165
  end
166
166
  end
167
167
 
168
- =begin
169
- # copies a range
170
- # @params [Address] address of the destination range
171
- # @options [Worksheet] the worksheet in which to copy
172
- def copy(address, sheet = :__not_provided, third_argument_deprecated = :__not_provided)
173
- if third_argument_deprecated != :__not_provided
174
- address = [address,sheet]
175
- sheet = third_argument_deprecated
176
- end
177
- address = Address.new(address)
178
- sheet = @worksheet if sheet == :__not_provided
179
- destination_range = sheet.range([address.rows.min..address.rows.max,
180
- address.columns.min..address.columns.max]).ole_range
181
- if sheet.workbook.excel == @worksheet.workbook.excel
182
- begin
183
- self.Copy(:destination => destination_range)
184
- rescue WIN32OLERuntimeError
185
- raise RangeNotCopied, 'cannot copy range'
186
- end
187
- else
188
- #self.Select
189
- self.Copy
190
- sheet.Paste(:destination => destination_range)
191
- end
192
- end
193
- =end
194
-
195
- def self.worksheet_class # :nodoc:
168
+ # @private
169
+ def self.worksheet_class
196
170
  @worksheet_class ||= begin
197
171
  module_name = parent_name
198
172
  "#{module_name}::Worksheet".constantize
@@ -201,13 +175,15 @@ module RobustExcelOle
201
175
  end
202
176
  end
203
177
 
204
- def worksheet_class # :nodoc:
178
+ # @private
179
+ def worksheet_class
205
180
  self.class.worksheet_class
206
181
  end
207
182
 
208
- private
183
+ private
209
184
 
210
- def method_missing(name, *args) # :nodoc:
185
+ # @private
186
+ def method_missing(name, *args)
211
187
  #if name.to_s[0,1] =~ /[A-Z]/
212
188
  begin
213
189
  @ole_range.send(name, *args)
@@ -8,88 +8,116 @@ File.delete REO_LOG_FILE rescue nil
8
8
 
9
9
  module RobustExcelOle
10
10
 
11
- class REOError < RuntimeError # :nodoc:
11
+ # @private
12
+ class REOError < RuntimeError
12
13
  end
13
14
 
14
- class ExcelREOError < REOError # :nodoc:
15
+ # @private
16
+ class ExcelREOError < REOError
15
17
  end
16
18
 
17
- class WorkbookREOError < REOError # :nodoc:
19
+ # @private
20
+ class WorkbookREOError < REOError
18
21
  end
19
22
 
20
- class SheetREOError < REOError # :nodoc:
23
+ # @private
24
+ class SheetREOError < REOError
21
25
  end
22
26
 
23
- class FileREOError < REOError # :nodoc:
27
+ # @private
28
+ class FileREOError < REOError
24
29
  end
25
30
 
26
- class NamesREOError < REOError # :nodoc:
31
+ # @private
32
+ class NamesREOError < REOError
27
33
  end
28
34
 
29
- class MiscREOError < REOError # :nodoc:
35
+ # @private
36
+ class MiscREOError < REOError
30
37
  end
31
38
 
32
- class ExcelDamaged < ExcelREOError # :nodoc:
39
+ # @private
40
+ class ExcelDamaged < ExcelREOError
33
41
  end
34
42
 
35
- class UnsavedWorkbooks < ExcelREOError # :nodoc:
43
+ # @private
44
+ class UnsavedWorkbooks < ExcelREOError
36
45
  end
37
46
 
38
- class WorkbookBlocked < WorkbookREOError # :nodoc:
47
+ # @private
48
+ class WorkbookBlocked < WorkbookREOError
39
49
  end
40
50
 
41
- class WorkbookNotSaved < WorkbookREOError # :nodoc:
51
+ # @private
52
+ class WorkbookNotSaved < WorkbookREOError
42
53
  end
43
54
 
44
- class WorkbookReadOnly < WorkbookREOError # :nodoc:
55
+ # @private
56
+ class WorkbookReadOnly < WorkbookREOError
45
57
  end
46
58
 
47
- class WorkbookBeingUsed < WorkbookREOError # :nodoc:
59
+ # @private
60
+ class WorkbookBeingUsed < WorkbookREOError
48
61
  end
49
62
 
50
- class FileNotFound < FileREOError # :nodoc:
63
+ # @private
64
+ class FileNotFound < FileREOError
51
65
  end
52
66
 
53
- class FileNameNotGiven < FileREOError # :nodoc:
67
+ # @private
68
+ class FileNameNotGiven < FileREOError
54
69
  end
55
70
 
56
- class FileAlreadyExists < FileREOError # :nodoc:
71
+ # @private
72
+ class FileAlreadyExists < FileREOError
57
73
  end
58
74
 
59
- class NameNotFound < NamesREOError # :nodoc:
75
+ # @private
76
+ class NameNotFound < NamesREOError
60
77
  end
61
78
 
62
- class NameAlreadyExists < NamesREOError # :nodoc:
79
+ # @private
80
+ class NameAlreadyExists < NamesREOError
63
81
  end
64
82
 
65
- class RangeNotEvaluatable < MiscREOError # :nodoc:
83
+ # @private
84
+ class RangeNotEvaluatable < MiscREOError
66
85
  end
67
86
 
68
- class RangeNotCreated < MiscREOError # :nodoc:
87
+ # @private
88
+ class RangeNotCreated < MiscREOError
69
89
  end
70
90
 
71
- class RangeNotCopied < MiscREOError # :nodoc:
91
+ # @private
92
+ class RangeNotCopied < MiscREOError
72
93
  end
73
94
 
74
- class OptionInvalid < MiscREOError # :nodoc:
95
+ # @private
96
+ class OptionInvalid < MiscREOError
75
97
  end
76
98
 
77
- class ObjectNotAlive < MiscREOError # :nodoc:
99
+ # @private
100
+ class ObjectNotAlive < MiscREOError
78
101
  end
79
102
 
80
- class TypeREOError < REOError # :nodoc:
103
+ # @private
104
+ class TypeREOError < REOError
81
105
  end
82
106
 
83
- class TimeOut < REOError # :nodoc:
107
+ # @private
108
+ class TimeOut < REOError
84
109
  end
85
110
 
86
- class AddressInvalid < REOError # :nodoc:
111
+ # @private
112
+ class AddressInvalid < REOError
87
113
  end
88
114
 
89
- class UnexpectedREOError < REOError # :nodoc:
115
+ # @private
116
+ class UnexpectedREOError < REOError
90
117
  end
91
118
 
92
- class NotImplementedREOError < REOError # :nodoc:
119
+ # @private
120
+ class NotImplementedREOError < REOError
93
121
  end
94
122
 
95
123
  class REOCommon
@@ -1,3 +1,3 @@
1
1
  module RobustExcelOle
2
- VERSION = "1.7"
2
+ VERSION = "1.8"
3
3
  end
@@ -216,7 +216,8 @@ module RobustExcelOle
216
216
  end
217
217
 
218
218
  # returns an Excel object when given Excel, Workbook or Win32ole object representing a Workbook or an Excel
219
- def self.excel_of(object) # :nodoc:
219
+ # @private
220
+ def self.excel_of(object)
220
221
  if object.is_a? WIN32OLE
221
222
  case object.ole_obj_help.name
222
223
  when /Workbook/i
@@ -237,7 +238,8 @@ module RobustExcelOle
237
238
 
238
239
  public
239
240
 
240
- def ensure_excel(options) # :nodoc:
241
+ # @private
242
+ def ensure_excel(options)
241
243
  if excel && @excel.alive?
242
244
  @excel.created = false
243
245
  return
@@ -249,7 +251,8 @@ module RobustExcelOle
249
251
  @excel
250
252
  end
251
253
 
252
- def ensure_workbook(file, options) # :nodoc:
254
+ # @private
255
+ def ensure_workbook(file, options)
253
256
  file = @stored_filename ? @stored_filename : file
254
257
  raise(FileNameNotGiven, 'filename is nil') if file.nil?
255
258
  raise(FileNotFound, "file #{General.absolute_path(file).inspect} is a directory") if File.directory?(file)
@@ -322,7 +325,8 @@ module RobustExcelOle
322
325
 
323
326
  private
324
327
 
325
- def open_or_create_workbook(file, options) # :nodoc:
328
+ # @private
329
+ def open_or_create_workbook(file, options)
326
330
  if !@ole_workbook || (options[:if_unsaved] == :alert) || options[:if_obstructed]
327
331
  begin
328
332
  filename = General.absolute_path(file)
@@ -637,11 +641,13 @@ module RobustExcelOle
637
641
 
638
642
  private
639
643
 
644
+ # @private
640
645
  def discoloring
641
646
  @modified_cells.each { |cell| cell.Interior.ColorIndex = XlNone }
642
647
  end
643
648
 
644
- def save_as_workbook(file, options) # :nodoc:
649
+ # @private
650
+ def save_as_workbook(file, options)
645
651
  dirname, basename = File.split(file)
646
652
  file_format =
647
653
  case File.extname(basename)
@@ -826,11 +832,13 @@ module RobustExcelOle
826
832
  @ole_workbook.Fullname.tr('\\','/') rescue nil
827
833
  end
828
834
 
829
- def writable # :nodoc:
835
+ # @private
836
+ def writable
830
837
  !@ole_workbook.ReadOnly if @ole_workbook
831
838
  end
832
839
 
833
- def saved # :nodoc:
840
+ # @private
841
+ def saved
834
842
  @ole_workbook.Saved if @ole_workbook
835
843
  end
836
844
 
@@ -838,6 +846,7 @@ module RobustExcelOle
838
846
  @excel.calculation if @ole_workbook
839
847
  end
840
848
 
849
+ # @private
841
850
  def check_compatibility
842
851
  @ole_workbook.CheckCompatibility if @ole_workbook
843
852
  end
@@ -878,23 +887,28 @@ module RobustExcelOle
878
887
  bookstore.books
879
888
  end
880
889
 
881
- def self.bookstore # :nodoc:
890
+ # @private
891
+ def self.bookstore
882
892
  @@bookstore ||= Bookstore.new
883
893
  end
884
894
 
885
- def bookstore # :nodoc:
895
+ # @private
896
+ def bookstore
886
897
  self.class.bookstore
887
898
  end
888
899
 
889
- def to_s # :nodoc:
900
+ # @private
901
+ def to_s
890
902
  self.filename.to_s
891
903
  end
892
904
 
893
- def inspect # :nodoc:
905
+ # @private
906
+ def inspect
894
907
  '#<Workbook: ' + ('not alive ' unless alive?).to_s + (File.basename(self.filename) if alive?).to_s + " #{@ole_workbook} #{@excel}" + '>'
895
908
  end
896
909
 
897
- def self.excel_class # :nodoc:
910
+ # @private
911
+ def self.excel_class
898
912
  @excel_class ||= begin
899
913
  module_name = self.parent_name
900
914
  "#{module_name}::Excel".constantize
@@ -904,7 +918,8 @@ module RobustExcelOle
904
918
  end
905
919
  end
906
920
 
907
- def self.worksheet_class # :nodoc:
921
+ # @private
922
+ def self.worksheet_class
908
923
  @worksheet_class ||= begin
909
924
  module_name = self.parent_name
910
925
  "#{module_name}::Worksheet".constantize
@@ -913,11 +928,13 @@ module RobustExcelOle
913
928
  end
914
929
  end
915
930
 
916
- def excel_class # :nodoc:
931
+ # @private
932
+ def excel_class
917
933
  self.class.excel_class
918
934
  end
919
935
 
920
- def worksheet_class # :nodoc:
936
+ # @private
937
+ def worksheet_class
921
938
  self.class.worksheet_class
922
939
  end
923
940
 
@@ -925,7 +942,8 @@ module RobustExcelOle
925
942
 
926
943
  private
927
944
 
928
- def method_missing(name, *args) # :nodoc:
945
+ # @private
946
+ def method_missing(name, *args)
929
947
  if name.to_s[0,1] =~ /[A-Z]/
930
948
  begin
931
949
  raise ObjectNotAlive, 'method missing: workbook not alive' unless alive?
@@ -173,7 +173,8 @@ module RobustExcelOle
173
173
  RobustExcelOle::Range.new(@ole_worksheet.Range(@ole_worksheet.Cells(integer_range.min, col), @ole_worksheet.Cells(integer_range.max, col)))
174
174
  end
175
175
 
176
- def self.workbook_class # :nodoc:
176
+ # @private
177
+ def self.workbook_class
177
178
  @workbook_class ||= begin
178
179
  module_name = self.parent_name
179
180
  "#{module_name}::Workbook".constantize
@@ -182,21 +183,25 @@ module RobustExcelOle
182
183
  end
183
184
  end
184
185
 
185
- def workbook_class # :nodoc:
186
+ # @private
187
+ def workbook_class
186
188
  self.class.workbook_class
187
189
  end
188
190
 
189
- def to_s # :nodoc:
191
+ # @private
192
+ def to_s
190
193
  '#<Worksheet: ' + ('not alive ' unless @workbook.alive?).to_s + name.to_s + " #{File.basename(@workbook.stored_filename)} >"
191
194
  end
192
195
 
193
- def inspect # :nodoc:
196
+ # @private
197
+ def inspect
194
198
  self.to_s
195
199
  end
196
200
 
197
- private
201
+ private
198
202
 
199
- def method_missing(name, *args) # :nodoc:
203
+ # @private
204
+ def method_missing(name, *args)
200
205
  if name.to_s[0,1] =~ /[A-Z]/
201
206
  begin
202
207
  @ole_worksheet.send(name, *args)
@@ -4,20 +4,25 @@ require 'tmpdir'
4
4
  require 'fileutils'
5
5
  require File.join(File.dirname(__FILE__), '../lib/robust_excel_ole')
6
6
 
7
- module RobustExcelOle::SpecHelpers # :nodoc:
8
- def create_tmpdir # :nodoc:
7
+ # @private
8
+ module RobustExcelOle::SpecHelpers
9
+
10
+ # @private
11
+ def create_tmpdir
9
12
  tmpdir = Dir.mktmpdir
10
13
  FileUtils.cp_r(File.join(File.dirname(__FILE__), 'data'), tmpdir)
11
14
  tmpdir + '/data'
12
15
  end
13
16
 
14
- def rm_tmp(tmpdir) # :nodoc:
17
+ # @private
18
+ def rm_tmp(tmpdir)
15
19
  FileUtils.remove_entry_secure(File.dirname(tmpdir))
16
20
  end
17
21
 
18
22
  # This method is almost copy of wycats's implementation.
19
23
  # http://pochi.hatenablog.jp/entries/2010/03/24
20
- def capture(stream) # :nodoc:
24
+ # @private
25
+ def capture(stream)
21
26
  begin
22
27
  stream = stream.to_s
23
28
  eval "$#{stream} = StringIO.new"
@@ -16,7 +16,8 @@ $VERBOSE = nil
16
16
  include RobustExcelOle
17
17
 
18
18
  module RobustExcelOle
19
- class MockBookstore # :nodoc:
19
+ # @private
20
+ class MockBookstore
20
21
  def fetch(filename, options = { })
21
22
  nil
22
23
  end
@@ -437,7 +437,8 @@ module RobustExcelOle
437
437
  end
438
438
 
439
439
  context "close excel instances" do
440
- def direct_excel_creation_helper # :nodoc:
440
+ # @private
441
+ def direct_excel_creation_helper
441
442
  expect { WIN32OLE.connect("Excel.Application") }.to raise_error
442
443
  sleep 0.1
443
444
  ole_excel1 = WIN32OLE.new("Excel.Application")
@@ -1984,5 +1985,6 @@ module RobustExcelOle
1984
1985
  end
1985
1986
  end
1986
1987
 
1987
- class TestError < RuntimeError # :nodoc:
1988
+ # @private
1989
+ class TestError < RuntimeError
1988
1990
  end
@@ -1,7 +1,8 @@
1
1
 
2
2
  require 'win32ole'
3
3
 
4
- class KeySender # :nodoc:
4
+ # @private
5
+ class KeySender
5
6
  def initialize(window_name, options={})
6
7
  @window_name = window_name
7
8
  @wsh = WIN32OLE.new('Wscript.Shell')
@@ -4,20 +4,22 @@ require 'tmpdir'
4
4
  require "fileutils"
5
5
  require File.join(File.dirname(__FILE__), '../lib/robust_excel_ole')
6
6
 
7
+ # @private
7
8
  module RobustExcelOle::SpecHelpers
8
- def create_tmpdir # :nodoc:
9
+
10
+ def create_tmpdir
9
11
  tmpdir = Dir.mktmpdir
10
12
  FileUtils.cp_r(File.join(File.dirname(__FILE__), 'data'), tmpdir)
11
13
  tmpdir + '/data'
12
14
  end
13
15
 
14
- def rm_tmp(tmpdir) # :nodoc:
16
+ def rm_tmp(tmpdir)
15
17
  FileUtils.rm_f(File.dirname(tmpdir))
16
18
  end
17
19
 
18
20
  # This method is almost copy of wycats's implementation.
19
21
  # http://pochi.hatenablog.jp/entries/2010/03/24
20
- def capture(stream) # :nodoc:
22
+ def capture(stream)
21
23
  begin
22
24
  stream = stream.to_s
23
25
  eval "$#{stream} = StringIO.new"
@@ -639,7 +639,8 @@ describe Workbook do
639
639
 
640
640
  describe "unobtrusively" do
641
641
 
642
- def unobtrusively_ok? # :nodoc:
642
+ # @private
643
+ def unobtrusively_ok?
643
644
  Workbook.unobtrusively(@simple_file) do |book|
644
645
  book.should be_a Workbook
645
646
  sheet = book.sheet(1)
@@ -854,7 +855,8 @@ describe Workbook do
854
855
 
855
856
  context "with a virgin Workbook class" do
856
857
  before do
857
- class Workbook # :nodoc:
858
+ # @private
859
+ class Workbook
858
860
  @@bookstore = nil
859
861
  end
860
862
  end
@@ -865,7 +867,8 @@ describe Workbook do
865
867
 
866
868
  context "with a book never opened before" do
867
869
  before do
868
- class Workbook # :nodoc:
870
+ # @private
871
+ class Workbook
869
872
  @@bookstore = nil
870
873
  end
871
874
  other_book = Workbook.open(@different_file)
@@ -2,12 +2,12 @@
2
2
 
3
3
  require File.join(File.dirname(__FILE__), './../spec_helper')
4
4
 
5
-
6
- module My # :nodoc:
7
- class Excel < RobustExcelOle::Excel # :nodoc:
5
+ # @private
6
+ module My
7
+ class Excel < RobustExcelOle::Excel
8
8
  end
9
9
 
10
- class Workbook < RobustExcelOle::Workbook # :nodoc:
10
+ class Workbook < RobustExcelOle::Workbook
11
11
  end
12
12
 
13
13
  end
@@ -38,7 +38,8 @@ describe Workbook do
38
38
 
39
39
  describe "unobtrusively" do
40
40
 
41
- def unobtrusively_ok? # :nodoc:
41
+ # @private
42
+ def unobtrusively_ok?
42
43
  Workbook.unobtrusively(@simple_file) do |book|
43
44
  book.should be_a Workbook
44
45
  sheet = book.sheet(1)
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.7'
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - traths
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-22 00:00:00.000000000 Z
11
+ date: 2018-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec