Module: Inch::CLI::YardoptsHelper
- Included in:
- Command::Options::Base
- Defined in:
- lib/inch/cli/yardopts_helper.rb
Defined Under Namespace
Classes: YardoptsWrapper
Constant Summary collapse
- VALID_YARD_SWITCHES =
%w(--private --no-private --protected --no-public --plugin --load --safe --yardopts --no-yardopts --document --no-document)
Instance Attribute Summary collapse
-
#excluded ⇒ Array<String>
List of excluded paths (regexp matches).
-
#yard_files ⇒ Array<String>
List of Ruby source files to process.
Instance Method Summary collapse
-
#parse_yardopts_options(_opts, args) ⇒ void
Parses the option and gracefully handles invalid switches.
- #yardopts_options(opts) ⇒ Object
Instance Attribute Details
#excluded ⇒ Array<String>
Returns list of excluded paths (regexp matches).
8 9 10 |
# File 'lib/inch/cli/yardopts_helper.rb', line 8 def excluded @excluded end |
#yard_files ⇒ Array<String>
Returns list of Ruby source files to process.
5 6 7 |
# File 'lib/inch/cli/yardopts_helper.rb', line 5 def yard_files @yard_files end |
Instance Method Details
#parse_yardopts_options(_opts, args) ⇒ void
This method returns an undefined value.
Parses the option and gracefully handles invalid switches
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/inch/cli/yardopts_helper.rb', line 20 def (_opts, args) wrapper = YardoptsWrapper.new dupped_args = args.dup dupped_args.delete('--help') dupped_args.delete_if do |arg| arg =~ /^\-/ && !VALID_YARD_SWITCHES.include?(arg) end if ui ui.debug "Sending args to YARD:\n" \ " args: #{dupped_args}" end wrapper.parse_arguments(*dupped_args) self.yard_files = wrapper.files self.excluded = wrapper.excluded end |
#yardopts_options(opts) ⇒ Object
40 41 42 43 |
# File 'lib/inch/cli/yardopts_helper.rb', line 40 def (opts) wrapper = YardoptsWrapper.new wrapper.(opts) end |