Class: Flydata::CompatibilityCheck
- Inherits:
-
Object
- Object
- Flydata::CompatibilityCheck
show all
- Includes:
- CommandLoggable
- Defined in:
- lib/flydata/compatibility_check.rb
Instance Method Summary
collapse
#before_logging, #log_error_stderr, #log_info_stdout, #log_warn_stderr
Constructor Details
#initialize(dp_hash, de_hash = nil, options = {}) ⇒ CompatibilityCheck
13
14
15
16
|
# File 'lib/flydata/compatibility_check.rb', line 13
def initialize(dp_hash, de_hash=nil, options={})
@dp = dp_hash
@errors=[]
end
|
Instance Method Details
#check ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/flydata/compatibility_check.rb', line 18
def check
self.methods.grep(/^check_/).each do |m|
begin
send(m)
rescue ArgumentError => e
rescue FlydataCore::CompatibilityError => e
@errors << e
end
end
print_errors
end
|
#print_errors ⇒ Object
31
32
33
34
35
36
37
38
|
# File 'lib/flydata/compatibility_check.rb', line 31
def print_errors
return if @errors.empty?
log_error_stderr "There may be some compatibility issues with this current server : "
@errors.each do |error|
log_error_stderr " * #{error.message}"
end
raise "Please correct these errors if you wish to run FlyData Agent"
end
|