Class: Inch::CLI::Command::Suggest
- Defined in:
- lib/inch/cli/command/suggest.rb
Constant Summary collapse
- EXIT_CODE_PENDING_SUGGESTIONS =
10
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from BaseList
Attributes inherited from Base
Instance Method Summary collapse
- #description ⇒ Object
-
#exit_status ⇒ Fixnum
10 if suggestions were found, zero otherwise.
-
#run(*args) ⇒ void
Runs the commandline utility, parsing arguments and displaying a list of objects.
- #usage ⇒ Object
Methods inherited from BaseList
Methods inherited from Base
#initialize, #name, register_command_as, run
Methods included from TraceHelper
Constructor Details
This class inherits a constructor from Inch::CLI::Command::Base
Instance Method Details
#description ⇒ Object
12 13 14 |
# File 'lib/inch/cli/command/suggest.rb', line 12 def description 'Suggests some objects to be documented (better)' end |
#exit_status ⇒ Fixnum
Returns 10 if suggestions were found, zero otherwise.
38 39 40 |
# File 'lib/inch/cli/command/suggest.rb', line 38 def exit_status objects.empty? ? super : EXIT_CODE_PENDING_SUGGESTIONS end |
#run(*args) ⇒ void
This method returns an undefined value.
Runs the commandline utility, parsing arguments and displaying a list of objects
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/inch/cli/command/suggest.rb', line 25 def run(*args) prepare_codebase(*args) context = API::Suggest.new(codebase, ) self.objects = context.objects if .format == Options::Suggest::FORMAT_TEXT Output::Suggest.new(, context.all_objects, objects, context.grade_lists, context.files) else Output::Stats.new(, context.all_objects, context.grade_lists) end end |
#usage ⇒ Object
16 17 18 |
# File 'lib/inch/cli/command/suggest.rb', line 16 def usage 'Usage: inch suggest [paths] [options]' end |