Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ignore empty group

  • Loading branch information...
commit 4a94cc43d7bd808040f2a0a0c035cfacd09b9e6c 1 parent 16244ed
Sokolov Yura authored
Showing with 7 additions and 5 deletions.
  1. +6 −4 lib/funfig.rb
  2. +1 −1  lib/funfig/version.rb
10 lib/funfig.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
2  lib/funfig/version.rb
View
@@ -1,3 +1,3 @@
module Funfig
- VERSION = "0.0.2"
+ VERSION = "0.0.3"
end
Please sign in to comment.
Something went wrong with that request. Please try again.