redsafe 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/models/scarlet_letters.rb +7 -7
- data/lib/redsafe/version.rb +1 -1
- metadata +1 -1
|
@@ -55,20 +55,20 @@ class User
|
|
|
55
55
|
#:TIME_FMT = '%Y-%m-%dT%H:%M:%SZ'
|
|
56
56
|
junk = self.random_string(6)
|
|
57
57
|
t = Time.now.getutc
|
|
58
|
-
time_str = t.strftime(%Y-%m-%dT%H:%M:%SZ)
|
|
58
|
+
time_str = t.strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
59
59
|
the_sist_str = time_str + junk
|
|
60
60
|
return the_sist_str
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def self.desist( the_sist_str )
|
|
64
|
-
TIME_STR_LEN = '0000-00-00T00:00:00Z'.size
|
|
65
|
-
TIME_VALIDATOR = /\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ/
|
|
66
|
-
timestamp_str = the_sist_str[0...
|
|
67
|
-
raise ArgumentError if timestamp_str.size <
|
|
68
|
-
raise ArgumentError unless timestamp_str.match(
|
|
64
|
+
#TIME_STR_LEN = '0000-00-00T00:00:00Z'.size
|
|
65
|
+
#TIME_VALIDATOR = /\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ/
|
|
66
|
+
timestamp_str = the_sist_str[0...20]
|
|
67
|
+
raise ArgumentError if timestamp_str.size < 20
|
|
68
|
+
raise ArgumentError unless timestamp_str.match('/\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ/')
|
|
69
69
|
timestamp = Time.parse(timestamp_str).to_i
|
|
70
70
|
raise ArgumentError if ts < 0
|
|
71
|
-
return timestamp, the_sist_str[
|
|
71
|
+
return timestamp, the_sist_str[20..-1]
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def self.resist(the_sist_str)
|
data/lib/redsafe/version.rb
CHANGED