gibbler 0.10.0.pre.RC1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efaadbe4388e45b7918af879e718cbfea8162fdbe4fb52cd32fdf395b35ae3eb
4
- data.tar.gz: 426cdcba4014abd8623a1c637b8f8619c612f353f5dec6e91ef742ca2217f37f
3
+ metadata.gz: 9a479165cd2790400e7bb4df99cc331bca1d73395f27536b954eb4e3bcde107a
4
+ data.tar.gz: 0fcc8f318ac1601b153bd044363c42bb041d47a5500ba4dba81bd69dc103f286
5
5
  SHA512:
6
- metadata.gz: a75c385122082b53265fc24ea474ea9cf8b960cf9b83611a19095255e28431824c7260b638cbc5c47f965b5cd35bcc1fdb019716a1e07638c6e0fb29397901b3
7
- data.tar.gz: 349b7bf8f8591e89f3ce715628aa2c164c03477f99543a2512d4b3ed3dc858a8ba802f1b54d064e6d752546ab8c3ec497bfbb7f52b32abb7811951bd0cb1ef44
6
+ metadata.gz: 510027067dbf7f7bb9f16fca0ff92ba4fe796fd5ac7321823aa0b2e54954c9a6ddb919219f349ab912f47a78a737b19bb4fd10beddb57b0337748ae33938d353
7
+ data.tar.gz: 057167cfa60322508b366a7a5a5661f8325ab7821f7b6028a65d8cf0307ce6985f81654567bf688844ad3d0a0f834262bf92b98976698a33cb2d2dc718da6a6b
data/.gitignore CHANGED
@@ -9,8 +9,8 @@
9
9
  *.txt
10
10
  .ruby-version
11
11
  appendonlydir
12
- Gemfile.lock
13
12
  etc/config
14
13
  log
15
14
  tmp
16
15
  vendor
16
+ *.gem
data/Gemfile CHANGED
@@ -2,11 +2,13 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- ruby '>= 3.1.4'
5
+ ruby '>= 2.6.8'
6
6
 
7
7
  # Specify your gem's dependencies in gibbler.gemspec
8
8
  # gemspec
9
9
 
10
+ gem 'attic', ">= 0.9.0.pre.rc2"
11
+
10
12
  gem "rake"
11
13
 
12
14
  group :development do
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
- $ bundle add gibbler
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
- $ gem install gibbler
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
- require 'gibbler'
32
+ require 'gibbler'
28
33
 
29
- g = Gibbler.new 'id', 1001 # => f4fb3796ababa3788d1bded8fdc589ab1ccb1c3d
30
- g.base(36) # => sm71s7eam4hm5jlsuzlqkbuktwpe5h9
34
+ g = Gibbler.new 'id', 1001 # => f4fb3796ababa3788d1bded8fdc589ab1ccb1c3d
35
+ g.base(36) # => sm71s7eam4hm5jlsuzlqkbuktwpe5h9
31
36
 
32
- g == 'f4fb3796ababa3788d1bded8fdc589ab1ccb1c3d' # => true
33
- g === 'f4fb379' # => true
37
+ g == 'f4fb3796ababa3788d1bded8fdc589ab1ccb1c3d' # => true
38
+ g === 'f4fb379' # => true
34
39
  ```
35
40
 
36
41
  ### Example 2 -- Mixins Usage
37
42
 
38
43
  ```ruby
39
- require 'gibbler/mixins'
44
+ require 'gibbler/mixins'
40
45
 
41
- "kimmy".gibbler # => c8027100ecc54945ab15ddac529230e38b1ba6a1
42
- :kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
46
+ "kimmy".gibbler # => c8027100ecc54945ab15ddac529230e38b1ba6a1
47
+ :kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
43
48
 
