gid 2.0.0 → 3.0.0
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/gid.rb +3 -2
- metadata +3 -2
data/gid.rb
CHANGED
@@ -9,10 +9,11 @@ class GID
|
|
9
9
|
return str
|
10
10
|
end
|
11
11
|
# Generates a new GID
|
12
|
-
def self.generate length
|
12
|
+
def self.generate length=32, lean=String
|
13
13
|
str = ""
|
14
14
|
letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
|
15
|
-
types = [Fixnum, String
|
15
|
+
types = [Fixnum, String]
|
16
|
+
types.push(lean)
|
16
17
|
length.times do
|
17
18
|
if types.sample == Fixnum
|
18
19
|
str << "#{rand(10)}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,8 @@ cert_chain: []
|
|
12
12
|
date: 2012-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Generates random mixes of numbers and letters of fixed length, usable
|
15
|
-
as UUIDs. Now filters out 'naughty' words
|
15
|
+
as UUIDs. Now filters out 'naughty' words. Offers a lean option, to provide more
|
16
|
+
characters or numbers in the GID. Also sets a default length of 32.
|
16
17
|
email: slmnwise@gmail.com
|
17
18
|
executables: []
|
18
19
|
extensions: []
|