Class: Guard::Inch
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Inch
- Defined in:
- lib/guard/inch.rb
Overview
A guard plugin for the Inch documentation lint tool
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Inch
constructor
configure a new instance of the plugin.
-
#run_all ⇒ Object
Run all of the documentation lints.
-
#run_on_changes(paths) ⇒ Object
Run the lints for changes files.
-
#start ⇒ Object
On start, display a message and optionally run the documentation lint.
Constructor Details
#initialize(options = {}) ⇒ Inch
configure a new instance of the plugin
11 12 13 14 15 16 |
# File 'lib/guard/inch.rb', line 11 def initialize( = {}) super @options = @all_on_start @all_type = [:all_type] || :none end |
Instance Method Details
#run_all ⇒ Object
Run all of the documentation lints
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/guard/inch.rb', line 28 def run_all return unless [:all_type] args = case [:all_type] when :stats 'stats' when :list 'list' when :suggest 'suggest' end args << ' .' run_inch args end |
#run_on_changes(paths) ⇒ Object
Run the lints for changes files
44 45 46 47 48 49 |
# File 'lib/guard/inch.rb', line 44 def run_on_changes(paths) flags = '' flags << '--pedantic ' if [:pedantic] flags << '--private ' if [:private] run_inch "#{flags} #{paths.join(' ')}" end |
#start ⇒ Object
On start, display a message and optionally run the documentation lint
19 20 21 22 23 24 25 |
# File 'lib/guard/inch.rb', line 19 def start = 'Guard::Inch is running' << ' in pedantic mode' if [:pedantic] << ' and inspecting private fields' if [:private] ::Guard::UI.info run_all if [:all_on_start] end |