Class: Moft::Command
- Inherits:
-
Object
- Object
- Moft::Command
- Defined in:
- lib/moft/command.rb
Direct Known Subclasses
Moft::Commands::Build, Moft::Commands::New, Moft::Commands::Serve
Class Method Summary collapse
- .globs(source, destination, static_includes) ⇒ Object
-
.process_site(site) ⇒ Object
Static: Run Site#process and catch errors.
Class Method Details
.globs(source, destination, static_includes) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/moft/command.rb', line 3 def self.globs(source, destination, static_includes) dirs = [] Dir.chdir(source) do dirs = Dir['*'].select { |x| File.directory?(x) } dirs -= [destination, File.(destination), File.basename(destination)] dirs = dirs.map { |x| "#{x}/**/*" } dirs += ['*'] end static_includes.each do |dir| if File.directory?(dir) dir.gsub("\\","/") dirs += ["%s/**/*" % [dir]] end end return dirs end |
.process_site(site) ⇒ Object
Static: Run Site#process and catch errors
site - the Moft::Site object
Returns nothing
27 28 29 30 31 32 33 34 35 |
# File 'lib/moft/command.rb', line 27 def self.process_site(site) site.process rescue Moft::FatalException => e puts Moft::Logger.error "ERROR:", "YOUR SITE COULD NOT BE BUILT:" Moft::Logger.error "", "------------------------------------" Moft::Logger.error "", e. exit(1) end |