Class: Dependabot::FileUpdaters::Ruby::Bundler::GemspecUpdater

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

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, gemspec:) ⇒ GemspecUpdater

Returns a new instance of GemspecUpdater.



12
13
14
15
# File 'lib/dependabot/file_updaters/ruby/bundler/gemspec_updater.rb', line 12

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

Instance Method Details

#updated_gemspec_contentObject



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

def updated_gemspec_content
  content = gemspec.content

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

  content
end