dpl 1.8.7.travis.1143.4 → 1.8.7.travis.1144.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/dpl/provider/npm.rb +3 -2
- data/spec/provider/npm_spec.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjI5M2EyOGYyMzRmZGFhMzdiNWUwN2IyYWM3ZDFkNDY3MWU1YmI4Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWM4MmVkMWExZTliNjdkMWRmZDBlM2EzNGQ2ZTNkMDI3NGZlMmExYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjdkMjc4ZTVhNjczY2U2NjZlMmI4NTMxZDdiMWJjZDI4NzQ2OTMwZGFmYTI5
|
10
|
+
Y2YzYTM0YjliYWE5ZWMwNDQ2MDRmMTM0ZTEyNDU1ODJkOWFmNTA2ZDIwY2Q3
|
11
|
+
MjI0MmE2YWNkNDQ2MDVkZTUzMzAxNTRkYzcxZWI2MjA0YzAxYzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDYyNWQ3N2M5M2M1MzBhMjQwMzY2NTQ2NTAwNGYwNzYxZjdiYzZiZjEyM2Uz
|
14
|
+
Y2M0Zjc5Mzk1NDQxYzczNGQ2NzFmZmEzNjVhMmQ4N2UwNDA5Nzc1ZTViNzYy
|
15
|
+
MTRmZjFlOWZjNzE4MjgwOGZmYjdlMzFjMmRkMWNlMTBkZTZkYjA=
|
data/lib/dpl/provider/npm.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'json'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
module DPL
|
4
5
|
class Provider
|
@@ -36,7 +37,7 @@ module DPL
|
|
36
37
|
if File.exists?('package.json')
|
37
38
|
data = JSON.parse(File.read('package.json'))
|
38
39
|
if data['publishConfig'] && data['publishConfig']['registry']
|
39
|
-
return data['publishConfig']['registry']
|
40
|
+
return URI(data['publishConfig']['registry']).host
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
@@ -48,7 +49,7 @@ module DPL
|
|
48
49
|
if npm_version =~ /^1/
|
49
50
|
"_auth = ${NPM_API_KEY}\nemail = #{option(:email)}"
|
50
51
|
else
|
51
|
-
"//#{package_registry
|
52
|
+
"//#{package_registry}/:_authToken=${NPM_API_KEY}"
|
52
53
|
end
|
53
54
|
end
|
54
55
|
|
data/spec/provider/npm_spec.rb
CHANGED
@@ -46,7 +46,8 @@ describe DPL::Provider::NPM do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
context 'when package.json exists' do
|
49
|
-
let(:
|
49
|
+
let(:host) { 'npm.example.com' }
|
50
|
+
let(:custom_rpm_registry) { 'https://' + host }
|
50
51
|
before :each do
|
51
52
|
expect(File).to receive(:exists?).with('package.json').and_return(true)
|
52
53
|
end
|
@@ -56,14 +57,14 @@ describe DPL::Provider::NPM do
|
|
56
57
|
|
57
58
|
describe '#setup_auth' do
|
58
59
|
example do
|
59
|
-
test_setup_auth(
|
60
|
+
test_setup_auth(host)
|
60
61
|
end
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
64
65
|
context 'and it defines custom RPM registry with trailing slash' do
|
65
|
-
let(:host) { 'npm.example.com'}
|
66
|
-
let(:custom_rpm_registry) { host + '/' }
|
66
|
+
let(:host) { 'npm.example.com' }
|
67
|
+
let(:custom_rpm_registry) { 'https://' + host + '/' }
|
67
68
|
before { expect(File).to receive(:read).with('package.json').and_return("{\"publishConfig\":{\"registry\":\"#{custom_rpm_registry}\"}}") }
|
68
69
|
|
69
70
|
describe '#setup_auth' do
|