Class: Dependabot::Bundler::FileUpdater::GemspecUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/bundler/file_updater/gemspec_updater.rb

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, gemspec:) ⇒ GemspecUpdater

Returns a new instance of GemspecUpdater.


11
12
13
14
# File 'lib/dependabot/bundler/file_updater/gemspec_updater.rb', line 11

def initialize(dependencies:, gemspec:)
  @dependencies = dependencies
  @gemspec = gemspec
end

Instance Method Details

#updated_gemspec_contentObject


16
17
18
19
20
21
22
23
24
25
26
# File 'lib/dependabot/bundler/file_updater/gemspec_updater.rb', line 16

def updated_gemspec_content
  content = gemspec.content

  dependencies.each do |dependency|
    content = replace_gemspec_version_requirement(
      gemspec, dependency, content
    )
  end

  content
end