Class: RuboCop::CLI::Command::ShowDocsUrl Private
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Base
|
|
|
Instance Chain:
|
|
| Inherits: |
RuboCop::CLI::Command::Base
|
| Defined in: | lib/rubocop/cli/command/show_docs_url.rb |
Overview
Prints out url to documentation of provided cops or documentation base url by default.
Class Attribute Summary
Base - Inherited
Class Method Summary
- .new(env) ⇒ ShowDocsUrl constructor Internal use only
Base - Inherited
Instance Attribute Summary
Instance Method Summary
- #run Internal use only
- #cops_array private Internal use only
- #print_documentation_url private Internal use only
CopNames - Included
| #cop_class_for, #department?, #department_message, | |
| #known_cop_classes | The cops among |
| #unknown_cop_message, #validate_cop_names! | |
Constructor Details
.new(env) ⇒ ShowDocsUrl
Instance Method Details
#cops_array (private)
[ GitHub ]# File 'lib/rubocop/cli/command/show_docs_url.rb', line 40
def cops_array @cops_array ||= @options[:show_docs_url] end
#print_documentation_url (private)
[ GitHub ]# File 'lib/rubocop/cli/command/show_docs_url.rb', line 29
def print_documentation_url puts Cop::Documentation.default_base_url if cops_array.empty? known_cop_classes(cops_array).each do |cop| url = Cop::Documentation.url_for(cop, @config) puts url if url end puts end
#run
[ GitHub ]# File 'lib/rubocop/cli/command/show_docs_url.rb', line 20
def run print_documentation_url # Checked after printing, so a typo alongside good names still gives # you the urls you asked for. validate_cop_names!(cops_array) end