You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: lib/faker/default/alphanumeric.rb
+36-8
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,60 @@
2
2
3
3
moduleFaker
4
4
classAlphanumeric < Base
5
-
class << self
6
-
ALPHABET=('a'..'z').to_a
7
-
ALPHANUMS=ALPHABET + (0..9).to_a
5
+
ALPHANUMS=LLetters + Numbers
8
6
7
+
class << self
9
8
defalpha(legacy_number=NOT_GIVEN,number: 32)
10
9
iflegacy_number != NOT_GIVEN
11
10
warn_with_uplevel'Passing `number` with the 1st argument of `Alphanumeric.alpha` is deprecated. Use keyword argument like `Alphanumeric.alpha(number: ...)` instead.',uplevel: 1
warn_with_uplevel'Passing `number` with the 1st argument of `Alphanumeric.alphanumeric` is deprecated. Use keyword argument like `Alphanumeric.alphanumeric(number: ...)` instead.',uplevel: 1
24
36
number=legacy_number
25
37
end
26
-
27
38
char_count=resolve(number)
28
39
return''ifchar_count.to_i < 1
40
+
raiseArgumentError,'min_alpha must be greater than or equal to 0'ifmin_alpha&.negative?
41
+
raiseArgumentError,'min_numeric must be greater than or equal to 0'ifmin_numeric&.negative?
warn_with_uplevel'Passing `min_length` with the 1st argument of `Internet.password` is deprecated. Use keyword argument like `Internet.password(min_length: ...)` instead.',uplevel: 1
warn_with_uplevel'Passing `number` with the 1st argument of `Lorem.characters` is deprecated. Use keyword argument like `Lorem.characters(number: ...)` instead.',uplevel: 1
0 commit comments