gibbler 0.10.0.pre.RC1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile +3 -1
- data/Gemfile.lock +55 -0
- data/README.md +88 -80
- data/VERSION.yml +3 -3
- data/gibbler.gemspec +23 -0
- data/lib/gibbler.rb +6 -3
- data/try/02_compat_try.rb +1 -10
- data/try/11_basic_try.rb +21 -14
- data/try/15_file_try.rb +8 -8
- metadata +36 -22
- data/CHANGELOG.md +0 -211
- data/sig/gibbler.rbs +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3d6f71db3e48bcde87e146541ecd62dcf2bd607efa9cc77aee6c91ddb0186a1
|
4
|
+
data.tar.gz: 779b390460dc341160aac1a43d7c3b5d46b259813811b86a603eeafbace83a24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4413c609e6b7c66460365e48414ba132bc472196c184ce92f237e02fa13e59fc76700e250d2bbcb82ccd8f3b2af47267233d293c6f22e40de89deaa3a670246a
|
7
|
+
data.tar.gz: aad713d6d5e6a1b27f85ffc625f7db9f99e96a90c944dfc6c868483116bd3b43eb3232a8f88815abb5d232022b0471a10da735506800e5dc12046f5ad288cc57
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ast (2.4.2)
|
5
|
+
attic (1.0.0.pre.RC3)
|
6
|
+
rake (>= 13.0.6)
|
7
|
+
drydock (0.6.9)
|
8
|
+
json (2.7.2)
|
9
|
+
language_server-protocol (3.17.0.3)
|
10
|
+
parallel (1.24.0)
|
11
|
+
parser (3.3.0.5)
|
12
|
+
ast (~> 2.4.1)
|
13
|
+
racc
|
14
|
+
racc (1.7.3)
|
15
|
+
rainbow (3.1.1)
|
16
|
+
rake (13.2.0)
|
17
|
+
regexp_parser (2.9.0)
|
18
|
+
rexml (3.2.6)
|
19
|
+
rubocop (1.62.1)
|
20
|
+
json (~> 2.3)
|
21
|
+
language_server-protocol (>= 3.17.0)
|
22
|
+
parallel (~> 1.10)
|
23
|
+
parser (>= 3.3.0.2)
|
24
|
+
rainbow (>= 2.2.2, < 4.0)
|
25
|
+
regexp_parser (>= 1.8, < 3.0)
|
26
|
+
rexml (>= 3.2.5, < 4.0)
|
27
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
28
|
+
ruby-progressbar (~> 1.7)
|
29
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
30
|
+
rubocop-ast (1.31.2)
|
31
|
+
parser (>= 3.3.0.4)
|
32
|
+
ruby-progressbar (1.13.0)
|
33
|
+
storable (0.10.pre.RC1)
|
34
|
+
sysinfo (0.9.0.pre.RC1)
|
35
|
+
drydock (< 1.0)
|
36
|
+
storable (= 0.10.pre.RC1)
|
37
|
+
tryouts (2.2.0.pre.RC1)
|
38
|
+
sysinfo (= 0.9.0.pre.RC1)
|
39
|
+
unicode-display_width (2.5.0)
|
40
|
+
|
41
|
+
PLATFORMS
|
42
|
+
arm64-darwin-22
|
43
|
+
ruby
|
44
|
+
|
45
|
+
DEPENDENCIES
|
46
|
+
attic (>= 0.9.0.pre.rc2)
|
47
|
+
rake
|
48
|
+
rubocop
|
49
|
+
tryouts (= 2.2.0.pre.RC1)
|
50
|
+
|
51
|
+
RUBY VERSION
|
52
|
+
ruby 3.2.0p0
|
53
|
+
|
54
|
+
BUNDLED WITH
|
55
|
+
2.5.7
|
data/README.md
CHANGED
@@ -13,54 +13,59 @@ Check out [this post on RubyInside](http://www.rubyinside.com/gibbler-git-like-h
|
|
13
13
|
|
14
14
|
Install the gem and add to the application's Gemfile by executing:
|
15
15
|
|
16
|
-
|
16
|
+
```bash
|
17
|
+
$ bundle add gibbler
|
18
|
+
```
|
17
19
|
|
18
20
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
19
21
|
|
20
|
-
|
22
|
+
```bash
|
23
|
+
$ gem install gibbler
|
24
|
+
```
|
25
|
+
|
21
26
|
|
22
27
|
## Usage
|
23
28
|
|
24
29
|
### Example 1 -- Standalone Usage
|
25
30
|
|
26
31
|
```ruby
|
27
|
-
|
32
|
+
require 'gibbler'
|
28
33
|
|
29
|
-
|
30
|
-
|
34
|
+
g = Gibbler.new 'id', 1001 # => f4fb3796ababa3788d1bded8fdc589ab1ccb1c3d
|
35
|
+
g.base(36) # => sm71s7eam4hm5jlsuzlqkbuktwpe5h9
|
31
36
|
|
32
|
-
|
33
|
-
|
37
|
+
g == 'f4fb3796ababa3788d1bded8fdc589ab1ccb1c3d' # => true
|
38
|
+
g === 'f4fb379' # => true
|
34
39
|
```
|
35
40
|
|
36
41
|
### Example 2 -- Mixins Usage
|
37
42
|
|
38
43
|
```ruby
|
39
|
-
|
44
|
+
require 'gibbler/mixins'
|
40
45
|
|
41
|
-
|
42
|
-
|
46
|
+
"kimmy".gibbler # => c8027100ecc54945ab15ddac529230e38b1ba6a1
|
47
|
+
:kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
|
43
48
|
|
44
|
-
|
45
|
-
|
46
|
-
|
49
|
+
config = {}
|
50
|
+
config.gibbler # => 4fdcadc66a38feb9c57faf3c5a18d5e76a6d29bf
|
51
|
+
config.gibbled? # => false
|
47
52
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
53
|
+
config[:server] = {
|
54
|
+
:users => [:dave, :ali],
|
55
|
+
:ports => [22, 80, 443]
|
56
|
+
}
|
57
|
+
config.gibbled? # => true
|
58
|
+
config.gibbler # => ef23d605f8c4fc80a8e580f9a0e8dab8426454a8
|
54
59
|
|
55
|
-
|
60
|
+
config[:server][:users] << :yanni
|
56
61
|
|
57
|
-
|
62
|
+
config.gibbler # => 4c558a56bc2abf5f8a845a69e47ceb5e0003683f
|
58
63
|
|
59
|
-
|
64
|
+
config.gibbler.short # => 4c558a56
|
60
65
|
|
61
|
-
|
66
|
+
config.gibbler.base36 # => 8x00l83jov4j80i9vfzpaxr9jag23wf
|
62
67
|
|
63
|
-
|
68
|
+
config.gibbler.base36.short # => 8x00l83j
|
64
69
|
```
|
65
70
|
|
66
71
|
### Example 3 -- Object History
|
@@ -68,33 +73,33 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
68
73
|
Gibbler can also keep track of the history of changes to an object. By default Gibbler supports history for Hash, Array, and String objects. The `gibbler_commit` method creates a clone of the current object and stores in an instance variable using the current hash digest as the key.
|
69
74
|
|
70
75
|
```ruby
|
71
|
-
|
72
|
-
|
76
|
+
require 'gibbler/mixins'
|
77
|
+
require 'gibbler/history'
|
73
78
|
|
74
|
-
|
75
|
-
|
79
|
+
a = { :magic => :original }
|
80
|
+
a.gibbler_commit # => d7049916ddb25e6cc438b1028fb957e5139f9910
|
76
81
|
|
77
|
-
|
78
|
-
|
82
|
+
a[:magic] = :updated
|
83
|
+
a.gibbler_commit # => b668098e16d08898532bf3aa33ce2253a3a4150e
|
79
84
|
|
80
|
-
|
81
|
-
|
85
|
+
a[:magic] = :changed
|
86
|
+
a.gibbler_commit # => 0b11c377fccd44554a601e5d2b135c46dc1c4cb1
|
82
87
|
|
83
|
-
|
88
|
+
a.gibbler_history # => d7049916, b668098e, 0b11c377
|
84
89
|
|
85
|
-
|
86
|
-
|
87
|
-
|
90
|
+
a.gibbler_revert! 'd7049916' # Return to a specific commit
|
91
|
+
a.gibbler # => d7049916ddb25e6cc438b1028fb957e5139f9910
|
92
|
+
a # => { :magic => :original }
|
88
93
|
|
89
|
-
|
94
|
+
a.delete :magic
|
90
95
|
|
91
|
-
|
92
|
-
|
93
|
-
|
96
|
+
a.gibbler_revert! # Return to the previous commit
|
97
|
+
a.gibbler # => 0b11c377fccd44554a601e5d2b135c46dc1c4cb1
|
98
|
+
a # => { :magic => :changed }
|
94
99
|
|
95
100
|
|
96
|
-
|
97
|
-
|
101
|
+
a.gibbler_object 'b668098e' # => { :magic => :updated }
|
102
|
+
a.gibbler_stamp # => 2009-07-01 18:56:52 -0400
|
98
103
|
```
|
99
104
|
|
100
105
|
![](https://delanotes.com/gibbler/img/whoababy.gif)
|
@@ -105,18 +110,21 @@ Gibbler can also keep track of the history of changes to an object. By default G
|
|
105
110
|
If you have control over the namespaces of your objects, you can use the method aliases to tighten up your code a bit. The "gibbler" and "gibbled?" methods can be accessed via "digest" and "changed?", respectively. (The reason they're not enabled by default is to avoid conflicts.)
|
106
111
|
|
107
112
|
```ruby
|
108
|
-
|
113
|
+
require 'gibbler/aliases'
|
109
114
|
|
110
|
-
|
111
|
-
|
115
|
+
"kimmy".digest # => c8027100ecc54945ab15ddac529230e38b1ba6a1
|
116
|
+
:kimmy.digest # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
|
112
117
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
118
|
+
a = [:a, :b, :c]
|
119
|
+
a.digest # => e554061823b8f06367555d1ee4c25b4ffee61944
|
120
|
+
a << :d
|
121
|
+
a.changed? # => true
|
122
|
+
```
|
117
123
|
|
118
124
|
The history methods also have aliases which remove the "gibbler_" prefix.
|
119
125
|
|
126
|
+
|
127
|
+
```ruby
|
120
128
|
require 'gibbler/aliases'
|
121
129
|
require 'gibbler/history'
|
122
130
|
|
@@ -132,36 +140,36 @@ The history methods also have aliases which remove the "gibbler_" prefix.
|
|
132
140
|
By default Gibbler creates SHA1 hashes. You can change this globally or per instance.
|
133
141
|
|
134
142
|
```ruby
|
135
|
-
|
143
|
+
require 'gibbler/mixins'
|
136
144
|
|
137
|
-
|
145
|
+
Gibbler.digest_type = Digest::MD5
|
138
146
|
|
139
|
-
|
147
|
+
:kimmy.gibbler # => 0c61ff17f46223f355759934154d5dcb
|
140
148
|
|
141
|
-
|
149
|
+
:kimmy.gibbler(Digest::SHA1) # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
|
142
150
|
```
|
143
151
|
|
144
152
|
In Jruby, you can grab the digest types from the openssl library.
|
145
153
|
|
146
154
|
```ruby
|
147
|
-
|
155
|
+
require 'openssl'
|
148
156
|
|
149
|
-
|
157
|
+
Gibbler.digest_type = OpenSSL::Digest::SHA256
|
150
158
|
|
151
|
-
|
159
|
+
:kimmy.gibbler # => 1069428e6273cf329436c3dce9b680d4d4e229d7b7...
|
152
160
|
```
|
153
161
|
|
154
162
|
### Example 6 -- All your base
|
155
163
|
|
156
164
|
```ruby
|
157
|
-
|
165
|
+
require 'gibbler/mixins'
|
158
166
|
|
159
|
-
|
160
|
-
|
161
|
-
|
167
|
+
:kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
|
168
|
+
:kimmy.gibbler.base(16) # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
|
169
|
+
:kimmy.gibbler.base(36) # => 9nydr6mpv6w4k8ngo3jtx0jz1n97h7j
|
162
170
|
|
163
|
-
|
164
|
-
|
171
|
+
:kimmy.gibbler.base(10) # => 472384540402900668368761869477227308873774630879
|
172
|
+
:kimmy.gibbler.to_i # => 472384540402900668368761869477227308873774630879
|
165
173
|
```
|
166
174
|
|
167
175
|
### Example 7 -- Global secret
|
@@ -169,13 +177,13 @@ In Jruby, you can grab the digest types from the openssl library.
|
|
169
177
|
Gibbler can prepend all digest inputs with a global secret. You can set this once per project to ensure your project's digests are unique.
|
170
178
|
|
171
179
|
```ruby
|
172
|
-
|
180
|
+
require 'gibbler/mixins'
|
173
181
|
|
174
|
-
|
182
|
+
:kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
|
175
183
|
|
176
|
-
|
184
|
+
Gibbler.secret = "sUp0r5ekRu7"
|
177
185
|
|
178
|
-
|
186
|
+
:kimmy.gibbler # => 6c5f5aff4d809cec7e7da091214a35a2698489f8
|
179
187
|
```
|
180
188
|
|
181
189
|
### Supported Classes
|
@@ -183,16 +191,16 @@ Gibbler can prepend all digest inputs with a global secret. You can set this onc
|
|
183
191
|
Gibbler methods are available only to the classes which explicitly include them [see docs'(https://delanotes.com/gibbler) for details on which classes are supported by default). You can also extend custom objects:
|
184
192
|
|
185
193
|
```ruby
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
194
|
+
class FullHouse
|
195
|
+
include Gibbler::Complex
|
196
|
+
attr_accessor :roles
|
197
|
+
end
|
190
198
|
|
191
|
-
|
192
|
-
|
199
|
+
a = FullHouse.new
|
200
|
+
a.gibbler # => 4192d4cb59975813f117a51dcd4454ac16df6703
|
193
201
|
|
194
|
-
|
195
|
-
|
202
|
+
a.roles = [:jesse, :joey, :danny, :kimmy, :michelle, :dj, :stephanie]
|
203
|
+
a.gibbler # => 6ea546919dc4caa2bab69799b71d48810a1b48fa
|
196
204
|
```
|
197
205
|
|
198
206
|
`Gibbler::Complex` creates a digest based on the name of the class and the names and values of the instance variables. See the RDocs[http://delano.github.com/gibbler] for other Gibbler::* types.
|
@@ -200,9 +208,9 @@ Gibbler methods are available only to the classes which explicitly include them
|
|
200
208
|
If you want to support all Ruby objects, add the following to your application:
|
201
209
|
|
202
210
|
```ruby
|
203
|
-
|
204
|
-
|
205
|
-
|
211
|
+
class Object
|
212
|
+
include Gibbler::String
|
213
|
+
end
|
206
214
|
```
|
207
215
|
|
208
216
|
`Gibbler::String` creates a digest based on the name of the class and the output of the to_s method. This is a reasonable default for most objects however any object that includes the object address in to_s (e.g. "Object:0x0x4ac9f0...") will produce unreliable digests (because the address can change).
|
@@ -237,13 +245,13 @@ Bug reports and pull requests are welcome [GitHub Issues](https://github.com/del
|
|
237
245
|
* Kalin Harvey ([krrh](https://github.com/kalin)) for the early feedback and artistic direction.
|
238
246
|
* Alex Peuchert ([aaalex](https://github.com/aaalex)) for creating the screencast.
|
239
247
|
|
248
|
+
* Andrea Barber
|
249
|
+
|
250
|
+
|
240
251
|
## Code of Conduct
|
241
252
|
|
242
253
|
Everyone interacting in the Gibbler project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/delano/gibbler/blob/main/CODE_OF_CONDUCT.md).
|
243
254
|
|
244
|
-
## Credits
|
245
|
-
|
246
|
-
Gibbler was created by [Delano Mandelbaum](https://delanotes.com/).
|
247
255
|
|
248
256
|
## License
|
249
257
|
|
data/VERSION.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
---
|
2
|
-
:MAJOR:
|
3
|
-
:MINOR:
|
1
|
+
---
|
2
|
+
:MAJOR: 1
|
3
|
+
:MINOR: 0
|
4
4
|
:PATCH: 0
|
data/gibbler.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "gibbler"
|
3
|
+
s.version = "1.0.0"
|
4
|
+
s.summary = "Git-like hashes for Ruby objects"
|
5
|
+
s.description = "About Gibbler: Git-like hashes for Ruby objects"
|
6
|
+
s.authors = ["Delano Mandelbaum"]
|
7
|
+
s.email = "gems@solutious.com"
|
8
|
+
s.homepage = "https://github.com/delano/gibbler"
|
9
|
+
s.license = "MIT"
|
10
|
+
|
11
|
+
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
12
|
+
s.bindir = "exe"
|
13
|
+
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
14
|
+
s.require_paths = ["lib"]
|
15
|
+
|
16
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.6.8")
|
17
|
+
|
18
|
+
s.add_dependency "rake", "~> 13.0"
|
19
|
+
s.add_dependency "attic", "~> 1.0"
|
20
|
+
|
21
|
+
s.add_development_dependency "rubocop", "~> 1.0"
|
22
|
+
s.add_development_dependency "tryouts", "~> 2.2"
|
23
|
+
end
|
data/lib/gibbler.rb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
unless defined?(GIBBLER_LIB_HOME)
|
4
4
|
GIBBLER_LIB_HOME = File.expand_path File.dirname(__FILE__)
|
5
5
|
end
|
6
|
+
|
7
|
+
require 'attic'
|
6
8
|
require 'digest/sha1'
|
7
9
|
|
8
10
|
|
9
|
-
|
11
|
+
# = Gibbler
|
10
12
|
#
|
11
13
|
# "Hola, Tanneritos"
|
12
14
|
#
|
@@ -146,8 +148,9 @@ class Gibbler < String
|
|
146
148
|
def gibbler(digest_type=nil)
|
147
149
|
#gibbler_debug caller[0]
|
148
150
|
gibbler_debug :GIBBLER, self.class, self
|
149
|
-
|
150
|
-
self.gibbler_cache =
|
151
|
+
ret = Gibbler::Digest.new self.__gibbler(digest_type)
|
152
|
+
self.gibbler_cache = ret unless self.frozen?
|
153
|
+
ret
|
151
154
|
end
|
152
155
|
|
153
156
|
# Has this object been modified?
|
data/try/02_compat_try.rb
CHANGED
@@ -1,14 +1,5 @@
|
|
1
|
-
|
1
|
+
require_relative '../lib/gibbler/mixins'
|
2
2
|
|
3
3
|
## Gibbler Objects have gibbler_cache method
|
4
4
|
"kimmy".respond_to? :gibbler_cache
|
5
5
|
#=> true
|
6
|
-
|
7
|
-
## Gibbler Objects have __gibbler_cache method
|
8
|
-
"kimmy".respond_to? :__gibbler_cache
|
9
|
-
#=> true
|
10
|
-
|
11
|
-
## __gibbler_cache returns the same value as gibbler_cache
|
12
|
-
@a = "kimmy" and @a.gibbler
|
13
|
-
@a.gibbler_cache
|
14
|
-
#=> @a.__gibbler_cache
|
data/try/11_basic_try.rb
CHANGED
@@ -41,15 +41,15 @@ require 'gibbler/mixins'
|
|
41
41
|
|
42
42
|
# Populated Hash instance
|
43
43
|
{ :a => [1,2,3, [4,5,6]], :b => { :c => Class } }.gibbler
|
44
|
-
#=> "
|
44
|
+
#=> "8faca3e967c94fe996fac1b5a5f595ef77e10df4"
|
45
45
|
|
46
46
|
# Empty Array instance
|
47
47
|
Array.gibbler
|
48
|
-
#=> '
|
48
|
+
#=> '83c4994bb01eefc06aa267aa99aa12b55696616e'
|
49
49
|
|
50
50
|
# Populated Array instance
|
51
51
|
[1, 2, :runtime, [3, "four", [Object, true]]].gibbler
|
52
|
-
#=> "
|
52
|
+
#=> "067c28147176992b95b9301817846abc85cbd7e4"
|
53
53
|
|
54
54
|
# Knows when a Hash has not changed
|
55
55
|
a = { :magic => true }
|
@@ -65,20 +65,27 @@ require 'gibbler/mixins'
|
|
65
65
|
a.gibbled?
|
66
66
|
#=> true
|
67
67
|
|
68
|
-
# Two Symbol digests don't cross streams
|
69
|
-
a, b = :something, :anything
|
70
|
-
a.gibbler
|
71
|
-
b.gibbler
|
72
|
-
[a.gibbler_cache.short, b.gibbler_cache.short]
|
73
|
-
#=> ["667ce086", "92d5f7cd"]
|
74
|
-
|
75
68
|
# Two String digests don't cross streams"
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
69
|
+
a, b = 'something', 'anything'
|
70
|
+
a.gibbler
|
71
|
+
b.gibbler
|
72
|
+
[a.gibbler_cache.short, b.gibbler_cache.short]
|
80
73
|
#=> ["ce0c7694", "c13b2f02"]
|
81
74
|
|
75
|
+
# Strings aren't inherently "frozen" so their gibbler cache
|
76
|
+
# values are primed after running gibbler the first time.
|
77
|
+
a = 'something'
|
78
|
+
a.gibbler
|
79
|
+
[a.frozen?, a.gibbler_cache]
|
80
|
+
#=> [false, "ce0c7694"]
|
81
|
+
|
82
|
+
# Symbols are inherently "frozen" so their gibbler cache
|
83
|
+
# values are never populated.
|
84
|
+
a = :something
|
85
|
+
a.gibbler
|
86
|
+
[a.frozen?, a.gibbler_cache]
|
87
|
+
#=> [true, nil]
|
88
|
+
|
82
89
|
## DISABLED: If gibbler/history is required, there will be an
|
83
90
|
## additional attic_var (:gibbler_history), but only if the
|
84
91
|
## gibbler_history method has been called already (the history
|
data/try/15_file_try.rb
CHANGED
@@ -2,15 +2,15 @@ require 'tempfile'
|
|
2
2
|
require 'gibbler/mixins'
|
3
3
|
|
4
4
|
@tempfile = "tryouts-9000-awesome.txt"
|
5
|
-
|
5
|
+
|
6
6
|
## File can gibbler
|
7
|
-
file = File.new(File.join('.', '
|
7
|
+
file = File.new(File.join('.', 'LICENSE.txt'))
|
8
8
|
file.gibbler
|
9
|
-
#=> 'c052e87bd0acb7e08c98dad7f8b09b4382a08ef6'
|
10
|
-
|
9
|
+
#=> 'c052e87bd0acb7e08c98dad7f8b09b4382a08ef6'
|
10
|
+
|
11
11
|
## Gibbler is different for each path
|
12
|
-
file1 = File.new(File.join('.', '
|
13
|
-
file2 = File.new(File.join('.', 'README.
|
12
|
+
file1 = File.new(File.join('.', 'LICENSE.txt'))
|
13
|
+
file2 = File.new(File.join('.', 'README.md'))
|
14
14
|
file1.gibbler == file2.gibbler
|
15
15
|
#=> false
|
16
16
|
|
@@ -30,7 +30,7 @@ require 'gibbler/mixins'
|
|
30
30
|
#=> '6d93f752fc23f36bffa5ddf9ee97d04be82efbdb'
|
31
31
|
|
32
32
|
## JRuby doesn't like to use File.new with directories
|
33
|
-
###=> '92cbcb7de73d7748b28d9e911f461013de34410f'
|
33
|
+
###=> '92cbcb7de73d7748b28d9e911f461013de34410f'
|
34
34
|
### "File gibbler cares about trailing slash (/tmp/)", File.new(__FILE__)
|
35
35
|
|
36
|
-
File.unlink @tempfile if File.
|
36
|
+
File.unlink @tempfile if File.exist? @tempfile
|
metadata
CHANGED
@@ -1,58 +1,72 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gibbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '13.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '13.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: attic
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rubocop
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - "
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
47
|
+
version: '1.0'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - "
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
54
|
+
version: '1.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: tryouts
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.2
|
61
|
+
version: '2.2'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.2
|
55
|
-
description: '
|
68
|
+
version: '2.2'
|
69
|
+
description: 'About Gibbler: Git-like hashes for Ruby objects'
|
56
70
|
email: gems@solutious.com
|
57
71
|
executables: []
|
58
72
|
extensions: []
|
@@ -63,21 +77,21 @@ files:
|
|
63
77
|
- ".gitignore"
|
64
78
|
- ".pre-commit-config.yaml"
|
65
79
|
- ".rubocop.yml"
|
66
|
-
- CHANGELOG.md
|
67
80
|
- CODE_OF_CONDUCT.md
|
68
81
|
- Gemfile
|
82
|
+
- Gemfile.lock
|
69
83
|
- LICENSE.txt
|
70
84
|
- README.md
|
71
85
|
- VERSION.yml
|
72
86
|
- bin/console
|
73
87
|
- bin/setup
|
88
|
+
- gibbler.gemspec
|
74
89
|
- img/whoababy.gif
|
75
90
|
- lib/gibbler.rb
|
76
91
|
- lib/gibbler/aliases.rb
|
77
92
|
- lib/gibbler/history.rb
|
78
93
|
- lib/gibbler/mixins.rb
|
79
94
|
- lib/gibbler/version.rb
|
80
|
-
- sig/gibbler.rbs
|
81
95
|
- try/01_core_ext_try.rb
|
82
96
|
- try/02_compat_try.rb
|
83
97
|
- try/05_gibbler_digest_try.rb
|
@@ -99,7 +113,7 @@ files:
|
|
99
113
|
- try/59_history_exceptions_try.rb
|
100
114
|
- try/80_performance_try.rb
|
101
115
|
- try/90_alias_try.rb
|
102
|
-
homepage:
|
116
|
+
homepage: https://github.com/delano/gibbler
|
103
117
|
licenses:
|
104
118
|
- MIT
|
105
119
|
metadata: {}
|
@@ -111,14 +125,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
125
|
requirements:
|
112
126
|
- - ">="
|
113
127
|
- !ruby/object:Gem::Version
|
114
|
-
version:
|
128
|
+
version: 2.6.8
|
115
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
130
|
requirements:
|
117
|
-
- - "
|
131
|
+
- - ">="
|
118
132
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
133
|
+
version: '0'
|
120
134
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.4.12
|
122
136
|
signing_key:
|
123
137
|
specification_version: 4
|
124
138
|
summary: Git-like hashes for Ruby objects
|
data/CHANGELOG.md
DELETED
@@ -1,211 +0,0 @@
|
|
1
|
-
# GIBBLER, CHANGES
|
2
|
-
|
3
|
-
## Releases
|
4
|
-
|
5
|
-
### 0.9.0 (2012-04-20)
|
6
|
-
|
7
|
-
* FIXED: Gibbler::Complex now checks has_method? and will use that before instance variables.
|
8
|
-
* CHANGE: Gibbler is now a class which supplies the default standalone usage
|
9
|
-
* CHANGE: Ruby object mixins must now be explicitly loaded via "require 'gibbler/mixins'"
|
10
|
-
* CHANGE: Removed Gibbler.enable_debug/disable_debug
|
11
|
-
* CHANGE: Gibbler.digest now returns nil for an empty Array
|
12
|
-
* ADDED: Gibbler.delimiter
|
13
|
-
|
14
|
-
### 0.8.10 (2011-10-23)
|
15
|
-
|
16
|
-
* CHANGE: Gibbler::Hash and Gibbler::Array now skip values that have no __gibbler method
|
17
|
-
|
18
|
-
### 0.8.9 (2011-02-11)
|
19
|
-
|
20
|
-
* FIXED: Remove debug output.
|
21
|
-
|
22
|
-
### 0.8.8 (2011-02-11)
|
23
|
-
|
24
|
-
* FIXED: Bundler calls freeze on an instance of Gem::Platform
|
25
|
-
|
26
|
-
### 0.8.7 (2011-02-07)
|
27
|
-
|
28
|
-
* CHANGE: Only call gibbler_debug when in debug mode
|
29
|
-
|
30
|
-
### 0.8.6 (2010-12-24)
|
31
|
-
|
32
|
-
* FIXED: Gibber::VERSION (File error)
|
33
|
-
|
34
|
-
### 0.8.5 (2010-12-23)
|
35
|
-
|
36
|
-
* CHANGE: Gibbler::Complex will skip fields with no __gibbler method
|
37
|
-
* ADDED: Gibbler.debug=
|
38
|
-
|
39
|
-
### 0.8.4 (2010-06-19)
|
40
|
-
|
41
|
-
ADDED: Support for Gibbler.default_base which affects all generated digests.
|
42
|
-
|
43
|
-
### 0.8.3 (2010-05-04)
|
44
|
-
|
45
|
-
* ADDED: Support for global secret (Gibbler.secret) which is prepended to all digests.
|
46
|
-
|
47
|
-
### 0.8.2 (2010-04-29)
|
48
|
-
|
49
|
-
* FIXED: test exception for "String has list of attic vars" tryouts when bundled with my other libraries.
|
50
|
-
* CHANGE: Gibbler::Complex.gibbler will now append fields when called multiple times.
|
51
|
-
|
52
|
-
### 0.8.1 (2010-04-11)
|
53
|
-
|
54
|
-
NOTE: Digest calculation for Range objects has changed.
|
55
|
-
Ranges or objects containing Ranges will have different
|
56
|
-
digests than those created in previous releases.
|
57
|
-
|
58
|
-
* FIXED: "can't iterate from Float" error for Ranges containing a Float
|
59
|
-
* CHANGE: Range digests are now based on the format "CLASS:FIRST:LAST:VALUE"
|
60
|
-
|
61
|
-
### 0.8.0 (2010-04-08)
|
62
|
-
|
63
|
-
* CHANGE: Gibber::Object#__gibbler now accepts only 1 optional argument: digest_type
|
64
|
-
* ADDED: Gibbler::Digest#to_i which assumes base 16
|
65
|
-
* ADDED: Gibbler::Object#gibbler now accepts a digest type
|
66
|
-
* ADDED: Gibbler::Digest#to_s and #base can take a base argument
|
67
|
-
|
68
|
-
### 0.7.7 (2010-03-29)
|
69
|
-
|
70
|
-
* ADDED: Gibbler::Digest#shorten
|
71
|
-
|
72
|
-
### 0.7.6 (2010-03-18)
|
73
|
-
|
74
|
-
* FIXED: The previous fix missed the case where gibbler_fields was null
|
75
|
-
|
76
|
-
### 0.7.5 (2010-03-18)
|
77
|
-
|
78
|
-
* FIXED: :undefined method `each' for :fieldname:Symbol when only one element in gibbler_fields
|
79
|
-
|
80
|
-
### 0.7.4 (2010-02-12)
|
81
|
-
|
82
|
-
* CHANGE: Remove hanna dependency [Diego Elio 'Flameeyes' Pettenò]
|
83
|
-
|
84
|
-
### 0.7.3 (2010-01-15)
|
85
|
-
|
86
|
-
* ADDED: Support for base36 representations of digests
|
87
|
-
|
88
|
-
### 0.7.2 (2009-12-08)
|
89
|
-
|
90
|
-
* FIXED: Gibbler::Complex no longer includes the '@' for instance
|
91
|
-
variable names used in digest calculation.
|
92
|
-
* ADDED: Gibbler::Complex support for specifying which fields
|
93
|
-
to use in digest calculation.
|
94
|
-
|
95
|
-
### 0.7.1 (2009-10-09)
|
96
|
-
|
97
|
-
* FIXED: Gibbler::Complex now sorts instance variables before processing.
|
98
|
-
This resolves the issue of digest compatibility between 1.8, 1.9, and JRuby.
|
99
|
-
|
100
|
-
### 0.7.0 (2009-10-07)
|
101
|
-
|
102
|
-
NOTE: Digest calculation for Proc objects has changed. Procs
|
103
|
-
or objects containing Procs will have different digests than
|
104
|
-
those created in previous releases.
|
105
|
-
|
106
|
-
* CHANGE: Proc digests are now based on the values of obj.class
|
107
|
-
and obj.name (if available).
|
108
|
-
|
109
|
-
### 0.6.4 (2009-10-07)
|
110
|
-
|
111
|
-
* FIXED: Now using correct superclass for DateTime (Date)
|
112
|
-
* CHANGE: aliases.rb will now require gibbler so you don't need to specify both.
|
113
|
-
i.e. require 'gibbler'
|
114
|
-
require 'gibbler/aliases'
|
115
|
-
* CHANGE: Gibbler::Object#gibbler returns the value of gibbler_cache when
|
116
|
-
the object is frozen, without calculation.
|
117
|
-
* ADDED: Gibbler::Object#freeze to create digest before freezing.
|
118
|
-
* ADDED: Out of the box support for Regexp (Gibbler::String)
|
119
|
-
* ADDED: Gibbler::Object#digest_cache alias for gibbler_cache
|
120
|
-
|
121
|
-
### 0.6.3 (2009-09-30)
|
122
|
-
|
123
|
-
* FIXED: Won't save digest to cache if the object is frozen
|
124
|
-
* CHANGE: Renamed __gibbler_cache to gibbler_cache (with backwards compatability)
|
125
|
-
* CHANGE: Gibbler::Digest#== now returns true only for exact matches
|
126
|
-
* ADDED: Gibbler::Digest#shorter, Gibbler::Digest#tiny, Gibbler::Digest#===
|
127
|
-
|
128
|
-
### 0.6.2 (2009-09-15)
|
129
|
-
|
130
|
-
* FIXED: Enforce specific string format for Time objects. Fixes
|
131
|
-
an issue with Ruby 1.8.7 which formats the to_s value differently
|
132
|
-
than 1.8.6 and 1.9.1.
|
133
|
-
* ADDED: Support for NilClass, File, and URI
|
134
|
-
|
135
|
-
### 0.6.1 (2009-08-25)
|
136
|
-
|
137
|
-
* ADDED: Support for Date, Time, and DateTime. Time and DateTime
|
138
|
-
refers to times in UTC.
|
139
|
-
* ADDED: Support for Range.
|
140
|
-
|
141
|
-
### 0.6.0 (2009-07-20)
|
142
|
-
|
143
|
-
NOTE: Digest calculation for Proc and Class objects have changed.
|
144
|
-
Digests created for these types will not match previous releases.
|
145
|
-
|
146
|
-
* FIXED: Proc digests no longer refer to Proc#binding
|
147
|
-
* CHANGE: The Gibbler module now raises an exception if it's included
|
148
|
-
* CHANGE: Module and Class now use the default Gibbler::Object digest
|
149
|
-
* ADDED: Gibbler::Object now contains a default digest method
|
150
|
-
|
151
|
-
### 0.5.4 (2009-07-17)
|
152
|
-
|
153
|
-
* FIXED: Improved support for Symbol and Fixnum objects with Attic 0.4
|
154
|
-
|
155
|
-
### 0.5.3 (2009-07-12)
|
156
|
-
|
157
|
-
* FIXED: Updated gemspec to fix missing files (aliases)
|
158
|
-
* CHANGE: conversion to attic instead of weirdo instance
|
159
|
-
variables (@__gibbler__ and @__gibbler_history)
|
160
|
-
* NEW DEPENDENCY: attic
|
161
|
-
|
162
|
-
### 0.5.2 (2009-07-07)
|
163
|
-
|
164
|
-
* CHANGE: Moved Gibbler instance methods to Gibbler::Object
|
165
|
-
* ADDED: Proc.gibbler which is included by default
|
166
|
-
* ADDED: gibbler aliases to allow shorter methods by request.
|
167
|
-
|
168
|
-
### 0.5.1 (2009-07-06)
|
169
|
-
|
170
|
-
* CHANGE: Renamed gibbler_revert to gibbler_revert! (Thanks ivey)
|
171
|
-
|
172
|
-
### 0.5 (2009-07-01)
|
173
|
-
|
174
|
-
NOTE: This is a significant change from 0.4. Many method names
|
175
|
-
have been modified so this release is not backwards compatible.
|
176
|
-
|
177
|
-
* CHANGE: Now refer to "gibble" as "digest" in all docs and methods.
|
178
|
-
* CHANGE: Gibbler#gibble -> Gibbler#gibbler
|
179
|
-
* CHANGE: Gibble is now Gibbler::Digest
|
180
|
-
* ADDED: Gibbler::History, supporting gibbler_snapshots and gibbler_revert
|
181
|
-
for the following objects: Array, Hash
|
182
|
-
* ADDED: Support for short, 8-character digests
|
183
|
-
* ADDED: Expanded test coverage
|
184
|
-
|
185
|
-
### 0.4 (2009-06-30)
|
186
|
-
|
187
|
-
NOTE: Calculated digests have changed since 0.3. Most digests created with
|
188
|
-
0.3 and earlier will not match those created in 0.4 for the same object
|
189
|
-
|
190
|
-
* FIXED: Hash and Array now use the class of the value for hashing
|
191
|
-
rather than Hash or Array (respectively).
|
192
|
-
* FIXED: __gibbler methods now return a digest based on their own class.
|
193
|
-
Previously, all digests were created by String.__gibbler so the class
|
194
|
-
name from the original object got lost.
|
195
|
-
* CHANGE: Gibbler methods are no longer available to all Ruby classes
|
196
|
-
by default. The default list is now: String, Hash, Array, Symbol,
|
197
|
-
Class, Fixnum, Bignum.
|
198
|
-
* CHANGE: Renamed Gibbler.digest_type to Gibbler.digest_type
|
199
|
-
* ADDED: Custom objects can now "include Gibbler::Complex"
|
200
|
-
|
201
|
-
### 0.3 (2009-06-29)
|
202
|
-
|
203
|
-
* CHANGE: Renamed to_gibble -> gibble
|
204
|
-
* CHANGE: Renamed __default_gibbler to__gibbler
|
205
|
-
* CHANGE: Created Gibbler module, all other modules can
|
206
|
-
include its junk into their namespace.
|
207
|
-
* ADDED: Object#hash and performance tryouts
|
208
|
-
|
209
|
-
### 0.2 (2009-06-25)
|
210
|
-
|
211
|
-
NOTE: Initial release
|
data/sig/gibbler.rbs
DELETED