class Textigniter::Build
The Build
class searches through the textigniter enviornment (Default: /.textigniter) and parses through text files, stylesheets, and javascripts with filters that correlate to the extension of the file. The parsed content is then rendered to the output directory (Default: /public_html)
Public Class Methods
new(args)
click to toggle source
# File lib/textigniter/build.rb, line 8 def initialize(args) # Output a start message STDOUT.puts "Building static content".yellow_on_black # Check for an existing environment unless File.directory?($twd) # Output a failure message do to lack of environment and exit STDOUT.puts "Textigniter does not exist in this directory ".yellow_on_black + "[FAIL]".red_on_black STDOUT.puts "\r\nHint: ".white_on_black + "textigniter init ".bold.white_on_black + " creates a new environment\r\n".white_on_black exit end # get the content list content = list.get_build_list('content') # process and render unless nil unless content.nil? # Parse the text text_items = Textigniter::Parsers::TextParser.new.process(content) # Parse the template template_items = Textigniter::Parsers::TemplateParser.new.process(text_items) # Render html to file RenderFiles.new.render(template_items, 'content') end # get the styles list styles = list.get_build_list('styles') # process and render unless nil unless styles.nil? # Parse the styles style_items = Textigniter::Parsers::StyleParser.new.process(styles) # Render styles to file RenderFiles.new.render(style_items, 'styles') end # get the scripts list scripts = list.get_build_list('scripts') # process and render unless nil unless scripts.nil? # Parse the scripts script_items = Textigniter::Parsers::ScriptParser.new.process(scripts) # Render scripts to file RenderFiles.new.render(script_items, 'scripts') end # write files to .content.yml manifest.write_manifest('content') # write files to .styles.yml manifest.write_manifest('styles') # write files to .scripts.yml manifest.write_manifest('scripts') end
Public Instance Methods
list()
click to toggle source
Textigniter::List
object
# File lib/textigniter/build.rb, line 61 def list @list = Textigniter::List.new end
manifest()
click to toggle source
manifest parser
# File lib/textigniter/build.rb, line 56 def manifest @manifest = Textigniter::Parsers::ManifestParser.new end