module Reek::DocumentationLink
Generate versioned links to our documentation
Constants
- HELP_LINK_TEMPLATE
Public Instance Methods
Source
# File lib/reek/documentation_link.rb, line 16 def build(subject) Kernel.format(HELP_LINK_TEMPLATE, version: Version::STRING, item: name_to_param(subject)) end
Build link to the documentation about the given subject for the current version of Reek
. The subject can be either a smell type like ‘FeatureEnvy’ or a general subject like ‘Rake Task’.
@param subject [String] @return [String] the full URL for the relevant documentation
Source
# File lib/reek/documentation_link.rb, line 22 def name_to_param(name) name.split(/([A-Z][a-z][a-z]*)/).map(&:strip).reject(&:empty?).join('-') end
Convert the given subject name to a form that is acceptable in a URL, by dasherizeing it at the start of capitalized words. Spaces are discared.