Permalink
Browse files

ignore empty group

  • Loading branch information...
1 parent 16244ed commit 4a94cc43d7bd808040f2a0a0c035cfacd09b9e6c @funny-falcon committed May 12, 2012
Showing with 7 additions and 5 deletions.
  1. +6 −4 lib/funfig.rb
  2. +1 −1 lib/funfig/version.rb
View
@@ -52,9 +52,11 @@ def load_file(filename)
# Update config by hash
def update(hash)
- hash.each{|k, v|
- self.send("#{k}=", v)
- }
+ if hash.respond_to?(:each)
+ hash.each{|k, v|
+ self.send("#{k}=", v)
+ }
+ end
end
# Iterate over parameter names
@@ -164,7 +166,7 @@ def self.group(name, &block)
end
define_method("#{name}=") do |hash|
- send(name).update(hash)
+ send(name).update(hash) if hash
end
define_method("#{name}_reset!") do
@@ -1,3 +1,3 @@
module Funfig
- VERSION = "0.0.2"
+ VERSION = "0.0.3"
end

0 comments on commit 4a94cc4

Please sign in to comment.