Class: Guard::Yardstick

Inherits:
Plugin
  • Object
show all
Defined in:
lib/guard/yardstick.rb

Overview

A guard plugin to run yardstick on every save

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Guard::Yardstick

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes guard-yardstick



17
18
19
20
21
22
23
# File 'lib/guard/yardstick.rb', line 17

def initialize(args = {})
  super

  @options = {
    all_on_start: true
  }.merge(args)
end

Instance Attribute Details

#optionsHash (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

A hash of options for configuring the plugin



11
12
13
# File 'lib/guard/yardstick.rb', line 11

def options
  @options
end

Instance Method Details

#run_allVoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Will run all files through yardstick



37
38
39
40
41
# File 'lib/guard/yardstick.rb', line 37

def run_all
  UI.info 'Inspecting Yarddoc in all files'

  inspect_with_yardstick
end

#run_on_additions(paths) ⇒ Void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Will run when files are added



47
48
49
# File 'lib/guard/yardstick.rb', line 47

def run_on_additions(paths)
  run_partially(paths)
end

#run_on_modifications(paths) ⇒ Void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Will run when files are changed



55
56
57
# File 'lib/guard/yardstick.rb', line 55

def run_on_modifications(paths)
  run_partially(paths)
end

#startVoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

When guard starts will run all files if :all_on_start is set



29
30
31
# File 'lib/guard/yardstick.rb', line 29

def start
  run_all if options[:all_on_start]
end