Sha256: c69634445d2ba096934487a75522ce3b579533ab411b7382a5e79e47b6fffa16

Contents?: true

Size: 534 Bytes

Versions: 49

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # Helpers for builtin documentation
    module Documentation
      module_function

      # @api private
      def department_to_basename(department)
        "cops_#{department.downcase}"
      end

      # @api private
      def url_for(cop_class)
        base = department_to_basename(cop_class.department)
        fragment = cop_class.cop_name.downcase.gsub(/[^a-z]/, '')
        "https://docs.rubocop.org/rubocop/#{base}.html##{fragment}"
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 5 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/documentation.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/documentation.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/documentation.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/documentation.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/documentation.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/documentation.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/rubocop-1.18.3/lib/rubocop/cop/documentation.rb
rubocop-1.19.0 lib/rubocop/cop/documentation.rb
rubocop-1.18.4 lib/rubocop/cop/documentation.rb
rubocop-1.18.3 lib/rubocop/cop/documentation.rb
rubocop-1.18.2 lib/rubocop/cop/documentation.rb
rubocop-1.18.1 lib/rubocop/cop/documentation.rb
rubocop-1.18.0 lib/rubocop/cop/documentation.rb
rubocop-1.17.0 lib/rubocop/cop/documentation.rb
rubocop-1.16.1 lib/rubocop/cop/documentation.rb
rubocop-1.16.0 lib/rubocop/cop/documentation.rb
rubocop-1.15.0 lib/rubocop/cop/documentation.rb
cocRb-0.1.0 .bundle/ruby/3.0.0/gems/rubocop-1.14.0/lib/rubocop/cop/documentation.rb
rubocop-1.14.0 lib/rubocop/cop/documentation.rb
rubocop-1.13.0 lib/rubocop/cop/documentation.rb