artifactory 2.3.0 → 2.3.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/artifactory/resources/artifact.rb +1 -1
- data/lib/artifactory/resources/base.rb +5 -1
- data/lib/artifactory/version.rb +1 -1
- data/spec/unit/resources/artifact_spec.rb +5 -4
- data/spec/unit/resources/base_spec.rb +27 -10
- data/spec/unit/resources/permission_target_spec.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: 045f5344e68d2c66a806c125dd3d0b0145ec708c
|
|
4
|
+
data.tar.gz: e99a7f99652c7b683bd6670b3d2eeed3c4f524f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4aa62feb08b654a27a660b093dd00ff6adf29fd60d43572eaa1d9b2dd9e23c420e03a211287c6466c2ff0b5aa7caf5dc3ed4822ce6f0d24bbe0852f3b57a3417
|
|
7
|
+
data.tar.gz: 22b8b4e79a681d4043f4d2bf67522761a39b0b0a4092555e4cdd536b302b416d8eccdd3e1abccbef07e3c70ae5f1211d94d20809efa028aa393bdde8e27ecd82
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@ Artifactory Client CHANGELOG
|
|
|
3
3
|
This file is used to document the changes between releases of the Artifactory
|
|
4
4
|
Ruby client.
|
|
5
5
|
|
|
6
|
+
v2.3.1 (11-13-2015)
|
|
7
|
+
-------------------
|
|
8
|
+
- Ensure embedded requests respect configured settings
|
|
9
|
+
|
|
6
10
|
v2.3.0 (08-04-2015)
|
|
7
11
|
-------------------
|
|
8
12
|
- Support for Build endpoints
|
|
@@ -438,7 +438,7 @@ module Artifactory
|
|
|
438
438
|
# the list of properties
|
|
439
439
|
#
|
|
440
440
|
def properties
|
|
441
|
-
@properties ||= client.get(
|
|
441
|
+
@properties ||= client.get(File.join('/api/storage', relative_path), properties: nil)['properties']
|
|
442
442
|
end
|
|
443
443
|
|
|
444
444
|
#
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
require 'cgi'
|
|
18
18
|
require 'json'
|
|
19
|
+
require 'uri'
|
|
19
20
|
|
|
20
21
|
module Artifactory
|
|
21
22
|
class Resource::Base
|
|
@@ -104,8 +105,11 @@ module Artifactory
|
|
|
104
105
|
# @return [~Resource::Base]
|
|
105
106
|
#
|
|
106
107
|
def from_url(url, options = {})
|
|
108
|
+
# Parse the URL and only use the path so the configured
|
|
109
|
+
# endpoint/proxy/SSL settings are used in the GET request.
|
|
110
|
+
path = URI.parse(url).path
|
|
107
111
|
client = extract_client!(options)
|
|
108
|
-
from_hash(client.get(
|
|
112
|
+
from_hash(client.get(path), client: client)
|
|
109
113
|
end
|
|
110
114
|
|
|
111
115
|
#
|
data/lib/artifactory/version.rb
CHANGED
|
@@ -452,15 +452,16 @@ module Artifactory
|
|
|
452
452
|
{ 'properties' => properties }
|
|
453
453
|
end
|
|
454
454
|
let(:client) { double(get: response) }
|
|
455
|
-
let(:
|
|
455
|
+
let(:relative_path) { '/api/storage/some-repo/path/artifact.deb' }
|
|
456
|
+
let(:artifact_uri) { File.join('http://33.33.33.11', relative_path) }
|
|
456
457
|
|
|
457
458
|
before do
|
|
458
|
-
subject.client
|
|
459
|
-
subject.uri
|
|
459
|
+
subject.client = client
|
|
460
|
+
subject.uri = artifact_uri
|
|
460
461
|
end
|
|
461
462
|
|
|
462
463
|
it 'gets the properties from the server' do
|
|
463
|
-
expect(client).to receive(:get).with(
|
|
464
|
+
expect(client).to receive(:get).with(relative_path, properties: nil).once
|
|
464
465
|
expect(subject.properties).to eq(properties)
|
|
465
466
|
end
|
|
466
467
|
|
|
@@ -2,6 +2,12 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
module Artifactory
|
|
4
4
|
describe Resource::Base do
|
|
5
|
+
let(:client) { double }
|
|
6
|
+
|
|
7
|
+
before do
|
|
8
|
+
allow(Artifactory).to receive(:client).and_return(client)
|
|
9
|
+
end
|
|
10
|
+
|
|
5
11
|
describe '.attribute' do
|
|
6
12
|
before { described_class.attribute(:bacon) }
|
|
7
13
|
|
|
@@ -74,19 +80,30 @@ module Artifactory
|
|
|
74
80
|
expect(options).to eq(options)
|
|
75
81
|
end
|
|
76
82
|
end
|
|
83
|
+
end
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
describe '.from_url' do
|
|
86
|
+
let(:relative_path) { '/api/storage/omnibus-unstable-local/com/getchef/harmony/0.1.0+20151111083608.git.15.8736e1e/el/5/harmony-0.1.0+20151111083608.git.15.8736e1e-1.el5.x86_64.rpm' }
|
|
80
87
|
|
|
81
|
-
|
|
82
|
-
expect(URI).to receive(:escape).once
|
|
83
|
-
described_class.url_safe(string)
|
|
84
|
-
end
|
|
88
|
+
it 'only uses the path from absolute URLs' do
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
expect(described_class).to receive(:from_hash)
|
|
91
|
+
expect(client).to receive(:get).with(relative_path)
|
|
92
|
+
described_class.from_url(File.join('http://33.33.33.11', relative_path))
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
describe '.url_safe' do
|
|
97
|
+
let(:string) { double(to_s: 'string') }
|
|
98
|
+
|
|
99
|
+
it 'delegates to URI.escape' do
|
|
100
|
+
expect(URI).to receive(:escape).once
|
|
101
|
+
described_class.url_safe(string)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
it 'converts the value to a string' do
|
|
105
|
+
expect(string).to receive(:to_s).once
|
|
106
|
+
described_class.url_safe(string)
|
|
90
107
|
end
|
|
91
108
|
end
|
|
92
109
|
|
|
@@ -47,7 +47,7 @@ module Artifactory
|
|
|
47
47
|
|
|
48
48
|
it 'constructs a new instance from the result' do
|
|
49
49
|
expect(described_class).to receive(:from_hash).once
|
|
50
|
-
described_class.from_url('/api/security/permissions/
|
|
50
|
+
described_class.from_url('/api/security/permissions/AnyRemote')
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: artifactory
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.3.
|
|
4
|
+
version: 2.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Seth Vargo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-11-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|