gibbler 0.6.1 → 0.6.2
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.
- data/CHANGES.txt +7 -3
- data/README.rdoc +1 -1
- data/gibbler.gemspec +1 -1
- data/lib/gibbler.rb +77 -4
- metadata +2 -2
data/CHANGES.txt
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
GIBBLER, CHANGES
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
|
4
|
+
#### 0.6.2 (2009-09-15) #################################
|
5
|
+
|
6
|
+
* FIXED: Enforce specific string format for Time objects. Fixes
|
7
|
+
an issue with Ruby 1.8.7 which formats the to_s value differently
|
8
|
+
than 1.8.6 and 1.9.1.
|
9
|
+
* ADDED: Support for NilClass, File, and URI
|
6
10
|
|
7
11
|
|
8
12
|
#### 0.6.1 (2009-08-25) #################################
|
data/README.rdoc
CHANGED
@@ -150,7 +150,7 @@ With the upgrade to Attic 0.4, the gibbled? method and object history is now ava
|
|
150
150
|
== Known Issues
|
151
151
|
|
152
152
|
* gibbler or gibbled? must be called at least once before gibbled? will be able to return a useful value (otherwise there is no previous digest value to compare to)
|
153
|
-
* Digests for Bignum objects are different between
|
153
|
+
* Digests for Bignum objects are different between Ruby 1.8, 1.9, and JRuby. Does anyone know why?
|
154
154
|
* Digests for Proc objects are different between Ruby 1.8 and 1.9 because Proc.arity returns different values and 1.8 has no lambda? method.
|
155
155
|
|
156
156
|
|
data/gibbler.gemspec
CHANGED
data/lib/gibbler.rb
CHANGED
@@ -13,7 +13,7 @@ module Gibbler
|
|
13
13
|
#include Attic
|
14
14
|
extend Attic
|
15
15
|
|
16
|
-
VERSION = "0.6.
|
16
|
+
VERSION = "0.6.2"
|
17
17
|
|
18
18
|
require 'gibbler/object'
|
19
19
|
require 'gibbler/digest'
|
@@ -283,7 +283,7 @@ module Gibbler
|
|
283
283
|
# Creates a digest for the current state of self.
|
284
284
|
def __gibbler(h=self)
|
285
285
|
klass = h.class
|
286
|
-
value = h.nil? ? "\0" : h.utc.
|
286
|
+
value = h.nil? ? "\0" : h.utc.strftime('%Y-%m-%d %H:%M:%S UTC')
|
287
287
|
a = Gibbler.digest "%s:%d:%s" % [klass, value.size, value]
|
288
288
|
gibbler_debug klass, a, [klass, value.size, value]
|
289
289
|
a
|
@@ -327,8 +327,8 @@ module Gibbler
|
|
327
327
|
# and VALUE is the string representation of the range.
|
328
328
|
# e.g.
|
329
329
|
#
|
330
|
-
# (1..100)
|
331
|
-
#
|
330
|
+
# (1..100) => Range:100:1..100 => d73ae2a7
|
331
|
+
# (1...100) => Range:99:1...100 => 46c8a7d0
|
332
332
|
#
|
333
333
|
# To use use method in other classes simply:
|
334
334
|
#
|
@@ -356,7 +356,64 @@ module Gibbler
|
|
356
356
|
|
357
357
|
end
|
358
358
|
|
359
|
+
# Creates a digest based on: <tt>CLASS:\0</tt>
|
360
|
+
#
|
361
|
+
# e.g.
|
362
|
+
#
|
363
|
+
# nil.gibbler # => 06fdf26b
|
364
|
+
#
|
365
|
+
module Nil
|
366
|
+
include Gibbler::Object
|
367
|
+
|
368
|
+
def self.included(obj)
|
369
|
+
obj.extend Attic
|
370
|
+
obj.attic :__gibbler_cache
|
371
|
+
end
|
372
|
+
|
373
|
+
# Creates a digest for the current state of self.
|
374
|
+
def __gibbler(h=self)
|
375
|
+
klass = h.class
|
376
|
+
a = Gibbler.digest "%s:%s" % [klass, "\0"]
|
377
|
+
gibbler_debug klass, a, [klass, "\0"]
|
378
|
+
a
|
379
|
+
end
|
380
|
+
end
|
359
381
|
|
382
|
+
# Creates a digest based on: <tt>CLASS:PATHLENGTH:PATH</tt>
|
383
|
+
# where PATHLENGTH is the length of the PATH string. PATH is
|
384
|
+
# not modified in any way (it is not converted to an absolute
|
385
|
+
# path).
|
386
|
+
#
|
387
|
+
# NOTE: You may expect this method to include other information
|
388
|
+
# like the file contents and modified date (etc...). The reason
|
389
|
+
# we do not is because Gibbler is concerned only about Ruby and
|
390
|
+
# not the outside world. There are many complexities in parsing
|
391
|
+
# file data and attributes which would make it difficult to run
|
392
|
+
# across platforms and Ruby versions / engines. If you want to
|
393
|
+
#
|
394
|
+
# e.g.
|
395
|
+
#
|
396
|
+
# File.new('.') # => c8bc8b3a
|
397
|
+
# File.new('/tmp') # => 3af85a19
|
398
|
+
# File.new('/tmp/') # => 92cbcb7d
|
399
|
+
#
|
400
|
+
module File
|
401
|
+
include Gibbler::Object
|
402
|
+
|
403
|
+
def self.included(obj)
|
404
|
+
obj.extend Attic
|
405
|
+
obj.attic :__gibbler_cache
|
406
|
+
end
|
407
|
+
|
408
|
+
# Creates a digest for the current state of self.
|
409
|
+
def __gibbler(h=self)
|
410
|
+
klass = h.class
|
411
|
+
value = h.nil? ? "\0" : h.path
|
412
|
+
a = Gibbler.digest "%s:%d:%s" % [klass, value.size, value]
|
413
|
+
gibbler_debug klass, a, [klass, value.size, value]
|
414
|
+
a
|
415
|
+
end
|
416
|
+
end
|
360
417
|
|
361
418
|
##--
|
362
419
|
## NOTE: this was used when Gibbler supported "include Gibbler". We
|
@@ -446,4 +503,20 @@ class Range
|
|
446
503
|
include Gibbler::Range
|
447
504
|
end
|
448
505
|
|
506
|
+
class NilClass
|
507
|
+
include Gibbler::Nil
|
508
|
+
end
|
509
|
+
|
510
|
+
module URI
|
511
|
+
class Generic
|
512
|
+
include Gibbler::String
|
513
|
+
end
|
514
|
+
end
|
449
515
|
|
516
|
+
class File
|
517
|
+
include Gibbler::File
|
518
|
+
end
|
519
|
+
|
520
|
+
class TempFile
|
521
|
+
include Gibbler::File
|
522
|
+
end
|
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.6.
|
4
|
+
version: 0.6.2
|
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: 2009-
|
12
|
+
date: 2009-09-15 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|