Class: GemPluginAction

Inherits:
BuildAction show all
Defined in:
lib/kwala/actions/gem_plugin.rb

Overview

How would I test this?

Class Method Summary collapse

Methods inherited from BuildAction

#build_action, command_line_action_name, command_line_action_names, create_action_from_command_line_name, #detailed_display, #score, #summary_display

Methods included from InheritanceTracker

#get_implementors

Class Method Details

.detailed_template_fileObject



13
14
15
# File 'lib/kwala/actions/gem_plugin.rb', line 13

def self.detailed_template_file
  "#{File.dirname(__FILE__)}/#{command_line_action_name}_detailed.html"
end

.load_external_gemsObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/kwala/actions/gem_plugin.rb', line 17

def self.load_external_gems
  require 'rubygems'
  # Here we do stuff with the gem api to find all external gems that require kwala.
  # We will assume that they are actions and require them
  # Thanks to Chad Fowler for this bit of code
  Gem.cache.search(//).select do |specification|
    specification.dependencies.map{ |dep| dep.name }.include?('kwala')
  end.each do |depname|
    require depname.name
  end
end

.summary_template_fileObject

For now I assume that the gem’s templates are in the same directory as the action file



9
10
11
# File 'lib/kwala/actions/gem_plugin.rb', line 9

def self.summary_template_file
  "#{File.dirname(__FILE__)}/#{command_line_action_name}_summary.html"
end