Class: Dependabot::UpdateCheckers::JavaScript::NpmAndYarn::RegistryFinder
- Inherits:
-
Object
- Object
- Dependabot::UpdateCheckers::JavaScript::NpmAndYarn::RegistryFinder
- Defined in:
- lib/dependabot/update_checkers/java_script/npm_and_yarn/registry_finder.rb
Constant Summary collapse
- NPM_AUTH_TOKEN_REGEX =
%r{//(?<registry>.*)/:_authToken=(?<token>.*)$}.freeze
- NPM_GLOBAL_REGISTRY_REGEX =
/^registry\s*=\s*(?<registry>.*)$/.freeze
- YARN_GLOBAL_REGISTRY_REGEX =
/^registry\s+['"](?<registry>.*)['"]/.freeze
Instance Method Summary collapse
- #auth_headers ⇒ Object
- #dependency_url ⇒ Object
-
#initialize(dependency:, credentials:, npmrc_file: nil, yarnrc_file: nil) ⇒ RegistryFinder
constructor
A new instance of RegistryFinder.
- #registry ⇒ Object
Constructor Details
#initialize(dependency:, credentials:, npmrc_file: nil, yarnrc_file: nil) ⇒ RegistryFinder
Returns a new instance of RegistryFinder.
19 20 21 22 23 24 25 |
# File 'lib/dependabot/update_checkers/java_script/npm_and_yarn/registry_finder.rb', line 19 def initialize(dependency:, credentials:, npmrc_file: nil, yarnrc_file: nil) @dependency = dependency @credentials = credentials @npmrc_file = npmrc_file @yarnrc_file = yarnrc_file end |
Instance Method Details
#auth_headers ⇒ Object
31 32 33 |
# File 'lib/dependabot/update_checkers/java_script/npm_and_yarn/registry_finder.rb', line 31 def auth_headers auth_header_for(auth_token) end |
#dependency_url ⇒ Object
35 36 37 |
# File 'lib/dependabot/update_checkers/java_script/npm_and_yarn/registry_finder.rb', line 35 def dependency_url "#{registry_url.gsub(%r{/+$}, '')}/#{escaped_dependency_name}" end |
#registry ⇒ Object
27 28 29 |
# File 'lib/dependabot/update_checkers/java_script/npm_and_yarn/registry_finder.rb', line 27 def registry locked_registry || first_registry_with_dependency_details end |