Sha256: e012f98f954eaa89c4c6a6e16465f101fca1e337e7bbe1927f47095a5404e09b
Contents?: true
Size: 1.32 KB
Versions: 2
Compression:
Stored size: 1.32 KB
Contents
# # build.rb # bolt # # Created by Ben McRedmond on 2010-01-08. # Copyright 2010 Ben McRedmond. All rights reserved. # require 'yaml' require 'fileutils' require 'bolt/base' require 'bolt/page' require 'bolt/view' module Bolt class Build < Base # Performs all the nessecary steps to build a Bolt project def initialize() if $config.out puts $config.out else $config.out = d("out") end end def run remove_directory($config.out) create_directory($config.out, :error_if_exists => false) copy_resources parse_config load_pages end # Copies the contents of $config.resources to the out directory def copy_resources FileUtils.cp_r(Dir.glob("#{d($config.resources)}/*"), $config.out) puts "Copied #{d($config.resources)} to #{$config.out}" end # Parses $config.config and loads all contents into instance variables def parse_config $config_file = YAML::load(open_file(d($config.config))) puts "Parsed config #{d($config.config)}" end def load_pages pages = Dir.glob("#{d($config.pages)}/*.rb") pages.each do |page| parse_page page end end def parse_page(page) puts "Parsing page #{page}" load page end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
benofsky-bolt-0.1.7 | lib/bolt/build.rb |
benofsky-bolt-0.1.6 | lib/bolt/build.rb |