[DRE-commits] [librarian-puppet] 89/153: Update librarianp to remove duplicated code
Stig Sandbeck Mathisen
ssm at debian.org
Wed Jun 1 20:30:47 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 cba05895a01678ea367062d48a5762cc4d846b8e
Author: Carlos Sanchez <carlos at apache.org>
Date: Wed Feb 25 14:59:30 2015 +0100
Update librarianp to remove duplicated code
---
lib/librarian/puppet/dsl.rb | 35 ++++++++++++-----------------------
librarian-puppet.gemspec | 2 +-
2 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/lib/librarian/puppet/dsl.rb b/lib/librarian/puppet/dsl.rb
index 27c378b..297098f 100644
--- a/lib/librarian/puppet/dsl.rb
+++ b/lib/librarian/puppet/dsl.rb
@@ -15,32 +15,21 @@ module Librarian
source :path => Source::Path
source :github_tarball => Source::GitHubTarball
- # copied from Librarian::Dsl to use our own Receiver
- def run(specfile = nil, sources = [])
- specfile, sources = nil, specfile if specfile.kind_of?(Array) && sources.empty?
-
- if specfile.kind_of?(Pathname) and !File.exists?(specfile)
- debug { "Specfile not found, using defaults: #{specfile}" }
- specfile = Proc.new do
- forge FORGE_URL
- metadata
- end
+ def default_specfile
+ Proc.new do
+ forge FORGE_URL
+ metadata
end
+ end
- Target.new(self).tap do |target|
- target.precache_sources(sources)
- debug_named_source_cache("Pre-Cached Sources", target)
-
- specfile ||= Proc.new if block_given?
- receiver = Receiver.new(target)
- receiver.run(specfile)
-
- # save the default forge defined
- default_forge = target.sources.select {|s| s.is_a? Librarian::Puppet::Source::Forge}.first
- Librarian::Puppet::Source::Forge.default = default_forge || Librarian::Puppet::Source::Forge.from_lock_options(environment, :remote => FORGE_URL)
+ def post_process_target(target)
+ # save the default forge defined
+ default_forge = target.sources.select {|s| s.is_a? Librarian::Puppet::Source::Forge}.first
+ Librarian::Puppet::Source::Forge.default = default_forge || Librarian::Puppet::Source::Forge.from_lock_options(environment, :remote => FORGE_URL)
+ end
- debug_named_source_cache("Post-Cached Sources", target)
- end.to_spec
+ def receiver(target)
+ Receiver.new(target)
end
class Receiver < Librarian::Dsl::Receiver
diff --git a/librarian-puppet.gemspec b/librarian-puppet.gemspec
index 8fed901..4193d40 100644
--- a/librarian-puppet.gemspec
+++ b/librarian-puppet.gemspec
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.executables = ['librarian-puppet']
- s.add_dependency "librarianp", ">=0.2.0"
+ s.add_dependency "librarianp", ">=0.3.0"
s.add_dependency "rsync"
s.add_dependency "puppet_forge"
--
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