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.
Files changed (2) hide show
  1. data/lib/frosty_meadow.rb +12 -4
  2. 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 = 1
6
- MINOR = 2
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.hex_string}"
62
+ return "#{generated_string}-#{self::Hex.generate}"
55
63
  end
56
64
 
57
65
  def hex_string length=5
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frosty_meadow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: