frosty_meadow 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/frosty_meadow.rb +12 -4
- metadata +1 -1
data/lib/frosty_meadow.rb
CHANGED
@@ -2,8 +2,8 @@ require 'json'
|
|
2
2
|
|
3
3
|
module FrostyMeadow
|
4
4
|
module Version
|
5
|
-
MAJOR
|
6
|
-
MINOR
|
5
|
+
MAJOR = 2
|
6
|
+
MINOR = 0
|
7
7
|
PATCH = 0
|
8
8
|
|
9
9
|
FULL = [MAJOR, MINOR, PATCH].join('.')
|
@@ -15,6 +15,14 @@ module FrostyMeadow
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
module Hex
|
19
|
+
class << self
|
20
|
+
def generate length = 5
|
21
|
+
return ((0..length).map{rand(256).chr}*"").unpack("H*")[0][0,length]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
18
26
|
class << self
|
19
27
|
def generate params = {}
|
20
28
|
words = get_words params
|
@@ -48,10 +56,10 @@ module FrostyMeadow
|
|
48
56
|
return words
|
49
57
|
end
|
50
58
|
|
51
|
-
def generate_hex_name
|
59
|
+
def generate_hex_name
|
52
60
|
generated_string = self.generate(:separator => '-')
|
53
61
|
|
54
|
-
return "#{generated_string}-#{self.
|
62
|
+
return "#{generated_string}-#{self::Hex.generate}"
|
55
63
|
end
|
56
64
|
|
57
65
|
def hex_string length=5
|