[DRE-commits] [librarian-puppet] 135/153: Upgrade to puppet_forge 2

Stig Sandbeck Mathisen ssm at debian.org
Wed Jun 1 20:30:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository librarian-puppet.

commit 249179cac845acb95fad934ead95fa024ef80e04
Author: Reto Kaiser <reto at cargomedia.ch>
Date:   Sun Jan 3 14:24:40 2016 +0100

    Upgrade to puppet_forge 2
---
 lib/librarian/puppet/source/forge/repo_v3.rb | 11 +++++++----
 librarian-puppet.gemspec                     |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/librarian/puppet/source/forge/repo_v3.rb b/lib/librarian/puppet/source/forge/repo_v3.rb
index 533bdd7..1a86898 100644
--- a/lib/librarian/puppet/source/forge/repo_v3.rb
+++ b/lib/librarian/puppet/source/forge/repo_v3.rb
@@ -20,7 +20,7 @@ module Librarian
           end
 
           def dependencies(version)
-            array = get_release(version).metadata[:dependencies].map{|d| [d['name'], d['version_requirement']]}
+            array = get_release(version).metadata[:dependencies].map{|d| [d[:name], d[:version_requirement]]}
             Hash[*array.flatten(1)]
           end
 
@@ -30,7 +30,7 @@ module Librarian
             else
               # should never get here as we use one repo object for each module (to be changed in the future)
               debug { "Looking up url for #{name}@#{version}" }
-              release = PuppetForge::Release.find("#{name}-#{version}")
+              release = PuppetForge::V3::Release.find("#{name}-#{version}")
             end
             "#{source}#{release.file_uri}"
           end
@@ -38,8 +38,11 @@ module Librarian
         private
 
           def get_module
-            @module ||= PuppetForge::Module.find(name)
-            raise(Error, "Unable to find module '#{name}' on #{source}") unless @module
+            begin
+              @module ||= PuppetForge::V3::Module.find(name)
+            rescue Faraday::ResourceNotFound => e
+              raise(Error, "Unable to find module '#{name}' on #{source}")
+            end
             @module
           end
 
diff --git a/librarian-puppet.gemspec b/librarian-puppet.gemspec
index 10cf9c4..f0a03ea 100644
--- a/librarian-puppet.gemspec
+++ b/librarian-puppet.gemspec
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
 
   s.add_dependency "librarianp", ">=0.6.3"
   s.add_dependency "rsync"
-  s.add_dependency "puppet_forge", "~> 1.0"
+  s.add_dependency "puppet_forge", "~> 2.1"
 
   s.add_development_dependency "rake"
   s.add_development_dependency "rspec"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/librarian-puppet.git



More information about the Pkg-ruby-extras-commits mailing list