Class: Dependabot::Bundler::FileUpdater::GitSourceRemover
- Inherits:
-
Object
- Object
- Dependabot::Bundler::FileUpdater::GitSourceRemover
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/bundler/file_updater/git_source_remover.rb
Defined Under Namespace
Classes: Rewriter
Instance Attribute Summary collapse
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
Instance Method Summary collapse
-
#initialize(dependency:) ⇒ GitSourceRemover
constructor
A new instance of GitSourceRemover.
- #rewrite(content) ⇒ Object
Constructor Details
#initialize(dependency:) ⇒ GitSourceRemover
Returns a new instance of GitSourceRemover.
17 18 19 |
# File 'lib/dependabot/bundler/file_updater/git_source_remover.rb', line 17 def initialize(dependency:) @dependency = dependency end |
Instance Attribute Details
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
15 16 17 |
# File 'lib/dependabot/bundler/file_updater/git_source_remover.rb', line 15 def dependency @dependency end |
Instance Method Details
#rewrite(content) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/dependabot/bundler/file_updater/git_source_remover.rb', line 21 def rewrite(content) buffer = Parser::Source::Buffer.new("(gemfile_content)") buffer.source = content ast = Parser::CurrentRuby.new.parse(buffer) Rewriter.new(dependency: dependency).rewrite(buffer, ast) end |