Class: Dependabot::Bundler::FileUpdater::LockfileUpdater
- Inherits:
-
Object
- Object
- Dependabot::Bundler::FileUpdater::LockfileUpdater
- Extended by:
- T::Sig
- 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- CHECKSUMS_SECTION =
/(^CHECKSUMS\n)(?<entries>(?:^ .*\n)+)/m- BUNDLED_WITH_VERSION_REGEX =
/BUNDLED WITH\s+(?<version>\d+\.\d+\.\d+)/m- BUNDLER_CHECKSUM_ENTRY_REGEX =
/^ bundler \([^)]+\).*\n?$/- MIN_BUNDLER_CHECKSUM_VERSION =
Gem::Version.new("4.0.11")
Instance Method Summary collapse
- #gemspec_sources ⇒ Object
-
#initialize(dependencies:, dependency_files:, credentials:, options:, repo_contents_path: nil) ⇒ LockfileUpdater
constructor
A new instance of LockfileUpdater.
- #updated_lockfile_content ⇒ Object
Constructor Details
#initialize(dependencies:, dependency_files:, credentials:, options:, repo_contents_path: nil) ⇒ LockfileUpdater
Returns a new instance of LockfileUpdater.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/dependabot/bundler/file_updater/lockfile_updater.rb', line 43 def initialize( dependencies:, dependency_files:, credentials:, options:, repo_contents_path: nil ) @dependencies = T.let(dependencies, T::Array[Dependabot::Dependency]) @dependency_files = T.let(dependency_files, T::Array[Dependabot::DependencyFile]) @repo_contents_path = T.let(repo_contents_path, T.nilable(String)) @credentials = T.let(credentials, T::Array[Dependabot::Credential]) @options = T.let(, T::Hash[Symbol, T.untyped]) @updated_lockfile_content = T.let(nil, T.nilable(String)) @gemfile = T.let(nil, T.nilable(Dependabot::DependencyFile)) @lockfile = T.let(nil, T.nilable(Dependabot::DependencyFile)) @evaled_gemfiles = T.let(nil, T.nilable(T::Array[Dependabot::DependencyFile])) @bundler_version = T.let(nil, T.nilable(String)) end |
Instance Method Details
#gemspec_sources ⇒ Object
65 66 67 68 69 70 |
# File 'lib/dependabot/bundler/file_updater/lockfile_updater.rb', line 65 def gemspec_sources [ ::Bundler::Source::Path, ::Bundler::Source::Gemspec ] end |
#updated_lockfile_content ⇒ Object
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/dependabot/bundler/file_updater/lockfile_updater.rb', line 73 def updated_lockfile_content @updated_lockfile_content ||= begin updated_content = build_updated_lockfile raise "Expected content to change!" if T.must(lockfile).content == updated_content updated_content end end |