artifactory 2.3.1 → 2.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 045f5344e68d2c66a806c125dd3d0b0145ec708c
4
- data.tar.gz: e99a7f99652c7b683bd6670b3d2eeed3c4f524f2
3
+ metadata.gz: 88a07bebf0e1201ad10be593194583ddfa5a09f3
4
+ data.tar.gz: 13a8f808072f78f902bfcf74acf08d1755623ff4
5
5
  SHA512:
6
- metadata.gz: 4aa62feb08b654a27a660b093dd00ff6adf29fd60d43572eaa1d9b2dd9e23c420e03a211287c6466c2ff0b5aa7caf5dc3ed4822ce6f0d24bbe0852f3b57a3417
7
- data.tar.gz: 22b8b4e79a681d4043f4d2bf67522761a39b0b0a4092555e4cdd536b302b416d8eccdd3e1abccbef07e3c70ae5f1211d94d20809efa028aa393bdde8e27ecd82
6
+ metadata.gz: 4d4686760f8b6b8135affdc2dbc248a56b1ce95bad2f7a877342f2453971d89f09fc1923a63517c62f808c07acee96b74a1bde3b3c370e8b859df9e134f00729
7
+ data.tar.gz: 772bc3aa6b4101e3236677dc59c0614f9e43021201e558e395ec6dc50cab308f61d90e7a758423efea4aeb596c48b81edf46f521df190209520aedf08983f2e1
@@ -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.2 (11-20-2015)
7
+ -------------------
8
+ - Fix embedded requests when endpoint has a non-empty path
9
+
6
10
  v2.3.1 (11-13-2015)
7
11
  -------------------
8
12
  - Ensure embedded requests respect configured settings
@@ -109,6 +109,11 @@ module Artifactory
109
109
  # endpoint/proxy/SSL settings are used in the GET request.
110
110
  path = URI.parse(url).path
111
111
  client = extract_client!(options)
112
+ # If the endpoint contains a path part, we must remove the
113
+ # endpoint path part from path, because the client uses
114
+ # endpoint + path as its full URI.
115
+ endpoint_path = URI.parse(client.endpoint).path
116
+ path.slice!(endpoint_path)
112
117
  from_hash(client.get(path), client: client)
113
118
  end
114
119
 
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Artifactory
18
- VERSION = '2.3.1'
18
+ VERSION = '2.3.2'
19
19
  end
@@ -3,6 +3,8 @@ require 'spec_helper'
3
3
  module Artifactory
4
4
  describe Resource::Artifact do
5
5
  let(:client) { double(:client) }
6
+ let(:endpoint_host) { 'http://33.33.33.11' }
7
+ let(:endpoint) { "#{endpoint_host}/" }
6
8
 
7
9
  before(:each) do
8
10
  allow(Artifactory).to receive(:client).and_return(client)
@@ -369,6 +371,7 @@ module Artifactory
369
371
  let(:response) { {} }
370
372
 
371
373
  it 'constructs a new instance from the result' do
374
+ expect(client).to receive(:endpoint).and_return(endpoint)
372
375
  expect(described_class).to receive(:from_hash).once
373
376
  described_class.from_url('/some/artifact/path.deb')
374
377
  end
@@ -3,6 +3,8 @@ require 'spec_helper'
3
3
  module Artifactory
4
4
  describe Resource::Base do
5
5
  let(:client) { double }
6
+ let(:endpoint_host) { 'http://33.33.33.11' }
7
+ let(:endpoint) { "#{endpoint_host}/" }
6
8
 
7
9
  before do
8
10
  allow(Artifactory).to receive(:client).and_return(client)
@@ -85,11 +87,28 @@ module Artifactory
85
87
  describe '.from_url' do
86
88
  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' }
87
89
 
