summaryrefslogtreecommitdiff
path: root/chef/lib/chef/config.rb
diff options
context:
space:
mode:
authorChristopher Brown <cb@opscode.com>2009-08-24 16:33:31 -0700
committerChristopher Brown <cb@opscode.com>2009-08-24 16:33:31 -0700
commit535d2b52c92cc724789f9921dc2db77e58f97e8b (patch)
tree607bb37bcd596398adcaf73757db80d0e2c84dec /chef/lib/chef/config.rb
parent65ee6a208e304f30278224b03f8e2b9d46f2a622 (diff)
downloadchef-535d2b52c92cc724789f9921dc2db77e58f97e8b.tar.gz
use config_attr_writer
Diffstat (limited to 'chef/lib/chef/config.rb')
-rw-r--r--chef/lib/chef/config.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/chef/lib/chef/config.rb b/chef/lib/chef/config.rb
index d198bec208..e9375b1296 100644
--- a/chef/lib/chef/config.rb
+++ b/chef/lib/chef/config.rb
@@ -47,7 +47,7 @@ class Chef
# === Parameters
# url<String>:: String to be set for all of the chef-server-api URL's
#
- def self.chef_server_url=(url)
+ config_attr_writer :chef_server_url do |url|
configure do |c|
[ :registration_url,
:openid_url,
@@ -58,14 +58,16 @@ class Chef
c[u] = url
end
end
+ url
end
+
# Override the config dispatch to set the value of log_location configuration option
#
# === Parameters
# location<IO||String>:: Logging location as either an IO stream or string representing log file path
#
- def self.log_location=(location)
- configure { |c| c[:log_location] = (location.respond_to?(:sync=) ? location : File.new(location, "a")) }
+ config_attr_writer :log_location do |location|
+ (location.respond_to?(:sync=) ? location : File.new(location, "a"))
end
# Override the config dispatch to set the value of authorized_openid_providers when openid_providers (deprecated) is used
@@ -73,8 +75,9 @@ class Chef
# === Parameters
# providers<Array>:: An array of openid providers that are authorized to login to the chef server
#
- def self.openid_providers=(providers)
- configure { |c| c[:authorized_openid_provders] = providers }
+ config_attr_writer :openid_providers do |providers|
+ configure { |c| c[:authorized_openid_providers] = providers }
+ providers
end
authorized_openid_identifiers nil