gibbler 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,5 +1,11 @@
1
1
  GIBBLER, CHANGES
2
2
 
3
+
4
+ #### 0.5.4 (2009-07-17) #################################
5
+
6
+ * FIXED: Improved support for Symbol and Fixnum objects with Attic 0.4
7
+
8
+
3
9
  #### 0.5.3 (2009-07-12) #################################
4
10
 
5
11
  * FIXED: Updated gemspec to fix missing files (aliases)
data/README.rdoc CHANGED
@@ -11,11 +11,11 @@ NOTE: Gibbler supports Ruby 1.8, 1.9 and JRuby.
11
11
 
12
12
  "kimmy".gibbler # => c8027100ecc54945ab15ddac529230e38b1ba6a1
13
13
  :kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
14
-
14
+
15
15
  config = {}
16
16
  config.gibbler # => 4fdcadc66a38feb9c57faf3c5a18d5e76a6d29bf
17
17
  config.gibbled? # => false
18
-
18
+
19
19
  config[:server] = {
20
20
  :users => [:dave, :ali],
21
21
  :ports => [22, 80, 443]
@@ -129,14 +129,14 @@ NOTE: Gibbler history is not suitable for very large objects since it keeps comp
129
129
 
130
130
  == News
131
131
 
132
- === 2009-07-07: Added aliases
132
+ === 2009-07-17: Improved support for Symbol and Fixnum
133
133
 
134
- The "gibbler" methods can be cumbersome so I added some aliases which can be included by request. See the example above.
134
+ With the upgrade to Attic 0.4, the gibbled? method and object history is now available for Symbol and Fixnum objects.
135
135
 
136
136
 
137
- === 2009-07-06: Renamed gibbler_revert to gibbler_revert!
137
+ === 2009-07-13: Fixed Attic gem
138
138
 
139
- The gibbler_revert! method modifies the object in place so this was an important change to follow the Ruby convention of appending the exclamation mark. Thanks to ivey[http://news.ycombinator.com/item?id=689750] for pointing this out.
139
+ Cripes! I added the Attic dependency but there was a problem with the attic gem (the gemspec was outdated). It's <i>all</i> good now, the attic-0.3.1 gem should be available on all Rubyforge mirrors and and gems.github.com soon.
140
140
 
141
141
 
142
142
  == Known Issues
@@ -157,6 +157,12 @@ or via download:
157
157
  * gibbler-latest.zip[http://github.com/delano/gibbler/zipball/latest]
158
158
 
159
159
 
160
+ == What People Are Saying
161
+
162
+ * "nice approach - everything is an object, every object is 'gittish'" -- @olgen_morten[http://twitter.com/olgen_morten/statuses/2629909133]
163
+ * "gibbler is just awesome" -- @TomK32[http://twitter.com/TomK32/statuses/2618542872]
164
+ * "wie cool ist Gibbler eigentlich?" -- @we5[http://twitter.com/we5/statuses/2615274279]
165
+ * "it's nice idea and implementation!" -- HristoHristov[http://www.rubyinside.com/gibbler-git-like-hashes-and-history-for-ruby-objects-1980.html#comment-39092]
160
166
 
161
167
  == More Info
162
168
 
@@ -166,6 +172,11 @@ or via download:
166
172
  * Inspiration[http://www.youtube.com/watch?v=fipD4DdV48g]
167
173
 
168
174
 
175
+ == Thanks
176
+
177
+ * Kalin Harvey (krrh[http://github.com/krrh]) for the early feedback and artistic direction.
178
+
179
+
169
180
  == Credits
170
181
 
171
182
  * Delano (@solutious.com)
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ CHANGES = "CHANGES.txt"
15
15
  LICENSE = "LICENSE.txt"
16
16
 
17
17
  # Files and directories to be deleted when you run "rake clean"
18
- CLEAN.include [ 'pkg', '*.gem', '.config']
18
+ CLEAN.include [ 'pkg', '*.gem', '.config', 'doc']
19
19
 
20
20
  name = 'gibbler'
21
21
  load "#{name}.gemspec"
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.5.3"
4
+ s.version = "0.5.4"
5
5
  s.summary = "Gibbler: Git-like hashes for Ruby objects"
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
@@ -24,7 +24,7 @@
24
24
  s.rdoc_options = ["--line-numbers", "--title", s.summary, "--main", "README.rdoc"]
25
25
 
26
26
  # = DEPENDENCIES =
27
- s.add_dependency 'attic'
27
+ s.add_dependency 'attic', '>= 0.4.0'
28
28
 
29
29
  # = MANIFEST =
30
30
  s.files = %w(
@@ -3,9 +3,6 @@
3
3
  module Gibbler
4
4
 
5
5
  module Object
6
- extend Attic
7
-
8
- attic :__gibbler_cache
9
6
 
10
7
  # Calculates a digest for the current object instance.
11
8
  # Objects that are a kind of Hash or Array are processed
data/lib/gibbler.rb CHANGED
@@ -13,7 +13,7 @@ module Gibbler
13
13
  #include Attic
14
14
  extend Attic
15
15
 
16
- VERSION = "0.5.3"
16
+ VERSION = "0.5.4"
17
17
 
18
18
  require 'gibbler/object'
19
19
  require 'gibbler/digest'
@@ -55,6 +55,12 @@ module Gibbler
55
55
 
56
56
  module Complex
57
57
  include Gibbler::Object
58
+
59
+ def self.included(obj)
60
+ obj.extend Attic
61
+ obj.attic :__gibbler_cache
62
+ end
63
+
58
64
  # Creates a digest based on:
59
65
  # * An Array of instance variable names and values in the format: <tt>CLASS:LENGTH:VALUE</tt>
60
66
  # * The gibbler method is called on each element so if it is a Hash or Array etc it
@@ -94,6 +100,11 @@ module Gibbler
94
100
  module String
95
101
  include Gibbler::Object
96
102
 
103
+ def self.included(obj)
104
+ obj.extend Attic
105
+ obj.attic :__gibbler_cache
106
+ end
107
+
97
108
  # Creates a digest based on: <tt>CLASS:LENGTH:VALUE</tt>.
98
109
  # This method can be used for any class where the <tt>to_s</tt>
99
110
  # method returns an appropriate unique value for this instance.
@@ -121,6 +132,11 @@ module Gibbler
121
132
  module Hash
122
133
  include Gibbler::Object
123
134
 
135
+ def self.included(obj)
136
+ obj.extend Attic
137
+ obj.attic :__gibbler_cache
138
+ end
139
+
124
140
  # Creates a digest based on:
125
141
  # * parse each key, value pair into an Array containing keys: <tt>CLASS:KEY:VALUE.__gibbler</tt>
126
142
  # * The gibbler method is called on each element so if it is a Hash or Array etc it
@@ -157,6 +173,11 @@ module Gibbler
157
173
  module Array
158
174
  include Gibbler::Object
159
175
 
176
+ def self.included(obj)
177
+ obj.extend Attic
178
+ obj.attic :__gibbler_cache
179
+ end
180
+
160
181
  # Creates a digest based on:
161
182
  # * parse each element into an Array of digests like: <tt>CLASS:INDEX:VALUE.__gibbler</tt>
162
183
  # * The gibbler method is called on each element so if it is a Hash or Array etc it
@@ -208,6 +229,12 @@ module Gibbler
208
229
  #
209
230
  module Block
210
231
  include Gibbler::Object
232
+
233
+ def self.included(obj)
234
+ obj.extend Attic
235
+ obj.attic :__gibbler_cache
236
+ end
237
+
211
238
  def __gibbler(h=self)
212
239
  klass = h.class
213
240
  a = Gibbler.digest '%s:%s:%s' % [klass, h.arity, h.binding]
@@ -50,7 +50,7 @@ tryouts "Basic syntax with SHA1" do
50
50
  dream :gibbler, '48fda57c05684c9e5c3259557851943572183a21'
51
51
  drill "Empty Array instance", Array.new
52
52
 
53
- dream :gibbler, "884e5713aa70468333459f80aea1bb05394ca4ba"
53
+ dream :gibbler, "3e1d79d113a409a96a13ca3879fc4c42027aa74b"
54
54
  drill "Populated Array instance" do
55
55
  [1, 2, :runtime, [3, "four", [Object, true]]]
56
56
  end
@@ -69,6 +69,35 @@ tryouts "Basic syntax with SHA1" do
69
69
  a.gibbled?
70
70
  end
71
71
 
72
+ dream ["667ce086", "92d5f7cd"]
73
+ drill "Symbols digests don't cross streams" do
74
+ a, b = :something, :anything
75
+ a.gibbler
76
+ b.gibbler
77
+ [a.__gibbler_cache.short, b.__gibbler_cache.short]
78
+ end
79
+
80
+ dream ["ce0c7694", "c13b2f02"]
81
+ drill "String digests don't cross streams" do
82
+ a, b = 'something', 'anything'
83
+ a.gibbler
84
+ b.gibbler
85
+ [a.__gibbler_cache.short, b.__gibbler_cache.short]
86
+ end
87
+
88
+ drill "Symbol has list of attic vars", [:__gibbler_cache] do
89
+ Symbol.attic_vars
90
+ end
91
+
92
+ drill "String has list of attic vars", [:__gibbler_cache] do
93
+ String.attic_vars
94
+ end
95
+
96
+ drill "Hash has list of attic vars", [:__gibbler_cache] do
97
+ Hash.attic_vars
98
+ end
99
+
100
+
72
101
  dream :gibbler, "6ea546919dc4caa2bab69799b71d48810a1b48fa"
73
102
  drill "works on arbitrary objects" do
74
103
  class ::FullHouse
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.5.3
4
+ version: 0.5.4
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-07-12 00:00:00 -04:00
12
+ date: 2009-07-17 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: "0"
23
+ version: 0.4.0
24
24
  version:
25
25
  description: "Gibbler: Git-like hashes for Ruby objects"
26
26
  email: delano@solutious.com