puppet_forge 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,12 @@
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.1.3 - 2016-01-25
7
+
8
+ ### Changed
9
+
10
+ * PuppetForge::V3::Release.download will now use the "file\_uri" field of the Release API response to calculate the URI to download from. (Thanks to [ericparton](https://github.com/ericparton) for the contribution.)
11
+
6
12
  ## v2.1.2 - 2015-12-16
7
13
 
8
14
  ### Changed
@@ -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
- PuppetForge.host + file_uri
16
+ URI.join(PuppetForge.host, file_uri).to_s
17
17
  else
18
18
  file_uri
19
19
  end
@@ -24,7 +24,7 @@ module PuppetForge
24
24
  # @param path [Pathname]
25
25
  # @return [void]
26
26
  def download(path)
27
- resp = self.class.conn.get(file_url)
27
+ resp = self.class.conn.get(download_url)
28
28
  path.open('wb') { |fh| fh.write(resp.body) }
29
29
  rescue Faraday::ResourceNotFound => e
30
30
  raise PuppetForge::ReleaseNotFound, "The module release #{slug} does not exist on #{self.class.conn.url_prefix}.", e.backtrace
@@ -48,16 +48,6 @@ module PuppetForge
48
48
  end
49
49
  end
50
50
 
51
- private
52
-
53
- def file_url
54
- "/v3/files/#{slug}.tar.gz"
55
- end
56
-
57
- def resource_url
58
- "/v3/releases/#{slug}"
59
- end
60
-
61
51
  class ChecksumMismatch < StandardError
62
52
  end
63
53
 
@@ -1,3 +1,3 @@
1
1
  module PuppetForge
2
- VERSION = '2.1.2' # Library version
2
+ VERSION = '2.1.3' # Library version
3
3
  end
@@ -48,7 +48,8 @@ describe PuppetForge::V3::Release do
48
48
 
49
49
  it 'handles an API response that does not include a scheme and host' do
50
50
  release.file_uri = '/v3/files/puppetlabs-apache-0.0.1.tar.gz'
51
- expect(release.download_url).to eql(PuppetForge.host + '/v3/files/puppetlabs-apache-0.0.1.tar.gz')
51
+ uri_with_host = URI.join(PuppetForge.host, '/v3/files/puppetlabs-apache-0.0.1.tar.gz').to_s
52
+ expect(release.download_url).to eql(uri_with_host)
52
53
  end
53
54
 
54
55
  it 'handles an API response that includes a scheme and host' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_forge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-17 00:00:00.000000000 Z
12
+ date: 2016-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -293,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  version: '0'
294
294
  segments:
295
295
  - 0
296
- hash: -3862715394005484998
296
+ hash: -3937561798561843992
297
297
  requirements: []
298
298
  rubyforge_project:
299
299
  rubygems_version: 1.8.29