Class: Dependabot::Composer::FileUpdater::LockfileUpdater
- Inherits:
-
Object
- Object
- Dependabot::Composer::FileUpdater::LockfileUpdater
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/composer/file_updater/lockfile_updater.rb
Defined Under Namespace
Classes: MissingExtensions
Constant Summary collapse
- MISSING_EXPLICIT_PLATFORM_REQ_REGEX =
%r{ (?<=PHP\sextension\s)ext\-[^\s/]+\s.*?\s(?=is|but)| (?<=requires\s)php(?:\-[^\s/]+)?\s.*?\s(?=but) }x- MISSING_IMPLICIT_PLATFORM_REQ_REGEX =
%r{ (?<!with|for|by)\sext\-[^\s/]+\s.*?\s(?=->)| (?<=requires\s)php(?:\-[^\s/]+)?\s.*?\s(?=->) }x- MISSING_ENV_VAR_REGEX =
/Environment variable '(?<env_var>.[^']+)' is not set/
Instance Method Summary collapse
-
#initialize(dependencies:, dependency_files:, credentials:) ⇒ LockfileUpdater
constructor
A new instance of LockfileUpdater.
- #updated_lockfile_content ⇒ Object
Constructor Details
#initialize(dependencies:, dependency_files:, credentials:) ⇒ LockfileUpdater
Returns a new instance of LockfileUpdater.
56 57 58 59 60 61 62 |
# File 'lib/dependabot/composer/file_updater/lockfile_updater.rb', line 56 def initialize(dependencies:, dependency_files:, credentials:) @dependencies = dependencies @dependency_files = dependency_files @credentials = credentials @composer_platform_extensions = T.let(initial_platform, T::Hash[String, T::Array[String]]) @lock_git_deps = T.let(true, T::Boolean) end |
Instance Method Details
#updated_lockfile_content ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/dependabot/composer/file_updater/lockfile_updater.rb', line 65 def updated_lockfile_content @updated_lockfile_content ||= T.let( generate_updated_lockfile_content, T.nilable(String) ) rescue MissingExtensions => e previous_extensions = composer_platform_extensions.dup update_required_extensions(e.extensions) raise if previous_extensions == composer_platform_extensions retry end |