Class: BuildAction

Inherits:
Object
  • Object
show all
Extended by:
InheritanceTracker
Defined in:
lib/kwala/build_action.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from InheritanceTracker

get_implementors

Class Method Details

.command_line_action_nameObject



25
26
27
# File 'lib/kwala/build_action.rb', line 25

def self.command_line_action_name
  self.name.gsub(/BuildAction|Action/, '').kwala_underscore
end

.command_line_action_namesObject



49
50
51
52
53
# File 'lib/kwala/build_action.rb', line 49

def BuildAction.command_line_action_names
  BuildAction.get_implementors.map do |imp|
    imp.command_line_action_name
  end.sort
end

.create_action_from_command_line_name(name) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/kwala/build_action.rb', line 37

def BuildAction.create_action_from_command_line_name(name)
  imp = BuildAction.get_implementors.find do |imp|
    imp.command_line_action_name == name
  end

  if imp
    imp.new
  else
    nil
  end
end

.detailed_template_fileObject



33
34
35
# File 'lib/kwala/build_action.rb', line 33

def self.detailed_template_file
  "#{TEMPLATE_DIR}/#{command_line_action_name}_detailed.html"
end

.summary_template_fileObject



29
30
31
# File 'lib/kwala/build_action.rb', line 29

def self.summary_template_file
  "#{TEMPLATE_DIR}/#{command_line_action_name}_summary.html"
end

Instance Method Details

#build_action(context) ⇒ Object



4
5
6
# File 'lib/kwala/build_action.rb', line 4

def build_action(context)
  raise "Must be implemented by subclass."
end

#detailed_display(context) ⇒ Object



12
13
14
# File 'lib/kwala/build_action.rb', line 12

def detailed_display(context)
  [nil, nil]
end

#scoreObject

a number from 1 - 10 that represents some type of rating that will help determine if the koala’s expression. For now if nil, then not scorable. This might be better as an additional method called scoreable? Default is unscoreable



21
22
23
# File 'lib/kwala/build_action.rb', line 21

def score
  nil
end

#summary_display(context) ⇒ Object



8
9
10
# File 'lib/kwala/build_action.rb', line 8

def summary_display(context)
  raise "Must be implemented by subclass."
end