44
- config = {}
45
- config.gibbler # => 4fdcadc66a38feb9c57faf3c5a18d5e76a6d29bf
46
- config.gibbled? # => false
49
+ config = {}
50
+ config.gibbler # => 4fdcadc66a38feb9c57faf3c5a18d5e76a6d29bf
51
+ config.gibbled? # => false
47
52
 
48
- config[:server] = {
49
- :users => [:dave, :ali],
50
- :ports => [22, 80, 443]
51
- }
52
- config.gibbled? # => true
53
- config.gibbler # => ef23d605f8c4fc80a8e580f9a0e8dab8426454a8
53
+ config[:server] = {
54
+ :users => [:dave, :ali],
55
+ :ports => [22, 80, 443]
56
+ }
57
+ config.gibbled? # => true
58
+ config.gibbler # => ef23d605f8c4fc80a8e580f9a0e8dab8426454a8
54
59
 
55
- config[:server][:users] << :yanni
60
+ config[:server][:users] << :yanni
56
61
 
57
- config.gibbler # => 4c558a56bc2abf5f8a845a69e47ceb5e0003683f
62
+ config.gibbler # => 4c558a56bc2abf5f8a845a69e47ceb5e0003683f
58
63
 
59
- config.gibbler.short # => 4c558a56
64
+ config.gibbler.short # => 4c558a56
60
65
 
61
- config.gibbler.base36 # => 8x00l83jov4j80i9vfzpaxr9jag23wf
66
+ config.gibbler.base36 # => 8x00l83jov4j80i9vfzpaxr9jag23wf
62
67
 
63
- config.gibbler.base36.short # => 8x00l83j
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
- require 'gibbler/mixins'
72
- require 'gibbler/history'
76
+ require 'gibbler/mixins'
77
+ require 'gibbler/history'
73
78
 
74
- a = { :magic => :original }
75
- a.gibbler_commit # => d7049916ddb25e6cc438b1028fb957e5139f9910
79
+ a = { :magic => :original }
80
+ a.gibbler_commit # => d7049916ddb25e6cc438b1028fb957e5139f9910
76
81
 
77
- a[:magic] = :updated
78
- a.gibbler_commit # => b668098e16d08898532bf3aa33ce2253a3a4150e
82
+ a[:magic] = :updated
83
+ a.gibbler_commit # => b668098e16d08898532bf3aa33ce2253a3a4150e
79
84
 
80
- a[:magic] = :changed
81
- a.gibbler_commit # => 0b11c377fccd44554a601e5d2b135c46dc1c4cb1
85
+ a[:magic] = :changed
86
+ a.gibbler_commit # => 0b11c377fccd44554a601e5d2b135c46dc1c4cb1
82
87
 
83
- a.gibbler_history # => d7049916, b668098e, 0b11c377
88
+ a.gibbler_history # => d7049916, b668098e, 0b11c377
84
89
 
85
- a.gibbler_revert! 'd7049916' # Return to a specific commit
86
- a.gibbler # => d7049916ddb25e6cc438b1028fb957e5139f9910
87
- a # => { :magic => :original }
90
+ a.gibbler_revert! 'd7049916' # Return to a specific commit
91
+ a.gibbler # => d7049916ddb25e6cc438b1028fb957e5139f9910
92
+ a # => { :magic => :original }
88
93
 
89
- a.delete :magic
94
+ a.delete :magic
90
95
 
91
- a.gibbler_revert! # Return to the previous commit
92
- a.gibbler # => 0b11c377fccd44554a601e5d2b135c46dc1c4cb1
93
- a # => { :magic => :changed }
96
+ a.gibbler_revert! # Return to the previous commit
97
+ a.gibbler # => 0b11c377fccd44554a601e5d2b135c46dc1c4cb1
98
+ a # => { :magic => :changed }
94
99
 
95
100
 
96
- a.gibbler_object 'b668098e' # => { :magic => :updated }
97
- a.gibbler_stamp # => 2009-07-01 18:56:52 -0400
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
- require 'gibbler/aliases'
113
+ require 'gibbler/aliases'
109
114
 
