Class: Guard::Annotate

Inherits:
Plugin
  • Object
show all
Defined in:
lib/guard/annotate.rb,
lib/guard/annotate/notifier.rb

Defined Under Namespace

Classes: Notifier

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Annotate

Returns a new instance of Annotate.


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/guard/annotate.rb', line 10

def initialize(options={})
  super

  options[:notify] = true if options[:notify].nil?
  options[:position] = 'before' if options[:position].nil?
  options[:tests] = false if options[:tests].nil?
  options[:factories] = true if options[:factories].nil?
  options[:serializers] = true if options[:serializers].nil?
  options[:sort] = false if options[:sort].nil?
  options[:routes] = false if options[:routes].nil?
  options[:run_at_start] = true if options[:run_at_start].nil?
  options[:show_indexes] = false if options[:show_indexes].nil?
  options[:simple_indexes] = false if options[:simple_indexes].nil?
  options[:show_foreign_keys] = false if options[:show_foreign_keys].nil?
  options[:show_migration] = false if options[:show_migration].nil?
  options[:format] = nil if options[:format].nil? or not [:bare, :markdown, :rdoc].include? options[:format].to_sym
end

Instance Method Details

#reloadObject


36
37
38
# File 'lib/guard/annotate.rb', line 36

def reload
  run_annotate if options[:run_at_start]
end

#run_allObject


40
41
42
# File 'lib/guard/annotate.rb', line 40

def run_all
  true
end

#run_on_changes(paths = []) ⇒ Object Also known as: run_on_change


44
45
46
# File 'lib/guard/annotate.rb', line 44

def run_on_changes(paths=[])
  run_annotate
end

#startObject


28
29
30
# File 'lib/guard/annotate.rb', line 28

def start
  run_annotate if options[:run_at_start]
end

#stopObject


32
33
34
# File 'lib/guard/annotate.rb', line 32

def stop
  true
end