Class: RakeCheck::Checker::Base

Inherits:
Object
  • Object
show all
Includes:
Term::ANSIColor
Defined in:
lib/rake_check/checker/base.rb

Overview

Abstractclass for all Checker

Direct Known Subclasses

Brakeman, BundlerAudit, Cane, CoffeeLint, Cucumber, Konacha, Rbp, Reek, Rspec, Yard

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



13
14
15
# File 'lib/rake_check/checker/base.rb', line 13

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#check_outputObject (readonly)

Returns the value of attribute check_output.



12
13
14
# File 'lib/rake_check/checker/base.rb', line 12

def check_output
  @check_output
end

#optionsObject (readonly)

Returns the value of attribute options.



12
13
14
# File 'lib/rake_check/checker/base.rb', line 12

def options
  @options
end

#short_messageObject (readonly)

Returns the value of attribute short_message.



12
13
14
# File 'lib/rake_check/checker/base.rb', line 12

def short_message
  @short_message
end

#timeObject (readonly)

Returns the value of attribute time.



12
13
14
# File 'lib/rake_check/checker/base.rb', line 12

def time
  @time
end

Instance Method Details

#statusObject



17
18
19
# File 'lib/rake_check/checker/base.rb', line 17

def status
  "(#{@time} sec): " + (success? ? "OK".green : "FAILED".red) + " " + short_message.to_s
end

#success?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rake_check/checker/base.rb', line 21

def success?
  @status && @status.success?
end

#typeObject

overwrite if needed



26
27
28
# File 'lib/rake_check/checker/base.rb', line 26

def type
  self.class.name.split("::").last
end