footing 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/extensions/string.rb +1 -1
- metadata +1 -1
data/lib/extensions/string.rb
CHANGED
@@ -12,7 +12,7 @@ module Footing
|
|
12
12
|
# @option opts [Array] :reject A list of characters to omit from the key.
|
13
13
|
# @option opts [Boolean] :upcase Indicates that only use uppercase characters should be used.
|
14
14
|
# @return [String]
|
15
|
-
def
|
15
|
+
def random(length=12, opts={})
|
16
16
|
@chars ||= [(0..9).to_a, ('a'..'z').to_a, ('A'..'Z').to_a].flatten.map { |c| c.to_s }
|
17
17
|
chars = @chars.reject do |c|
|
18
18
|
c =~ /[a-z]/ if opts[:upcase]
|