Permalink
Browse files

CHANGE: Gibbler::Complex will skip fields with no __gibbler method

  • Loading branch information...
1 parent 22f2b19 commit b2f8a89206f9ffbe97a1c58b16991c7b19322191 @delano committed Dec 23, 2010
Showing with 10 additions and 0 deletions.
  1. +5 −0 CHANGES.txt
  2. +5 −0 lib/gibbler.rb
View
5 CHANGES.txt
@@ -1,5 +1,10 @@
GIBBLER, CHANGES
+#### 0.8.5 (2010-12-23) ###############################
+
+* CHANGE: Gibbler::Complex will skip fields with no __gibbler method
+* ADDED: Gibbler.debug=
+
#### 0.8.4 (2010-06-19) ###############################
View
5 lib/gibbler.rb
@@ -223,6 +223,7 @@ def self.digest_type=(v)
def self.debug?; @@gibbler_debug; end
def self.enable_debug; @@gibbler_debug = true; end
def self.disable_debug; @@gibbler_debug = false; end
+ def self.debug=(v); @@gibbler_debug = v; end
# Returns the current digest class.
def self.digest_type; @@gibbler_digest_type; end
@@ -314,6 +315,10 @@ def __gibbler(digest_type=nil)
gibbler_debug :gibbler_fields, gibbler_fields
gibbler_fields.each do |n|
value = instance_variable_get("@#{n}")
+ unless value.respond_to? :__gibbler
+ gibbler_debug klass, :skipping, n
+ next
+ end
d << '%s:%s:%s' % [value.class, n, value.__gibbler(digest_type)]
end
d = d.join(':').__gibbler(digest_type)

0 comments on commit b2f8a89

Please sign in to comment.