Module: Marsdawn

Defined in:
lib/marsdawn.rb,
lib/marsdawn/command.rb,
lib/marsdawn/version.rb,
lib/marsdawn/source/front_matter.rb

Defined Under Namespace

Classes: Builder, Command, Config, Search, Site, Source, Storage, Util

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.build(*keys) ⇒ Object

build document source

Parameters:

  • key (String)

    of config file entry



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/marsdawn.rb', line 22

def self.build *keys
  require "marsdawn/builder"
  if block_given?
    conf = {}
    yield conf
    configs = [conf]
  else
    configs = configs_from_file(keys)
  end
  configs.each do |conf|
    Marsdawn::Builder.build conf
  end
  puts "[MarsDawn] Build complete."
rescue => e
  puts "[MarsDawn] ERROR: #{e.message}"
end

.require_lib(path) ⇒ Object

load lib file from lib/marsdawn directory

Parameters:

  • require (String)

    file under lib/marsdawn directory



15
16
17
18
# File 'lib/marsdawn.rb', line 15

def self.require_lib path
  @@base_path ||= File.expand_path(File.join(File.dirname(__FILE__), 'marsdawn'))
  require File.join(@@base_path, path)
end