Class: DependencyBot::Fixer::BundleAudit
- Inherits:
-
Object
- Object
- DependencyBot::Fixer::BundleAudit
- Defined in:
- lib/dependency_bot/fixer/bundle_audit.rb
Overview
This class is responsible for updating a Ruby dependency using the ‘bundle update` command to fix security vulnerabilities. It is part of the DependencyBot::Fixer module.
Usage:
fixer = DependencyBot::Fixer::BundleAudit.new(dependency)
fixer.fix
puts fixer.branch_name
puts fixer.
Instance Method Summary collapse
- #branch_name ⇒ Object
- #commit_message ⇒ Object
- #fix ⇒ Object
-
#initialize(dependency) ⇒ BundleAudit
constructor
A new instance of BundleAudit.
Constructor Details
#initialize(dependency) ⇒ BundleAudit
Returns a new instance of BundleAudit.
15 16 17 |
# File 'lib/dependency_bot/fixer/bundle_audit.rb', line 15 def initialize(dependency) @dependency = dependency end |
Instance Method Details
#branch_name ⇒ Object
23 24 25 |
# File 'lib/dependency_bot/fixer/bundle_audit.rb', line 23 def branch_name "update-#{@dependency.name.downcase}" end |
#commit_message ⇒ Object
27 28 29 |
# File 'lib/dependency_bot/fixer/bundle_audit.rb', line 27 def "Update #{@dependency.name} to fix security vulnerabilities" end |
#fix ⇒ Object
19 20 21 |
# File 'lib/dependency_bot/fixer/bundle_audit.rb', line 19 def fix Kernel.exec "bundle update #{@dependency.name}" end |