Class: Danger::DangerWCC::YarnDeduplicate
- Inherits:
-
Object
- Object
- Danger::DangerWCC::YarnDeduplicate
- Includes:
- Utils
- Defined in:
- lib/wcc/yarn_deduplicate.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ lockfile: 'yarn.lock', severity: :warn }.freeze
Instance Method Summary collapse
-
#initialize(plugin, options = {}) ⇒ YarnDeduplicate
constructor
A new instance of YarnDeduplicate.
- #perform ⇒ Object
- #yarn_info ⇒ Object
Methods included from Utils
#diff_strings, #each_addition_in_diff, #each_file_in_diff, #each_line_in_diff, #find_file_in_diff, #find_in_diff, #format_links_as_markdown, #issue, #logger, #parsed_diffs, #plugin, #run, #run_and_diff, #with_revision
Constructor Details
#initialize(plugin, options = {}) ⇒ YarnDeduplicate
Returns a new instance of YarnDeduplicate.
19 20 21 22 |
# File 'lib/wcc/yarn_deduplicate.rb', line 19 def initialize(plugin, = {}) @plugin = plugin = DEFAULT_OPTIONS.merge() end |
Instance Method Details
#perform ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/wcc/yarn_deduplicate.rb', line 24 def perform diff = run_yarn_deduplicate_diff each_addition_in_diff(diff) do |line| add_deduplicate_warning(line) end end |
#yarn_info ⇒ Object
14 15 16 17 |
# File 'lib/wcc/yarn_deduplicate.rb', line 14 def yarn_info @yarn_info ||= Danger::DangerWCC::Util::YarnInfo.new(self, ) end |