Class: CI::Syntax::Tool::Format::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ci-syntax-tool/format/base.rb

Overview

CI::Syntax::Tool::Format::Base

Base class for syntax checkers.  Sketches out the
API you need if you want to add a format.

Direct Known Subclasses

JUnit, Progress

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, args) ⇒ Base

Args is a hash, contents unspecified as yet.



13
14
15
# File 'lib/ci-syntax-tool/format/base.rb', line 13

def initialize(io, args)
  @out = io
end

Instance Attribute Details

#outObject (readonly)

Returns the value of attribute out.



10
11
12
# File 'lib/ci-syntax-tool/format/base.rb', line 10

def out
  @out
end

Class Method Details

.descendant_classesObject



17
18
19
20
# File 'lib/ci-syntax-tool/format/base.rb', line 17

def self.descendant_classes
  # Fairly expensive call...
  ObjectSpace.each_object(Class).select { |klass| klass < self }
end

Instance Method Details

#file_finished(_file_result) ⇒ Object

Called once at the end of the check on a file.



35
36
# File 'lib/ci-syntax-tool/format/base.rb', line 35

def file_finished(_file_result)
end

#file_started(_file_result) ⇒ Object

Called once at the beginning of the check on a file.



31
32
# File 'lib/ci-syntax-tool/format/base.rb', line 31

def file_started(_file_result)
end

#lang_finished(_lang_result) ⇒ Object

Invoked after all files are inspected, or interrupted by user.



39
40
# File 'lib/ci-syntax-tool/format/base.rb', line 39

def lang_finished(_lang_result)
end

#lang_started(_lang_result) ⇒ Object

Called once at the beginning of the language check before any files



27
28
# File 'lib/ci-syntax-tool/format/base.rb', line 27

def lang_started(_lang_result)
end

#overall_finished(_overall_result) ⇒ Object

Called once at the global finish



43
44
# File 'lib/ci-syntax-tool/format/base.rb', line 43

def overall_finished(_overall_result)
end

#overall_started(_overall_result) ⇒ Object

Called once at the beginning of the check before any languages



23
24
# File 'lib/ci-syntax-tool/format/base.rb', line 23

def overall_started(_overall_result)
end