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.
@@ -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...TIME_STR_LEN]
67
- raise ArgumentError if timestamp_str.size < TIME_STR_LEN
68
- raise ArgumentError unless timestamp_str.match(TIME_VALIDATOR)
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[TIME_STR_LEN..-1]
71
+ return timestamp, the_sist_str[20..-1]
72
72
  end
73
73
 
74
74
  def self.resist(the_sist_str)
@@ -2,7 +2,7 @@ class Redsafe
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 2
5
+ PATCH = 3
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redsafe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruby Shot