summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/indirector.rb8
-rw-r--r--lib/puppet/parser/scope.rb3
-rw-r--r--lib/puppet/parser/templatewrapper.rb4
-rw-r--r--lib/puppet/provider/ldap.rb2
-rw-r--r--lib/puppet/resource.rb3
-rw-r--r--lib/puppet/resource/catalog.rb2
-rw-r--r--lib/puppet/resource/reference.rb4
-rw-r--r--lib/puppet/util/cacher.rb2
-rw-r--r--lib/puppet/util/settings.rb2
-rwxr-xr-xspec/unit/network/authconfig.rb2
-rwxr-xr-xspec/unit/network/rest_authconfig.rb2
-rwxr-xr-xspec/unit/network/rest_authorization.rb6
12 files changed, 20 insertions, 20 deletions
diff --git a/lib/puppet/indirector.rb b/lib/puppet/indirector.rb
index 1beb68ec0..61ef2db29 100644
--- a/lib/puppet/indirector.rb
+++ b/lib/puppet/indirector.rb
@@ -44,19 +44,19 @@ module Puppet::Indirector
# Expire any cached instance.
def expire(*args)
- indirection.expire *args
+ indirection.expire(*args)
end
def find(*args)
- indirection.find *args
+ indirection.find(*args)
end
def destroy(*args)
- indirection.destroy *args
+ indirection.destroy(*args)
end
def search(*args)
- indirection.search *args
+ indirection.search(*args)
end
end
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 77e7b0cfd..b1f480ca6 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -15,9 +15,10 @@ class Puppet::Parser::Scope
include Enumerable
include Puppet::Util::Errors
- attr_accessor :parent, :level, :parser, :source, :resource
+ attr_accessor :level, :parser, :source, :resource
attr_accessor :base, :keyword, :nodescope
attr_accessor :top, :translated, :compiler
+ attr_writer :parent
# A demeterific shortcut to the catalog.
def catalog
diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb
index 00faf33a1..97b454569 100644
--- a/lib/puppet/parser/templatewrapper.rb
+++ b/lib/puppet/parser/templatewrapper.rb
@@ -3,7 +3,9 @@
require 'puppet/parser/files'
class Puppet::Parser::TemplateWrapper
- attr_accessor :scope, :file, :string
+ attr_writer :scope
+ attr_reader :file
+ attr_accessor :string
include Puppet::Util
Puppet::Util.logmethods(self)
diff --git a/lib/puppet/provider/ldap.rb b/lib/puppet/provider/ldap.rb
index 76834f94d..970ac5202 100644
--- a/lib/puppet/provider/ldap.rb
+++ b/lib/puppet/provider/ldap.rb
@@ -38,8 +38,6 @@ class Puppet::Provider::Ldap < Puppet::Provider
end
end
- attr_reader :ldap_properties
-
def manager
self.class.manager
end
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index 7082e261f..b4458e638 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -7,7 +7,8 @@ require 'puppet/resource/reference'
class Puppet::Resource
include Puppet::Util::Tagging
include Enumerable
- attr_accessor :type, :title, :file, :line, :catalog, :exported
+ attr_accessor :file, :line, :catalog, :exported
+ attr_writer :type, :title
# Proxy these methods to the parameters hash. It's likely they'll
# be overridden at some point, but this works for now.
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb
index 859daa654..c885c8d78 100644
--- a/lib/puppet/resource/catalog.rb
+++ b/lib/puppet/resource/catalog.rb
@@ -130,7 +130,7 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph
transaction.tags = options[:tags] if options[:tags]
transaction.ignoreschedules = true if options[:ignoreschedules]
- transaction.addtimes :config_retrieval => @retrieval_duration
+ transaction.addtimes :config_retrieval => self.retrieval_duration
begin
diff --git a/lib/puppet/resource/reference.rb b/lib/puppet/resource/reference.rb
index 968274523..b08f2a380 100644
--- a/lib/puppet/resource/reference.rb
+++ b/lib/puppet/resource/reference.rb
@@ -8,8 +8,8 @@ require 'puppet/resource'
# A simple class to canonize how we refer to and retrieve
# resources.
class Puppet::Resource::Reference
- attr_reader :type
- attr_accessor :title, :catalog
+ attr_reader :type, :title
+ attr_accessor :catalog
def ==(other)
other.respond_to?(:title) and self.type == other.type and self.title == other.title
diff --git a/lib/puppet/util/cacher.rb b/lib/puppet/util/cacher.rb
index 2996dc9c6..28786ab53 100644
--- a/lib/puppet/util/cacher.rb
+++ b/lib/puppet/util/cacher.rb
@@ -58,7 +58,7 @@ module Puppet::Util::Cacher
end
def attr_ttl(name)
- return nil unless @attr_ttls
+ return nil unless defined?(@attr_ttls) and @attr_ttls
@attr_ttls[name]
end
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 6a94c0df2..0871ee869 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -821,8 +821,6 @@ Generated on #{Time.now}.
end
result[:value] = value.sub(/\s*$/, '')
return result
-
- return nil
end
# Convert arguments into booleans, integers, or whatever.
diff --git a/spec/unit/network/authconfig.rb b/spec/unit/network/authconfig.rb
index f6665234b..2bf9ee138 100755
--- a/spec/unit/network/authconfig.rb
+++ b/spec/unit/network/authconfig.rb
@@ -11,7 +11,7 @@ describe Puppet::Network::AuthConfig do
@rights.stubs(:each).returns([])
FileTest.stubs(:exists?).returns(true)
- File.stubs(:stat).returns(stub 'stat', :ctime => :now)
+ File.stubs(:stat).returns(stub('stat', :ctime => :now))
Time.stubs(:now).returns :now
@authconfig = Puppet::Network::AuthConfig.new("dummy", false)
diff --git a/spec/unit/network/rest_authconfig.rb b/spec/unit/network/rest_authconfig.rb
index 7b1957d2f..48ec0cd5e 100755
--- a/spec/unit/network/rest_authconfig.rb
+++ b/spec/unit/network/rest_authconfig.rb
@@ -20,7 +20,7 @@ describe Puppet::Network::RestAuthConfig do
before :each do
FileTest.stubs(:exists?).returns(true)
- File.stubs(:stat).returns(stub 'stat', :ctime => :now)
+ File.stubs(:stat).returns(stub('stat', :ctime => :now))
Time.stubs(:now).returns :now
@authconfig = Puppet::Network::RestAuthConfig.new("dummy", false)
diff --git a/spec/unit/network/rest_authorization.rb b/spec/unit/network/rest_authorization.rb
index db42dd752..4703c181f 100755
--- a/spec/unit/network/rest_authorization.rb
+++ b/spec/unit/network/rest_authorization.rb
@@ -31,13 +31,13 @@ describe Puppet::Network::RestAuthorization do
it "should raise an AuthorizationError if authconfig raises an AuthorizationError" do
@authconfig.expects(:allowed?).with(@request).raises(Puppet::Network::AuthorizationError.new("forbidden"))
- lambda { @auth.check_authorization(@request) }.should raise_error Puppet::Network::AuthorizationError
+ lambda { @auth.check_authorization(@request) }.should raise_error(Puppet::Network::AuthorizationError)
end
it "should not raise an AuthorizationError if request is allowed" do
@authconfig.expects(:allowed?).with(@request).returns(true)
- lambda { @auth.check_authorization(@request) }.should_not raise_error Puppet::Network::AuthorizationError
+ lambda { @auth.check_authorization(@request) }.should_not raise_error(Puppet::Network::AuthorizationError)
end
end
-end \ No newline at end of file
+end