lib/trocla/util.rb in trocla-0.1.0 vs lib/trocla/util.rb in trocla-0.1.1
- old
+ new
@@ -18,10 +18,11 @@
@charsets ||= {
'default' => chars,
'alphanumeric' => alphanumeric,
'shellsafe' => shellsafe,
'windowssafe' => windowssafe,
+ 'numeric' => numeric,
}
end
def chars
@chars ||= shellsafe + special_chars
@@ -32,9 +33,12 @@
def windowssafe
@windowssafe ||= alphanumeric + windowssafe_chars
end
def alphanumeric
@alphanumeric ||= ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
+ end
+ def numeric
+ @numeric ||= ('0'..'9').to_a
end
def special_chars
@special_chars ||= "*()&![]{}-".split(//)
end
def shellsafe_chars