Class: Danger::DangerLockDependencyVersions

Inherits:
Plugin
  • Object
show all
Defined in:
lib/lock_dependency_versions/plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lock_list_fileObject

Returns the value of attribute lock_list_file.



5
6
7
# File 'lib/lock_dependency_versions/plugin.rb', line 5

def lock_list_file
  @lock_list_file
end

Instance Method Details

#check(config = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/lock_dependency_versions/plugin.rb', line 12

def check(config = nil)
  config = config.is_a?(Hash) ? config : { }
  warning_mode = config[:warning] || false
  files = git.modified_files
  lock_list.keys.each do |file|
    if files.include?(file) && !(files.include?(lock_list[file]))
      comment(warning_mode, file)
    end
  end
end