Permalink
Browse files

Gibbler::Hash and Gibbler::Array now skip values that have no __gibbl…

…er method
  • Loading branch information...
1 parent 586a902 commit 76dbf67e00e7fe442c0a1a26b2c19ecc971800c9 @delano committed Oct 23, 2011
Showing with 54 additions and 43 deletions.
  1. +4 −0 CHANGES.txt
  2. +1 −1 VERSION.yml
  3. +40 −41 gibbler.gemspec
  4. +9 −1 lib/gibbler.rb
View
@@ -1,5 +1,9 @@
GIBBLER, CHANGES
+#### 0.8.10 (2011-10-23) ###############################
+
+* CHANGE: Gibbler::Hash and Gibbler::Array now skip values that have no __gibbler method
+
#### 0.8.9 (2011-02-11) ###############################
* FIXED: Remove debug output.
View
@@ -1,4 +1,4 @@
---
:MAJOR: 0
:MINOR: 8
-:PATCH: 9
+:PATCH: 10
View
@@ -1,59 +1,58 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{gibbler}
- s.version = "0.8.9"
+ s.name = "gibbler"
+ s.version = "0.8.10"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Delano Mandelbaum"]
- s.date = %q{2011-02-11}
- s.description = %q{Gibbler: Git-like hashes for Ruby objects}
- s.email = %q{delano@solutious.com}
+ s.date = "2011-10-23"
+ s.description = "Gibbler: Git-like hashes for Ruby objects"
+ s.email = "delano@solutious.com"
s.extra_rdoc_files = [
"LICENSE.txt",
- "README.rdoc"
+ "README.rdoc"
]
s.files = [
"CHANGES.txt",
- "LICENSE.txt",
- "README.rdoc",
- "Rakefile",
- "VERSION.yml",
- "gibbler.gemspec",
- "lib/gibbler.rb",
- "lib/gibbler/aliases.rb",
- "lib/gibbler/history.rb",
- "lib/gibbler/mixins.rb",
- "try/01_mixins_try.rb",
- "try/02_compat_try.rb",
- "try/05_gibbler_digest_try.rb",
- "try/10_basic_try.rb",
- "try/11_basic_sha256_try.rb",
- "try/14_extended_try.rb",
- "try/15_file_try.rb",
- "try/16_uri_try.rb",
- "try/17_complex_object_try.rb",
- "try/18_proc_try.rb",
- "try/20_time_try.rb",
- "try/30_secret_try.rb",
- "try/50_history_try.rb",
- "try/51_hash_history_try.rb",
- "try/52_array_history_try.rb",
- "try/53_string_history_try.rb",
- "try/57_arbitrary_history_try.rb",
- "try/59_history_exceptions_try.rb",
- "try/80_performance_try.rb",
- "try/90_alias_try.rb"
+ "LICENSE.txt",
+ "README.rdoc",
+ "Rakefile",
+ "VERSION.yml",
+ "gibbler.gemspec",
+ "lib/gibbler.rb",
+ "lib/gibbler/aliases.rb",
+ "lib/gibbler/history.rb",
+ "lib/gibbler/mixins.rb",
+ "try/01_mixins_try.rb",
+ "try/02_compat_try.rb",
+ "try/05_gibbler_digest_try.rb",
+ "try/10_basic_try.rb",
+ "try/11_basic_sha256_try.rb",
+ "try/14_extended_try.rb",
+ "try/15_file_try.rb",
+ "try/16_uri_try.rb",
+ "try/17_complex_object_try.rb",
+ "try/18_proc_try.rb",
+ "try/20_time_try.rb",
+ "try/30_secret_try.rb",
+ "try/50_history_try.rb",
+ "try/51_hash_history_try.rb",
+ "try/52_array_history_try.rb",
+ "try/53_string_history_try.rb",
+ "try/57_arbitrary_history_try.rb",
+ "try/59_history_exceptions_try.rb",
+ "try/80_performance_try.rb",
+ "try/90_alias_try.rb"
]
- s.homepage = %q{http://github.com/delano/gibbler}
- s.rdoc_options = ["--charset=UTF-8"]
+ s.homepage = "http://github.com/delano/gibbler"
s.require_paths = ["lib"]
- s.rubyforge_project = %q{gibbler}
- s.rubygems_version = %q{1.5.2}
- s.summary = %q{Gibbler: Git-like hashes for Ruby objects}
+ s.rubyforge_project = "gibbler"
+ s.rubygems_version = "1.8.10"
+ s.summary = "Gibbler: Git-like hashes for Ruby objects"
if s.respond_to? :specification_version then
s.specification_version = 3
View
@@ -411,6 +411,10 @@ def __gibbler(digest_type=nil)
d = self.keys.sort { |a,b| a.inspect <=> b.inspect }
d.collect! do |name|
value = self[name]
+ unless value.respond_to? :__gibbler
+ gibbler_debug klass, :skipping, name
+ next
+ end
'%s:%s:%s' % [value.class, name, value.__gibbler(digest_type)]
end
d = d.join(':').__gibbler(digest_type)
@@ -449,7 +453,11 @@ def self.included(obj)
def __gibbler(digest_type=nil)
klass = self.class
d, index = [], 0
- self.each do |value|
+ self.each_with_index do |value,idx|
+ unless value.respond_to? :__gibbler
+ gibbler_debug klass, :skipping, idx
+ next
+ end
d << '%s:%s:%s' % [value.class, index, value.__gibbler(digest_type)]
index += 1
end

0 comments on commit 76dbf67

Please sign in to comment.