class Guard::JekyllPlus

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method
# File lib/guard/jekyll_plus.rb, line 15
def initialize(options = {})
  super

  @config = Config.new(options)
  @server = Server.new(@config)
  @builder = Builder.new(@config)
end
template(plugin_location) click to toggle source
# File lib/guard/jekyll_plus.rb, line 54
def self.template(plugin_location)
  path = 'lib/guard/jekyll_plus/templates/Guardfile'
  (Pathname(plugin_location) + path).read
end

Public Instance Methods

reload() click to toggle source
# File lib/guard/jekyll_plus.rb, line 29
def reload
  stop
  @config.info 'Reloading Jekyll configuration!'
  @config.reload
  @builder.reload
  start
end
run_on_additions(paths) click to toggle source
# File lib/guard/jekyll_plus.rb, line 46
def run_on_additions(paths)
  @builder.added(paths)
end
run_on_modifications(paths) click to toggle source
# File lib/guard/jekyll_plus.rb, line 41
def run_on_modifications(paths)
  reload if paths.any? { |f| @config.config_file?(f) }
  @builder.modified(paths)
end
run_on_removals(paths) click to toggle source
# File lib/guard/jekyll_plus.rb, line 50
def run_on_removals(paths)
  @builder.removed(paths)
end
start() click to toggle source
# File lib/guard/jekyll_plus.rb, line 23
def start
  @builder.build
  @server.start if @config.serve?
  @config.info 'watching'
end
stop() click to toggle source
# File lib/guard/jekyll_plus.rb, line 37
def stop
  @server.stop
end