Sha256: d7544ed77240a20f6768fdd4ad8aac82439f87ca5db5370ce5a902888595a811

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

module Monad
  class Command
    def self.globs(source, destination)
      Dir.chdir(source) do
        dirs = Dir['*'].select { |x| File.directory?(x) }
        dirs -= [destination, File.expand_path(destination), File.basename(destination)]
        dirs = dirs.map { |x| "#{x}/**/*" }
        dirs += ['*']
      end
    end

    # Static: Run Site#process and catch errors
    #
    # site - the Monad::Site object
    #
    # Returns nothing
    def self.process_site(site)
      site.process
    rescue Monad::FatalException => e
      puts
      Monad::Logger.error "ERROR:", "YOUR SITE COULD NOT BE BUILT:"
      Monad::Logger.error "", "------------------------------------"
      Monad::Logger.error "", e.message
      exit(1)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
monad-0.0.2 lib/monad/command.rb
monad-0.0.1 lib/monad/command.rb