Class: Dependabot::Bundler::FileUpdater::LockfileUpdater
- Inherits:
-
Object
- Object
- Dependabot::Bundler::FileUpdater::LockfileUpdater
- Defined in:
- lib/dependabot/bundler/file_updater/lockfile_updater.rb
Constant Summary collapse
- LOCKFILE_ENDING =
/(?<ending>\s*(?:RUBY VERSION|BUNDLED WITH).*)/m
- GIT_DEPENDENCIES_SECTION =
/GIT\n.*?\n\n(?!GIT)/m
- GIT_DEPENDENCY_DETAILS =
/GIT\n.*?\n\n/m
Instance Method Summary collapse
-
#gemspec_sources ⇒ Object
Can’t be a constant because some of these don’t exist in bundler 1.15, which Heroku uses, which causes an exception on boot.
-
#initialize(dependencies:, dependency_files:, repo_contents_path: nil, credentials:, options:) ⇒ LockfileUpdater
constructor
A new instance of LockfileUpdater.
- #updated_lockfile_content ⇒ Object
Constructor Details
#initialize(dependencies:, dependency_files:, repo_contents_path: nil, credentials:, options:) ⇒ LockfileUpdater
Returns a new instance of LockfileUpdater.
36 37 38 39 40 41 42 43 |
# File 'lib/dependabot/bundler/file_updater/lockfile_updater.rb', line 36 def initialize(dependencies:, dependency_files:, repo_contents_path: nil, credentials:, options:) @dependencies = dependencies @dependency_files = dependency_files @repo_contents_path = repo_contents_path @credentials = credentials @options = end |
Instance Method Details
#gemspec_sources ⇒ Object
Can’t be a constant because some of these don’t exist in bundler 1.15, which Heroku uses, which causes an exception on boot.
29 30 31 32 33 34 |
# File 'lib/dependabot/bundler/file_updater/lockfile_updater.rb', line 29 def gemspec_sources [ ::Bundler::Source::Path, ::Bundler::Source::Gemspec ] end |
#updated_lockfile_content ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/dependabot/bundler/file_updater/lockfile_updater.rb', line 45 def updated_lockfile_content @updated_lockfile_content ||= begin updated_content = build_updated_lockfile raise "Expected content to change!" if lockfile.content == updated_content updated_content end end |