Skip to content
Browse files

Only create methods if we have settings to create them off of

  • Loading branch information...
1 parent b2452d9 commit 9672fa388b3d95a5f29f4319846328384aa73d63 @binarylogic committed Dec 5, 2008
Showing with 6 additions and 1 deletion.
  1. +4 −0 CHANGELOG.rdoc
  2. +2 −1 lib/settingslogic/settings.rb
View
4 CHANGELOG.rdoc
@@ -1,3 +1,7 @@
+== 1.0.0 released 2008-12-05
+
+* Only define methods if we have settings.
+
== 0.9.0 released 2008-10-30
* Initial release
View
3 lib/settingslogic/settings.rb
@@ -44,7 +44,7 @@ def initialize(name_or_hash = Config.settings_file)
self._settings = YAML.load(ERB.new(File.read(file_path)).result)
self._settings = _settings[RAILS_ENV] if defined?(RAILS_ENV)
else
- raise ArgumentError.new("Your settings must be a hash or a name of a file via a String or a Symbol")
+ raise ArgumentError.new("Your settings must be a hash, a symbol representing the name of the .yml file in your config directory, or a string representing the abosolute path to your settings file.")
end
define_settings!
end
@@ -55,6 +55,7 @@ def method_missing(name, *args, &block)
end
def define_settings!
+ return if _settings.nil?
_settings.each do |key, value|
case value
when Hash

0 comments on commit 9672fa3

Please sign in to comment.
Something went wrong with that request. Please try again.