redsafe 0.1.3 → 0.1.4

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.
@@ -4,6 +4,7 @@ if Object.const_defined?("DataMapper")
4
4
  require 'dm-validations'
5
5
  require 'date'
6
6
  require 'time'
7
+ require 'DateTime'
7
8
 
8
9
  require Pathname(__FILE__).dirname.expand_path + "sl_user.rb"
9
10
  require Pathname(__FILE__).dirname.expand_path + "sl_aah.rb"
@@ -61,7 +62,7 @@ class User
61
62
  end
62
63
 
63
64
  def self.desist( the_sist_str )
64
- #TIME_STR_LEN = '0000-00-00T00:00:00Z'.size
65
+ Time::DATE_FORMATS[:TIME_STR_LEN] = "0000-00-00T00:00:00Z"
65
66
  #TIME_VALIDATOR = /\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ/
66
67
  timestamp_str = the_sist_str[0...20]
67
68
  raise ArgumentError if timestamp_str.size < 20
@@ -72,7 +73,7 @@ class User
72
73
  end
73
74
 
74
75
  def self.resist(the_sist_str)
75
- TIME_RANGE = 60*60*5
76
+ const_set TIME_RANGE = 60*60*5
76
77
  timestamp, junk = self.desist(the_sist_str)
77
78
  now = Time.now.to_i
78
79
  start = now - TIME_RANGE
@@ -2,7 +2,7 @@ class Redsafe
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 3
5
+ PATCH = 4
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruby Shot