redsafe 0.0.5 → 0.1.1
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 +5 -6
- data/lib/redsafe/version.rb +2 -2
- metadata +2 -3
- data/GemcutterInstructions.rdoc +0 -74
@@ -52,7 +52,7 @@ class User
|
|
52
52
|
#3. resist: receives the desist string and reviews its integrity
|
53
53
|
|
54
54
|
def self.sist
|
55
|
-
|
55
|
+
TIME_FMT = '%Y-%m-%dT%H:%M:%SZ'
|
56
56
|
junk = self.random_string(6)
|
57
57
|
t = Time.now.getutc
|
58
58
|
time_str = t.strftime(TIME_FMT)
|
@@ -61,19 +61,18 @@ class User
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def self.desist( the_sist_str )
|
64
|
-
|
65
|
-
|
66
|
-
const_set(TIME_VALIDATOR,"/\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ/")
|
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/
|
67
66
|
timestamp_str = the_sist_str[0...TIME_STR_LEN]
|
68
67
|
raise ArgumentError if timestamp_str.size < TIME_STR_LEN
|
69
68
|
raise ArgumentError unless timestamp_str.match(TIME_VALIDATOR)
|
70
69
|
timestamp = Time.parse(timestamp_str).to_i
|
71
70
|
raise ArgumentError if ts < 0
|
72
|
-
return timestamp, the_sist_str[
|
71
|
+
return timestamp, the_sist_str[TIME_STR_LEN..-1]
|
73
72
|
end
|
74
73
|
|
75
74
|
def self.resist(the_sist_str)
|
76
|
-
|
75
|
+
TIME_RANGE = 60*60*5
|
77
76
|
timestamp, junk = self.desist(the_sist_str)
|
78
77
|
now = Time.now.to_i
|
79
78
|
start = now - TIME_RANGE
|
data/lib/redsafe/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruby Shot
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-11 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -84,7 +84,6 @@ extra_rdoc_files:
|
|
84
84
|
files:
|
85
85
|
- .document
|
86
86
|
- .gitignore
|
87
|
-
- GemcutterInstructions.rdoc
|
88
87
|
- LICENSE
|
89
88
|
- README.rdoc
|
90
89
|
- Rakefile
|
data/GemcutterInstructions.rdoc
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
= RedSafe Gemcutter Setup
|
2
|
-
|
3
|
-
Gem Cutter set up was more time consuming than I had anticipated. Realized that I needed: task "default" => ["test"] inside the Rakefile to have rake command work for me. Additionally, I needed to use: gem cert before I could upload to Gemcutter.
|
4
|
-
|
5
|
-
== Notes on the Red Safe Gem Creation
|
6
|
-
|
7
|
-
* 1) rake
|
8
|
-
(Needed to set a default for the task.)
|
9
|
-
|
10
|
-
Added default task to Rakefile
|
11
|
-
task "default" => ["test"]
|
12
|
-
|
13
|
-
* 2) rake gemspec
|
14
|
-
(Worked for me first time.)
|
15
|
-
|
16
|
-
Generated: redsafe.gemspec
|
17
|
-
redsafe.gemspec is valid.
|
18
|
-
|
19
|
-
* 3) rdoc
|
20
|
-
(Created documentation for the redsafe project.)
|
21
|
-
|
22
|
-
redsafe.rb: mm.m.......c...
|
23
|
-
sl_user.rb: c.....cc....
|
24
|
-
sl_aah.rb: m.m.....m..
|
25
|
-
scarlet_letters.rb: c........
|
26
|
-
version.rb: cm
|
27
|
-
Generating HTML...
|
28
|
-
|
29
|
-
Files: 5
|
30
|
-
Classes: 6
|
31
|
-
Modules: 7
|
32
|
-
Methods: 36
|
33
|
-
Elapsed: 0.593s
|
34
|
-
|
35
|
-
* 4) gem build redsafe.gemspec
|
36
|
-
(Was able to build after I took author name "Ruby Shot" from an array structure and turned it into a string by removing the brackets, [ ].
|
37
|
-
|
38
|
-
# gem build redsafe.gemspec
|
39
|
-
ERROR: While executing gem ... (Gem::InvalidSpecificationException)
|
40
|
-
authors must be Array of Strings
|
41
|
-
|
42
|
-
|
43
|
-
* 5) gem push redsafe.gem
|
44
|
-
(As mentioned above, the gem certification was not set. Thus, I couldn't get an upload to Gemcutter.)
|
45
|
-
|
46
|
-
Your api key has been stored in ~/.gem/credentials
|
47
|
-
Pushing gem to Gemcutter...
|
48
|
-
ERROR: While executing gem ... (Errno::ENOENT)
|
49
|
-
No such file or directory - redsafe.gem
|
50
|
-
|
51
|
-
|
52
|
-
* 6) gem cert --build you@yourmail.com
|
53
|
-
(Use this command to create the certification for Gemcutter. I used my email address. I also moved the Public Cert and the Private Key to a safer location.)
|
54
|
-
|
55
|
-
Public Cert: gem-public_cert.pem
|
56
|
-
Private Key: gem-private_key.pem
|
57
|
-
Don't forget to move the key file to somewhere private...
|
58
|
-
|
59
|
-
|
60
|
-
* 7)gem push redsafe-0.1.1.gem
|
61
|
-
(I was successful when I used the above command. Used the Gemcutter search and verified that redsafe was being hosted on Gemcutter. Didn't test it, but left it in place.)
|
62
|
-
|
63
|
-
Pushing gem to Gemcutter...
|
64
|
-
Successfully registered gem: redsafe (0.1.1)
|
65
|
-
|
66
|
-
== Copyright
|
67
|
-
|
68
|
-
Copyright (c) 2010 Ruby Shot. See LICENSE for details.
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|