Class: PolishGeeks::DevTools::Commands::Yard

Inherits:
Base
  • Object
show all
Defined in:
lib/polish_geeks/dev_tools/commands/yard.rb

Overview

Note:

It validates if everything is well documented

Command wrapper for Yard statistics

Constant Summary collapse

MATCH_REGEXP =

Regexp used to match Yard output to check if there are things that are not documented or that include warnings

/(Undocumented Objects|warn)/i

Constants inherited from Base

Base::TYPES

Instance Attribute Summary

Attributes inherited from Base

#output, #stored_output

Instance Method Summary collapse

Methods inherited from Base

#ensure_executable!, #error_message

Instance Method Details

#executeString

Executes this command

Returns:

  • (String)

    command output



15
16
17
# File 'lib/polish_geeks/dev_tools/commands/yard.rb', line 15

def execute
  @output = Shell.new.execute("bundle exec yard stats #{options}")
end

#valid?Boolean

Returns true if everything is documented and without warnings.

Returns:

  • (Boolean)

    true if everything is documented and without warnings



20
21
22
# File 'lib/polish_geeks/dev_tools/commands/yard.rb', line 20

def valid?
  output[MATCH_REGEXP].nil?
end