110
- "kimmy".digest # => c8027100ecc54945ab15ddac529230e38b1ba6a1
111
- :kimmy.digest # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
115
+ "kimmy".digest # => c8027100ecc54945ab15ddac529230e38b1ba6a1
116
+ :kimmy.digest # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
112
117
 
113
- a = [:a, :b, :c]
114
- a.digest # => e554061823b8f06367555d1ee4c25b4ffee61944
115
- a << :d
116
- a.changed? # => true
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
- require 'gibbler/mixins'
143
+ require 'gibbler/mixins'
136
144
 
137
- Gibbler.digest_type = Digest::MD5
145
+ Gibbler.digest_type = Digest::MD5
138
146
 
139
- :kimmy.gibbler # => 0c61ff17f46223f355759934154d5dcb
147
+ :kimmy.gibbler # => 0c61ff17f46223f355759934154d5dcb
140
148
 
141
- :kimmy.gibbler(Digest::SHA1) # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
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
- require 'openssl'
155
+ require 'openssl'
148
156
 
149
- Gibbler.digest_type = OpenSSL::Digest::SHA256
157
+ Gibbler.digest_type = OpenSSL::Digest::SHA256
150
158
 
151
- :kimmy.gibbler # => 1069428e6273cf329436c3dce9b680d4d4e229d7b7...
159
+ :kimmy.gibbler # => 1069428e6273cf329436c3dce9b680d4d4e229d7b7...
152
160
  ```
153
161
 
154
162
  ### Example 6 -- All your base
155
163
 
156
164
  ```ruby
157
- require 'gibbler/mixins'
165
+ require 'gibbler/mixins'
158
166
 
159
- :kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
160
- :kimmy.gibbler.base(16) # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
161
- :kimmy.gibbler.base(36) # => 9nydr6mpv6w4k8ngo3jtx0jz1n97h7j
167
+ :kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
168
+ :kimmy.gibbler.base(16) # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
169
+ :kimmy.gibbler.base(36) # => 9nydr6mpv6w4k8ngo3jtx0jz1n97h7j
162
170
 
163
- :kimmy.gibbler.base(10) # => 472384540402900668368761869477227308873774630879
164
- :kimmy.gibbler.to_i # => 472384540402900668368761869477227308873774630879
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
- require 'gibbler/mixins'
180
+ require 'gibbler/mixins'
173
181
 
174
- :kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
182
+ :kimmy.gibbler # => 52be7494a602d85ff5d8a8ab4ffe7f1b171587df
175
183
 
176
- Gibbler.secret = "sUp0r5ekRu7"
184
+ Gibbler.secret = "sUp0r5ekRu7"
177
185
 
178
- :kimmy.gibbler # => 6c5f5aff4d809cec7e7da091214a35a2698489f8
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
- class FullHouse
187
- include Gibbler::Complex
188
- attr_accessor :roles
189
- end
194
+ class FullHouse
195
+ include Gibbler::Complex
196
+ attr_accessor :roles
197
+ end
190
198
 
191
- a = FullHouse.new
192
- a.gibbler # => 4192d4cb59975813f117a51dcd4454ac16df6703
199
+ a = FullHouse.new
200
+ a.gibbler # => 4192d4cb59975813f117a51dcd4454ac16df6703
193
201
 
194
- a.roles = [:jesse, :joey, :danny, :kimmy, :michelle, :dj, :stephanie]
195
- a.gibbler # => 6ea546919dc4caa2bab69799b71d48810a1b48fa
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
- class Object
204
- include Gibbler::String
205
- end
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
- ---
1
+ ---
2
2
  :MAJOR: 0
3
- :MINOR: 9
3
+ :MINOR: 10
4
4
  :PATCH: 0
