Module: RabidPrawns

Defined in:
lib/rabidprawns.rb,
lib/rabidprawns.rb,
lib/rabidprawns.rb,
lib/rabidprawns/columned_page.rb,
lib/rabidprawns/simple_tables.rb

Defined Under Namespace

Classes: Document

Class Method Summary collapse

Class Method Details

.available_rabidsObject

Returns array of available rabids for loading



6
7
8
9
10
11
12
13
# File 'lib/rabidprawns.rb', line 6

def available_rabids
  libs = []
  Dir.new(File.expand_path(File.expand_path(__FILE__) + '/../rabidprawns')).each do |item|
    next if %w(. ..).include? item
    libs << item.gsub('.rb', '').to_sym
  end
  libs
end

.load_rabid(*args) ⇒ Object Also known as: load_rabids

args

rabid symbols

Load the given rabids



17
18
19
20
21
22
23
# File 'lib/rabidprawns.rb', line 17

def load_rabid(*args)
  list = self.available_rabids
  args.each do |arg|
    raise ArgumentError.new "Unknown rabid requested: #{arg}" unless list.include?(arg)
    require "rabidprawns/#{arg}"
  end
end