class Guard::Staticise

Constants

DEFAULT_OPTIONS

Public Class Methods

new(watchers =[], options = {}) click to toggle source
Calls superclass method
# File lib/guard/staticise.rb, line 17
def initialize(watchers =[], options = {})
  watchers = [] if !watchers
  ::Guard::UI.info("staticise watcher #{ watchers }")

  defaults = DEFAULT_OPTIONS.clone.merge(options)

  watchers << ::Guard::Watcher.new(%r{^#{ defaults[:input] }/(.+\.h[ta]ml)$})

  super(watchers, defaults)
end

Public Instance Methods

reload() click to toggle source
# File lib/guard/staticise.rb, line 36
def reload

end
run_all() click to toggle source
# File lib/guard/staticise.rb, line 40
def run_all
  begin
    ::Staticise::Renderer.pages
  rescue Exception => e
    message = "Error compiling pages: #{ e.message }"
    ::Guard::UI.info(message)
    Notifier.notify(false, message)


  end
end
run_on_changes(paths) click to toggle source
# File lib/guard/staticise.rb, line 52
def run_on_changes(paths)
  puts paths.join(", ")
  begin
    paths.each do |f|
      if File.basename(f).start_with?("_") || f.index("layouts")
        ::Staticise::Renderer.pages
      else
        ::Staticise::Renderer.new(f).export
      end
    end
  rescue Exception => e
    message = "Error compiling #{ paths.join(", ")}: #{ e.message }"
    ::Guard::UI.info(message)
    Notifier.notify(false, message)

  end

end
run_on_removals(paths) click to toggle source
# File lib/guard/staticise.rb, line 71
def run_on_removals(paths)
  # Runner.remove(Inspector.clean(paths, :missing_ok => true), watchers, options)
end
start() click to toggle source
# File lib/guard/staticise.rb, line 28
def start
  run_all if options[:all_on_start]
end
stop() click to toggle source
# File lib/guard/staticise.rb, line 32
def stop

end