data/gibbler.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "gibbler"
3
+ s.version = "0.10.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
+
20
+ s.add_development_dependency "rubocop", "~> 1.0"
21
+ s.add_development_dependency "tryouts", "~> 2.2"
22
+ 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
- # = Gibbler
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
- return self.gibbler_cache if self.frozen?
150
- self.gibbler_cache = Gibbler::Digest.new self.__gibbler(digest_type)
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
- require 'gibbler/mixins'
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
- #=> "1d4b62e1e9f2c097b0cefb6877bf47c2015cdd21"
44
+ #=> "8faca3e967c94fe996fac1b5a5f595ef77e10df4"
45
45
 
46
46
  # Empty Array instance
47
47
  Array.gibbler
48
- #=> '48fda57c05684c9e5c3259557851943572183a21'
48
+ #=> '83c4994bb01eefc06aa267aa99aa12b55696616e'
49
49
 
50
50
  # Populated Array instance
51
51
  [1, 2, :runtime, [3, "four", [Object, true]]].gibbler
52
- #=> "3e1d79d113a409a96a13ca3879fc4c42027aa74b"
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
- a, b = 'something', 'anything'
77
- a.gibbler
78
- b.gibbler
79
- [a.gibbler_cache.short, b.gibbler_cache.short]
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('.', 'CHANGES.txt'))
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('.', 'CHANGES.txt'))
13
- file2 = File.new(File.join('.', 'README.rdoc'))
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.exists? @tempfile
36
+ File.unlink @tempfile if File.exist? @tempfile
metadata CHANGED
@@ -1,58 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gibbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0.pre.RC1
4
+ version: 0.10.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-03 00:00:00.000000000 Z
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
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tryouts
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.2.0.pre.RC1
47
+ version: '2.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.2.0.pre.RC1
55
- description: 'A out Gibbler: Git-like hashes for Ruby objects'
54
+ version: '2.2'
55
+ description: 'About Gibbler: Git-like hashes for Ruby objects'
56
56
  email: gems@solutious.com
57
57
  executables: []
58
58
  extensions: []
@@ -66,18 +66,19 @@ files:
66
66
  - CHANGELOG.md
67
67
  - CODE_OF_CONDUCT.md
68
68
  - Gemfile
69
+ - Gemfile.lock
69
70
  - LICENSE.txt
70
71
  - README.md
71
72
  - VERSION.yml
72
73
  - bin/console
73
74
  - bin/setup
75
+ - gibbler.gemspec
74
76
  - img/whoababy.gif
75
77
  - lib/gibbler.rb
76
78
  - lib/gibbler/aliases.rb
77
79
  - lib/gibbler/history.rb
78
80
  - lib/gibbler/mixins.rb
79
81
  - lib/gibbler/version.rb
80
- - sig/gibbler.rbs
81
82
  - try/01_core_ext_try.rb
82
83
  - try/02_compat_try.rb
83
84
  - try/05_gibbler_digest_try.rb
@@ -99,7 +100,7 @@ files:
99
100
  - try/59_history_exceptions_try.rb
100
101
  - try/80_performance_try.rb
101
102
  - try/90_alias_try.rb
102
- homepage: http://github.com/delano/gibbler
103
+ homepage: https://github.com/delano/gibbler
103
104
  licenses:
104
105
  - MIT
105
106
  metadata: {}
@@ -111,14 +112,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
112
  requirements:
112
113
  - - ">="
113
114
  - !ruby/object:Gem::Version
114
- version: 3.1.4
115
+ version: 2.6.8
115
116
  required_rubygems_version: !ruby/object:Gem::Requirement
116
117
  requirements:
117
- - - ">"
118
+ - - ">="
118
119
  - !ruby/object:Gem::Version
119
- version: 1.3.1
120
+ version: '0'
120
121
  requirements: []
121
- rubygems_version: 3.3.26
122
+ rubygems_version: 3.4.12
122
123
  signing_key:
123
124
  specification_version: 4
124
125
  summary: Git-like hashes for Ruby objects
data/sig/gibbler.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Gibbler
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end