puppet_forge 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/puppet_forge.rb +11 -2
- data/lib/puppet_forge/v3/release.rb +1 -1
- data/lib/puppet_forge/version.rb +1 -1
- data/spec/unit/forge/v3/release_spec.rb +15 -0
- data/spec/unit/puppet_forge_spec.rb +15 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb6c13dde0b75c97be8726b4b9e754fba7a3c37e
|
4
|
+
data.tar.gz: 0d0e3a9112d81e3a459c7e37f245a6a0afe5d50e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9d21c14690d2ae563bc1c166ffba9b7507d33cd9fbb5ef81d4ce2ba1351d4fc58fa486e0fec8470694cb746e3d32b31b4ae4e9d44eda6d72eb8c73e1934869f
|
7
|
+
data.tar.gz: f96f9901f85f25e04d3d800c54945212342c49b36391d999e670752c1eec0648a055559f23fe86c787324fea6e5165d899068190198ba6d8a5458b77b28ff4e4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,13 @@
|
|
3
3
|
Starting with v2.0.0, all notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## v2.2.5 - 2017-06-26
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
* (FORGE-338) Fixed an issue where `V3::Release.download_url` returned an incorrect value when `PuppetForge.host` included
|
11
|
+
a path prefix. (Thanks to [Jainish Shah](https://github.com/jainishshah17) for the report and initial fix proposal.)
|
12
|
+
|
6
13
|
## v2.2.4 - 2017-04-17
|
7
14
|
|
8
15
|
### Added
|
data/lib/puppet_forge.rb
CHANGED
@@ -4,12 +4,21 @@ require 'gettext-setup'
|
|
4
4
|
module PuppetForge
|
5
5
|
class << self
|
6
6
|
attr_accessor :user_agent
|
7
|
-
|
7
|
+
attr_reader :host
|
8
|
+
|
9
|
+
def host=(new_host)
|
10
|
+
new_host << '/' unless new_host[-1] == '/'
|
11
|
+
|
12
|
+
# TODO: maybe freeze this
|
13
|
+
@host = new_host
|
14
|
+
end
|
8
15
|
end
|
9
16
|
|
10
17
|
GettextSetup.initialize(File.absolute_path('../locales', File.dirname(__FILE__)))
|
11
18
|
|
12
|
-
|
19
|
+
DEFAULT_FORGE_HOST = 'https://forgeapi.puppetlabs.com/'
|
20
|
+
|
21
|
+
self.host = DEFAULT_FORGE_HOST
|
13
22
|
|
14
23
|
require 'puppet_forge/tar'
|
15
24
|
require 'puppet_forge/unpacker'
|
@@ -13,7 +13,7 @@ module PuppetForge
|
|
13
13
|
# @return [String] fully qualified download URL for release
|
14
14
|
def download_url
|
15
15
|
if URI.parse(file_uri).host.nil?
|
16
|
-
URI.join(PuppetForge.host, file_uri).to_s
|
16
|
+
URI.join(PuppetForge.host, file_uri[1..-1]).to_s
|
17
17
|
else
|
18
18
|
file_uri
|
19
19
|
end
|
data/lib/puppet_forge/version.rb
CHANGED
@@ -96,6 +96,21 @@ describe PuppetForge::V3::Release do
|
|
96
96
|
release.file_uri = 'https://example.com/v3/files/puppetlabs-apache-0.0.1.tar.gz'
|
97
97
|
expect(release.download_url).to eql('https://example.com/v3/files/puppetlabs-apache-0.0.1.tar.gz')
|
98
98
|
end
|
99
|
+
|
100
|
+
context 'when PuppetForge.host has a path prefix' do
|
101
|
+
around(:each) do |spec|
|
102
|
+
old_host = PuppetForge.host
|
103
|
+
PuppetForge.host = 'http://example.com/forge/api/'
|
104
|
+
|
105
|
+
spec.run
|
106
|
+
|
107
|
+
PuppetForge.host = old_host
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'includes path prefix in download url' do
|
111
|
+
expect(release.download_url).to eql('http://example.com/forge/api/v3/files/puppetlabs-apache-0.0.1.tar.gz')
|
112
|
+
end
|
113
|
+
end
|
99
114
|
end
|
100
115
|
|
101
116
|
describe '#download' do
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe PuppetForge do
|
4
|
+
describe 'host attribute' do
|
5
|
+
after(:each) do
|
6
|
+
PuppetForge.host = PuppetForge::DEFAULT_FORGE_HOST
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should add a trailing slash if not present' do
|
10
|
+
PuppetForge.host = 'http://example.com'
|
11
|
+
|
12
|
+
expect(PuppetForge.host[-1,1]).to eq '/'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet_forge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -282,6 +282,7 @@ files:
|
|
282
282
|
- spec/unit/forge/v3/module_spec.rb
|
283
283
|
- spec/unit/forge/v3/release_spec.rb
|
284
284
|
- spec/unit/forge/v3/user_spec.rb
|
285
|
+
- spec/unit/puppet_forge_spec.rb
|
285
286
|
homepage: https://github.com/puppetlabs/forge-ruby
|
286
287
|
licenses:
|
287
288
|
- Apache-2.0
|
@@ -357,4 +358,5 @@ test_files:
|
|
357
358
|
- spec/unit/forge/v3/module_spec.rb
|
358
359
|
- spec/unit/forge/v3/release_spec.rb
|
359
360
|
- spec/unit/forge/v3/user_spec.rb
|
361
|
+
- spec/unit/puppet_forge_spec.rb
|
360
362
|
has_rdoc:
|