[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
test branch
puppet-dev at googlegroups.com
Wed Jul 14 10:30:49 UTC 2010
The following commit has been merged in the upstream branch:
commit d93d80a0afdbd53d87dc4a7498609117091e864b
Author: Luke Kanies <luke at madstop.com>
Date: Sat Nov 7 15:21:19 2009 -0600
Using Logging module in main Puppet module
We've had essentially duplicate methods in this module
forever, and this just removes that duplication.
Signed-off-by: Luke Kanies <luke at madstop.com>
diff --git a/lib/puppet.rb b/lib/puppet.rb
index a78853a..3c5eebb 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -9,7 +9,6 @@ require 'singleton'
require 'facter'
require 'puppet/error'
require 'puppet/util'
-require 'puppet/util/log'
require 'puppet/util/autoload'
require 'puppet/util/settings'
require 'puppet/util/feature'
@@ -42,23 +41,9 @@ module Puppet
# The services running in this process.
@services ||= []
- # define helper messages for each of the message levels
- Puppet::Util::Log.eachlevel { |level|
- define_method(level,proc { |args|
- if args.is_a?(Array)
- args = args.join(" ")
- end
- Puppet::Util::Log.create(
- :level => level,
- :message => args
- )
- })
- module_function level
- }
-
- # I keep wanting to use Puppet.error
- # XXX this isn't actually working right now
- alias :error :err
+ require 'puppet/util/logging'
+
+ extend Puppet::Util::Logging
# The feature collection
@features = Puppet::Util::Feature.new('puppet/feature')
diff --git a/spec/unit/puppet.rb b/spec/unit/puppet.rb
new file mode 100755
index 0000000..0783429
--- /dev/null
+++ b/spec/unit/puppet.rb
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby"
+
+require File.dirname(__FILE__) + '/../spec_helper'
+require 'puppet'
+
+describe Puppet do
+ Puppet::Util::Log.eachlevel do |level|
+ it "should have a method for sending '#{level}' logs" do
+ Puppet.should respond_to(level)
+ end
+ end
+end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list