class Guard::Moonrope

Public Class Methods

new(options) click to toggle source
Calls superclass method
# File lib/moonrope/guard.rb, line 3
def initialize(options)
  super
  @options = options
  @options[:source] ||= "api"
  @options[:destination] ||= ".apidoc"
end

Public Instance Methods

reload() click to toggle source
# File lib/moonrope/guard.rb, line 14
def reload
  stop ; start
end
run_all() click to toggle source
# File lib/moonrope/guard.rb, line 18
def run_all
  generate_moonrope_docs
end
run_on_modifications(paths) click to toggle source
# File lib/moonrope/guard.rb, line 22
def run_on_modifications(paths)
  generate_moonrope_docs
end
start() click to toggle source
# File lib/moonrope/guard.rb, line 10
def start
  UI.info "Starting Moonrope Watching"
end

Private Instance Methods

generate_moonrope_docs() click to toggle source
# File lib/moonrope/guard.rb, line 28
def generate_moonrope_docs
  if File.exist?(File.join(@options[:destination], 'moonrope.txt'))
    system("rm -Rf #{@options[:destination]}/*")
  end
  system("bundle exec moonrope #{@options[:source]} #{@options[:destination]}")
end