Class: Dependabot::Composer::FileUpdater::LockfileUpdater
- Inherits:
-
Object
- Object
- Dependabot::Composer::FileUpdater::LockfileUpdater
- 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.
42 43 44 45 46 47 |
# File 'lib/dependabot/composer/file_updater/lockfile_updater.rb', line 42 def initialize(dependencies:, dependency_files:, credentials:) @dependencies = dependencies @dependency_files = dependency_files @credentials = credentials @composer_platform_extensions = initial_platform end |
Instance Method Details
#updated_lockfile_content ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/dependabot/composer/file_updater/lockfile_updater.rb', line 49 def updated_lockfile_content @updated_lockfile_content ||= generate_updated_lockfile_content rescue MissingExtensions => e previous_extensions = composer_platform_extensions.dup update_required_extensions(e.extensions) raise if previous_extensions == composer_platform_extensions retry end |