dpl 2.0.0.alpha.8 → 2.0.0.alpha.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dpl/providers/npm.rb +23 -6
- data/lib/dpl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ffe98f5b9f3ce0ca191cf682cef66a9ce40d9ca
|
4
|
+
data.tar.gz: c6f078c0327bdc898dacce86ba58146d40b1c59e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ea460e362dc45fde1bc1c6bf2b4712e3e1b33d78720323cbaac8a5168b0bfc69c7fdbc3ae723441ee7f61f881f19d5baadff123da9ea0c1561a572c8a847ad6
|
7
|
+
data.tar.gz: '097250f7c7aae96be417e826b5b50ac724b3046dd3cbc5ad38bf4ca7c2e74a8458de1bf8a397696ffc6b5953e0bb2e2265cd922f417c9225dd3e3f56e17b1532'
|
data/Gemfile.lock
CHANGED
data/lib/dpl/providers/npm.rb
CHANGED
@@ -21,7 +21,7 @@ module Dpl
|
|
21
21
|
opt '--tag TAGS', 'distribution tags to add'
|
22
22
|
opt '--auth_method METHOD', 'Authentication method', enum: %w(auth)
|
23
23
|
|
24
|
-
REGISTRY = 'registry.npmjs.org'
|
24
|
+
REGISTRY = 'https://registry.npmjs.org'
|
25
25
|
NPMRC = '~/.npmrc'
|
26
26
|
|
27
27
|
msgs version: 'npm version: %{npm_version}',
|
@@ -71,15 +71,32 @@ module Dpl
|
|
71
71
|
if npm_version =~ /^1/ || auth_method == 'auth'
|
72
72
|
"_auth = #{api_token}\nemail = #{email}"
|
73
73
|
else
|
74
|
-
"//#{
|
74
|
+
"//#{auth_endpoint}/:_authToken=#{api_token}"
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
def auth_endpoint
|
79
|
+
str = registry
|
80
|
+
str = strip_path(str) if str.include?('npm.pkg.github.com')
|
81
|
+
str = strip_protocol(str).sub(%r(/$), '')
|
82
|
+
str
|
83
|
+
end
|
84
|
+
|
78
85
|
def registry
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
86
|
+
super || registry_from_package_json || REGISTRY
|
87
|
+
end
|
88
|
+
|
89
|
+
def registry_from_package_json
|
90
|
+
return unless data = package_json
|
91
|
+
data && data.fetch('publishConfig', {})['registry']
|
92
|
+
end
|
93
|
+
|
94
|
+
def strip_path(url)
|
95
|
+
url.sub(URI(url).path, '')
|
96
|
+
end
|
97
|
+
|
98
|
+
def strip_protocol(url)
|
99
|
+
url.sub("#{URI(url).scheme}://", '')
|
83
100
|
end
|
84
101
|
|
85
102
|
def host(url)
|
data/lib/dpl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.alpha.
|
4
|
+
version: 2.0.0.alpha.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-10-
|
13
|
+
date: 2019-10-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cl
|