gibbler 0.7.6 → 0.7.7
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 +4 -0
- data/gibbler.gemspec +1 -1
- data/lib/gibbler.rb +9 -4
- metadata +2 -2
data/CHANGES.txt
CHANGED
data/gibbler.gemspec
CHANGED
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.7.
|
18
|
+
VERSION = "0.7.7"
|
19
19
|
|
20
20
|
require 'gibbler/mixins'
|
21
21
|
|
@@ -37,6 +37,11 @@ class Gibbler::Digest < String
|
|
37
37
|
self.class.new self.to_i(16).to_s(36)
|
38
38
|
end
|
39
39
|
|
40
|
+
# Shorten the digest to the given (optional) length.
|
41
|
+
def shorten(len=20)
|
42
|
+
self[0..len-1]
|
43
|
+
end
|
44
|
+
|
40
45
|
# Returns the first 8 characters of itself (the digest).
|
41
46
|
#
|
42
47
|
# e.g.
|
@@ -45,7 +50,7 @@ class Gibbler::Digest < String
|
|
45
50
|
# "kimmy".gibbler.short # => c8027100
|
46
51
|
#
|
47
52
|
def short
|
48
|
-
|
53
|
+
shorten(8)
|
49
54
|
end
|
50
55
|
|
51
56
|
# Returns the first 6 characters of itself (the digest).
|
@@ -56,7 +61,7 @@ class Gibbler::Digest < String
|
|
56
61
|
# "kimmy".gibbler.tiny # => c80271
|
57
62
|
#
|
58
63
|
def shorter
|
59
|
-
|
64
|
+
shorten(6)
|
60
65
|
end
|
61
66
|
|
62
67
|
# Returns the first 4 characters of itself (the digest).
|
@@ -67,7 +72,7 @@ class Gibbler::Digest < String
|
|
67
72
|
# "kimmy".gibbler.tiny # => c802
|
68
73
|
#
|
69
74
|
def tiny
|
70
|
-
|
75
|
+
shorten(4)
|
71
76
|
end
|
72
77
|
|
73
78
|
# Returns true when +ali+ matches +self+
|
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.7.
|
4
|
+
version: 0.7.7
|
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-03-
|
12
|
+
date: 2010-03-29 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|