Module: Card::Loader

Defined in:
lib/card/loader.rb

Class Method Summary collapse

Class Method Details

.load_chunksObject



15
16
17
18
19
# File 'lib/card/loader.rb', line 15

def load_chunks
  mod_dirs.each do |mod|
    load_dir "#{mod}/chunk/*.rb"
  end
end

.load_layoutsObject



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/card/loader.rb', line 21

def load_layouts
  mod_dirs.inject({}) do |hash, mod|
    dirname = "#{mod}/layout"
    if File.exists? dirname
      Dir.foreach( dirname ) do |filename|
        next if filename =~ /^\./
        hash[ filename.gsub /\.html$/, '' ] = File.read( [dirname, filename] * '/' )
      end
    end
    hash
  end
end

.load_modsObject



9
10
11
12
13
# File 'lib/card/loader.rb', line 9

def load_mods
  load_set_patterns
  load_formats
  load_sets
end