artifactory 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f36b33be0b821d20e678a3f104b7fd24a41ebd93
4
- data.tar.gz: 144d1a14596dd383816dbb47158249a578cf31af
3
+ metadata.gz: 045f5344e68d2c66a806c125dd3d0b0145ec708c
4
+ data.tar.gz: e99a7f99652c7b683bd6670b3d2eeed3c4f524f2
5
5
  SHA512:
6
- metadata.gz: d85c333c34fa8fcb273ccf4a8fee6598f8e748c310c6f8de1b75c57c793994e5046ff98d37983ecd771a311d81c6c65e92df25b493a82e273a20e237cf7b1720
7
- data.tar.gz: 9ea0a6be40e91885a8a1ea63b62a4fa2032c4e751f8536b325e60e7eea783464e2930fdd5821e37110de890952fc685f659ea13b800827dae4d2360ad2bc8cf0
6
+ metadata.gz: 4aa62feb08b654a27a660b093dd00ff6adf29fd60d43572eaa1d9b2dd9e23c420e03a211287c6466c2ff0b5aa7caf5dc3ed4822ce6f0d24bbe0852f3b57a3417
7
+ data.tar.gz: 22b8b4e79a681d4043f4d2bf67522761a39b0b0a4092555e4cdd536b302b416d8eccdd3e1abccbef07e3c70ae5f1211d94d20809efa028aa393bdde8e27ecd82
@@ -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(uri, properties: nil)['properties']
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(url), client: client)
112
+ from_hash(client.get(path), client: client)
109
113
  end
110
114
 
111
115
  #
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Artifactory
18
- VERSION = '2.3.0'
18
+ VERSION = '2.3.1'
19
19
  end
@@ -452,15 +452,16 @@ module Artifactory
452
452
  { 'properties' => properties }
453
453
  end
454
454
  let(:client) { double(get: response) }
455
- let(:uri) { '/artifact.deb' }
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 = client
459
- subject.uri = 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(uri, properties: nil).once
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
- describe '.url_safe' do
79
- let(:string) { double(to_s: 'string') }
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
- it 'delegates to URI.escape' do
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
- it 'converts the value to a string' do
87
- expect(string).to receive(:to_s).once
88
- described_class.url_safe(string)
89
- end
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/Any Remote')
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.0
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-08-04 00:00:00.000000000 Z
11
+ date: 2015-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler