Class: Jekyll::Command
- Inherits:
-
Object
- Object
- Jekyll::Command
- Defined in:
- lib/jekyll/command.rb
Direct Known Subclasses
Jekyll::Commands::Build, Jekyll::Commands::Doctor, Jekyll::Commands::New, Jekyll::Commands::Serve
Class Method Summary collapse
- .globs(source, destination) ⇒ Object
-
.process_site(site) ⇒ Object
Static: Run Site#process and catch errors.
Class Method Details
.globs(source, destination) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/jekyll/command.rb', line 3 def self.globs(source, destination) 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 end |
.process_site(site) ⇒ Object
Static: Run Site#process and catch errors
site - the Jekyll::Site object
Returns nothing
17 18 19 20 21 22 23 24 25 |
# File 'lib/jekyll/command.rb', line 17 def self.process_site(site) site.process rescue Jekyll::FatalException => e puts Jekyll.logger.error "ERROR:", "YOUR SITE COULD NOT BE BUILT:" Jekyll.logger.error "", "------------------------------------" Jekyll.logger.error "", e. exit(1) end |