Class: Danger::DangerJazzy
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerJazzy
- Defined in:
- lib/jazzy/plugin.rb
Overview
rubocop:disable Metrics/LineLength This is a danger plugin to check for undocumented symbols via Jazzy.
rubocop:enable Metrics/LineLength
Constant Summary collapse
- DEFAULT_MESSAGE =
'Undocumented symbol.'.freeze
Instance Attribute Summary collapse
-
#path ⇒ String
Path to the docs folder, defaults to ‘docs/’.
Instance Method Summary collapse
-
#check(config = {}) ⇒ void
Checks files for modified symbols.
-
#undocumented(scope = :modified) ⇒ Array of symbol
Returns a list of undocumented symbols in the current diff.
Instance Attribute Details
#path ⇒ String
Path to the docs folder, defaults to ‘docs/’.
38 39 40 |
# File 'lib/jazzy/plugin.rb', line 38 def path @path end |
Instance Method Details
#check(config = {}) ⇒ void
This method returns an undefined value.
Checks files for modified symbols.
Takes a hash with the following keys:
* `fail`
* `warn`
Available scopes:
* `modified`
* `all`
54 55 56 57 58 |
# File 'lib/jazzy/plugin.rb', line 54 def check(config = {}) @config = config fail_check warn_check end |
#undocumented(scope = :modified) ⇒ Array of symbol
Returns a list of undocumented symbols in the current diff.
Available scopes:
* `modified`
* `all`
69 70 71 72 73 74 |
# File 'lib/jazzy/plugin.rb', line 69 def undocumented(scope = :modified) return [] unless scope != :ignore && File.exist?(undocumented_path) @undocumented = { modified: [], all: [] } if @undocumented.nil? load_undocumented(scope) if @undocumented[scope].empty? @undocumented[scope] end |