Class: Charsi::Builder
- Inherits:
-
Object
- Object
- Charsi::Builder
- Defined in:
- lib/charsi/builder.rb
Overview
Builds the application and handles file watching for changes.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #watch ⇒ Object
Constructor Details
Instance Method Details
#build ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/charsi/builder.rb', line 9 def build start_time = Time.now Charsi::FileManagement.reset_output_dir(@config.path(:output_dir)) Charsi::Asset.new(@config).build Charsi::Template.new(@app, @config).build puts "[charsi] Build completed in #{Time.now - start_time} seconds." end |
#watch ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/charsi/builder.rb', line 19 def watch Filewatcher.new(watch_paths).watch do |changes| changes.each do |filename, event| puts "[charsi][#{event}] #{filename}" end build end rescue Interrupt puts "\n[charsi] Done watching." end |