class Ansei::Shehai
Build class for Ansei
Public Instance Methods
build()
click to toggle source
Build and compile a site from source files
# File lib/ansei/shehai.rb, line 5 def build clean_build_directory compile(:javascript) compile(:stylesheets) compile(:markdown) end
Protected Instance Methods
clean_build_directory()
click to toggle source
Clean out the build directory
# File lib/ansei/shehai.rb, line 43 def clean_build_directory Utils.dir_empty(Ansei.config[:directories][:build]) end
compile(type)
click to toggle source
Compile assets of a certain type
type - key for information lookup
# File lib/ansei/shehai.rb, line 18 def compile(type) dir = Ansei.config[:directories][type].first ext = Ansei.config[:extensions][type].first Utils.cli_log(" #{ext}:") Utils.dir_glob(dir).each do |file| compile_asset(type, file) end end
compile_asset(type, file)
click to toggle source
Compile a single asset of a certain type
type - key for information lookup file - filename for asset
# File lib/ansei/shehai.rb, line 33 def compile_asset(type, file) info = Utils.file_info(type, file) return unless info.ext == info.exts.first || info.exts.last.include?(info.ext) Render.new(info).compile end