Class: Dependabot::NpmAndYarn::Utils
- Inherits:
-
Object
- Object
- Dependabot::NpmAndYarn::Utils
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/npm_and_yarn.rb
Class Method Summary collapse
- .extract_node_versions(error_message) ⇒ Object
- .extract_var(error_message) ⇒ Object
- .sanitize_resolvability_message(error_message, dependencies, yarn_lock) ⇒ Object
Class Method Details
.extract_node_versions(error_message) ⇒ Object
175 176 177 178 179 180 181 182 183 |
# File 'lib/dependabot/npm_and_yarn.rb', line 175 def self.extract_node_versions() match_data = .match(NODE_VERSION_NOT_SATISFY_REGEX) return {} unless match_data { current_version: match_data[:current_version], required_version: match_data[:required_version] } end |
.extract_var(error_message) ⇒ Object
186 187 188 189 190 191 |
# File 'lib/dependabot/npm_and_yarn.rb', line 186 def self.extract_var() match_data = T.must(.match(ENV_VAR_NOT_RESOLVABLE)).named_captures["var"] return "" unless match_data match_data end |
.sanitize_resolvability_message(error_message, dependencies, yarn_lock) ⇒ Object
200 201 202 203 |
# File 'lib/dependabot/npm_and_yarn.rb', line 200 def self.(, dependencies, yarn_lock) dependency_names = dependencies.map(&:name).join(", ") "Error whilst updating #{dependency_names} in #{yarn_lock.path}:\n#{}" end |