88
- it 'only uses the path from absolute URLs' do
90
+ context 'when endpoint path part is not empty' do
91
+ let(:endpoint) { "#{endpoint_host}/artifactory" }
92
+ let(:full_url) { "#{endpoint}#{relative_path}" }
89
93
 
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))
94
+ it 'uses the path minus the path part of the endpoint' do
95
+ expect(client).to receive(:endpoint).and_return(endpoint)
96
+ expect(described_class).to receive(:from_hash)
97
+ expect(client).to receive(:get).with(relative_path)
98
+ described_class.from_url(full_url)
99
+ end
100
+ end
101
+
102
+ context 'when endpoint has empty path part' do
103
+ let(:endpoint) { "#{endpoint_host}/" }
104
+ let(:full_url) { "#{endpoint}#{relative_path}" }
105
+
106
+ it 'only uses the path from absolute URLs' do
107
+ expect(client).to receive(:endpoint).and_return(endpoint)
108
+ expect(described_class).to receive(:from_hash)
109
+ expect(client).to receive(:get).with(relative_path)
110
+ described_class.from_url(full_url)
111
+ end
93
112
  end
94
113
  end
95
114
 
@@ -115,6 +134,7 @@ module Artifactory
115
134
  it 'defaults to the Artifactory.client' do
116
135
  client = double
117
136
  allow(Artifactory).to receive(:client).and_return(client)
137
+ allow(client).to receive(:endpoint).and_return(endpoint)
118
138
 
119
139
  expect(subject.client).to be(client)
120
140
  end
@@ -3,6 +3,8 @@ require 'spec_helper'
3
3
  module Artifactory
4
4
  describe Resource::Group do
5
5
  let(:client) { double(:client) }
6
+ let(:endpoint_host) { 'http://33.33.33.11' }
7
+ let(:endpoint) { "#{endpoint_host}/" }
6
8
 
7
9
  before(:each) do
8
10
  allow(Artifactory).to receive(:client).and_return(client)
@@ -46,6 +48,7 @@ module Artifactory
46
48
  let(:response) { {} }
47
49
 
48
50
  it 'constructs a new instance from the result' do
51
+ expect(client).to receive(:endpoint).and_return(endpoint)
49
52
  expect(described_class).to receive(:from_hash).once
50
53
  described_class.from_url('/api/security/groups/readers')
51
54
  end
@@ -3,6 +3,8 @@ require 'spec_helper'
3
3
  module Artifactory
4
4
  describe Resource::PermissionTarget do
5
5
  let(:client) { double(:client) }
6
+ let(:endpoint_host) { 'http://33.33.33.11' }
7
+ let(:endpoint) { "#{endpoint_host}/" }
6
8
 
7
9
  before(:each) do
8
10
  allow(Artifactory).to receive(:client).and_return(client)
@@ -46,6 +48,7 @@ module Artifactory
46
48
  let(:response) { {} }
47
49
 
48
50
  it 'constructs a new instance from the result' do
51
+ expect(client).to receive(:endpoint).and_return(endpoint)
49
52
  expect(described_class).to receive(:from_hash).once
50
53
  described_class.from_url('/api/security/permissions/AnyRemote')
51
54
  end
@@ -3,6 +3,8 @@ require 'spec_helper'
3
3
  module Artifactory
4
4
  describe Resource::User do
5
5
  let(:client) { double(:client) }
6
+ let(:endpoint_host) { 'http://33.33.33.11' }
7
+ let(:endpoint) { "#{endpoint_host}/" }
6
8
 
7
9
  before(:each) do
8
10
  allow(Artifactory).to receive(:client).and_return(client)
@@ -46,6 +48,7 @@ module Artifactory
46
48
  let(:response) { {} }
47
49
 
48
50
  it 'constructs a new instance from the result' do
51
+ expect(client).to receive(:endpoint).and_return(endpoint)
49
52
  expect(described_class).to receive(:from_hash).once
50
53
  described_class.from_url('/api/security/users/readers')
51
54
  end
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.1
4
+ version: 2.3.2
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-14 00:00:00.000000000 Z
11
+ date: 2015-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler