gibbler 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/CHANGES.txt +12 -1
  2. data/gibbler.gemspec +1 -1
  3. data/lib/gibbler.rb +14 -10
  4. metadata +2 -2
data/CHANGES.txt CHANGED
@@ -1,12 +1,23 @@
1
1
  GIBBLER, CHANGES
2
2
 
3
- #### 0.8.0 (2010-04-??) ###############################
3
+ #### 0.8.1 (2010-04-11) ###############################
4
+
5
+ NOTE: Digest calculation for Range objects has changed.
6
+ Ranges or objects containing Ranges will have different
7
+ digests than those created in previous releases.
8
+
9
+ * FIXED: "can't iterate from Float" error for Ranges containing a Float
10
+ * CHANGE: Range digests are now based on the format "CLASS:FIRST:LAST:VALUE"
11
+
12
+
13
+ #### 0.8.0 (2010-04-08) ###############################
4
14
 
5
15
  * CHANGE: Gibber::Object#__gibbler now accepts only 1 optional argument: digest_type
6
16
  * ADDED: Gibbler::Digest#to_i which assumes base 16
7
17
  * ADDED: Gibbler::Object#gibbler now accepts a digest type
8
18
  * ADDED: Gibbler::Digest#to_s and #base can take a base argument
9
19
 
20
+
10
21
  #### 0.7.7 (2010-03-29) ###############################
11
22
 
12
23
  * ADDED: Gibbler::Digest#shorten
data/gibbler.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "gibbler"
3
3
  s.rubyforge_project = "gibbler"
4
- s.version = "0.8.0"
4
+ s.version = "0.8.1"
5
5
  s.summary = "Gibbler: Git-like hashes for Ruby objects"
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
data/lib/gibbler.rb CHANGED
@@ -15,7 +15,7 @@ require 'digest/sha1'
15
15
  # "Hola, Tanneritos"
16
16
  #
17
17
  module Gibbler
18
- VERSION = "0.8.0"
18
+ VERSION = "0.8.1"
19
19
 
20
20
  require 'gibbler/mixins'
21
21
 
@@ -498,13 +498,14 @@ module Gibbler
498
498
 
499
499
  end
500
500
 
501
- # Creates a digest based on: <tt>CLASS:LENGTH:VALUE</tt>
502
- # where LENGTH is the number of elements in the range
503
- # and VALUE is the string representation of the range.
501
+ # Creates a digest based on: <tt>CLASS:EXCLUDE?:FIRST:LAST</tt>
502
+ # where EXCLUDE? is a boolean value whether the Range excludes
503
+ # the last value (i.e. 1...100) and FIRST and LAST are the values
504
+ # returned by Range#first and Range#last.
504
505
  # e.g.
505
506
  #
506
- # (1..100) => Range:100:1..100 => d73ae2a7
507
- # (1...100) => Range:99:1...100 => 46c8a7d0
507
+ # (1..100) => Range:false:1:100 => 54506352
508
+ # (1...100) => Range:true:1:100 => f0cad8cc
508
509
  #
509
510
  # To use use method in other classes simply:
510
511
  #
@@ -523,10 +524,13 @@ module Gibbler
523
524
  # Creates a digest for the current state of self.
524
525
  def __gibbler(digest_type=nil)
525
526
  klass = self.class
526
- value = self.nil? ? "\0" : self.to_s
527
- size = self.nil? ? 0 : self.to_a.size
528
- a = Gibbler.digest "%s:%d:%s" % [klass, size, value], digest_type
529
- gibbler_debug klass, a, [klass, size, value]
527
+ if self.nil?
528
+ first, last, exclude = "\0", "\0", "\0"
529
+ else
530
+ first, last, exclude = self.first, self.last, self.exclude_end?
531
+ end
532
+ a = Gibbler.digest "%s:%s:%s:%s" % [klass, exclude, first, last], digest_type
533
+ gibbler_debug klass, a, [klass, exclude, first, last]
530
534
  a
531
535
  end
532
536
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gibbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-08 00:00:00 -04:00
12
+ date: 2010-04-11 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency