sixarm_ruby_current_user_id 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/INSTALL.txt +31 -0
- data/LICENSE.txt +12 -0
- data/README.rdoc +10 -0
- data/Rakefile +8 -0
- data/lib/sixarm_ruby_current_user_id.rb +25 -0
- data/test/sixarm_ruby_current_user_id_test.rb +32 -0
- data.tar.gz.sig +1 -0
- metadata +82 -0
- metadata.gz.sig +2 -0
data/.gemtest
ADDED
File without changes
|
data/INSTALL.txt
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
= SixArm.com Ruby Gem Install
|
2
|
+
|
3
|
+
|
4
|
+
First-time users: add our gem certificate and source.
|
5
|
+
When you do this once, it works for all our gems.
|
6
|
+
|
7
|
+
sudo wget http://sixarm.com/sixarm.pem
|
8
|
+
sudo gem cert --add sixarm.pem
|
9
|
+
sudo gem sources --add http://sixarm.com
|
10
|
+
|
11
|
+
Install the gem with advanced options.
|
12
|
+
|
13
|
+
sudo gem install sixarm_ruby_current_user_id --test --trust-policy HighSecurity
|
14
|
+
|
15
|
+
|
16
|
+
== Notes
|
17
|
+
|
18
|
+
Do you have any questions, comments, suggestions, or feedback?
|
19
|
+
Let us know, we're happy to help. Our email is sixarm@sixarm.com
|
20
|
+
|
21
|
+
Do you want to create your own high security gems?
|
22
|
+
Learn how at http://www.rubygems.org/read/chapter/21
|
23
|
+
|
24
|
+
To see your current gem certificate list:
|
25
|
+
|
26
|
+
sudo gem cert --list
|
27
|
+
|
28
|
+
Our cert looks like this:
|
29
|
+
|
30
|
+
/C=US/ST=California/L=San Francisco/O=SixArm/CN=sixarm.com
|
31
|
+
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
LICENSE
|
2
|
+
|
3
|
+
You may choose any of these licenses:
|
4
|
+
|
5
|
+
- CreativeCommons License, Non-commercial Share Alike
|
6
|
+
- LGPL, GNU Lesser General Public License
|
7
|
+
- MIT License
|
8
|
+
- Ruby License
|
9
|
+
|
10
|
+
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
11
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
12
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
= SixArm.com » Ruby » CurrentUserId module for Rails sessions
|
2
|
+
|
3
|
+
Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
|
4
|
+
Copyright:: Copyright (c) 2006-2011 Joel Parker Henderson
|
5
|
+
License:: See LICENSE.txt file
|
6
|
+
|
7
|
+
Get and set the current user id in the Rails session array.
|
8
|
+
|
9
|
+
|
10
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin rdoc
|
3
|
+
Please see README.rdoc
|
4
|
+
=end
|
5
|
+
|
6
|
+
module CurrentUserId
|
7
|
+
|
8
|
+
|
9
|
+
# Get the current user id in the Rails session array.
|
10
|
+
# Return the session's current user id.
|
11
|
+
|
12
|
+
def current_user_id
|
13
|
+
return session[:current_user_id]
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
# Set the current user id in the Rails session array.
|
18
|
+
# Return the current user id, suitable for chaining.
|
19
|
+
|
20
|
+
def current_user_id=(id)
|
21
|
+
return session[:current_user_id]=id
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'sixarm_ruby_current_user_id'
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
class Testing < Test::Unit::TestCase
|
7
|
+
|
8
|
+
include CurrentUserId
|
9
|
+
|
10
|
+
def session
|
11
|
+
@session||=Hash.new
|
12
|
+
end
|
13
|
+
|
14
|
+
ID=1234
|
15
|
+
|
16
|
+
def test_current_user_id_before_setting
|
17
|
+
assert_nil(current_user_id, "current_user_id is not set, so should be nil")
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_current_user_id_equals_return
|
21
|
+
assert_equal(ID, current_user_id=ID, "current_user_id is set to #{ID}, so current_user_id should return #{ID}")
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_current_user_id_round_trip
|
25
|
+
current_user_id=ID
|
26
|
+
expect=ID
|
27
|
+
actual=current_user_id
|
28
|
+
assert_equal(expect, actual, "current_user_id")
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
8H؝G�Kx��(k���c]�_�5�ѱ
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sixarm_ruby_current_user_id
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 1.2.6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- SixArm
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDBDCCAm2gAwIBAgIJAKPwEETU5bHoMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
|
15
|
+
BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
|
16
|
+
c2NvMQ8wDQYDVQQKEwZTaXhBcm0xEzARBgNVBAMTCnNpeGFybS5jb20wHhcNMTAx
|
17
|
+
MjEzMjMyNzEzWhcNMTMwOTA4MjMyNzEzWjBgMQswCQYDVQQGEwJVUzETMBEGA1UE
|
18
|
+
CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEPMA0GA1UEChMG
|
19
|
+
U2l4QXJtMRMwEQYDVQQDEwpzaXhhcm0uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GN
|
20
|
+
ADCBiQKBgQC94mD9JDwBsunsOI0VR3CXXbOWg9cWaWciwFyJNFiM7A9I8KPLfXUw
|
21
|
+
QC4czUe5ZuG4WHvinrWhkrCK+1dWBqoEClxdF/FoKO5a+tonGCjjmfy81JmFjjyx
|
22
|
+
eTsjsHyvw+Qik9kpf9aj6+pnkNrVswgNHVea2o9yabbEiS6VSeJWoQIDAQABo4HF
|
23
|
+
MIHCMB0GA1UdDgQWBBQzPJtqmSgc53eDN7aSzDQwr9TALDCBkgYDVR0jBIGKMIGH
|
24
|
+
gBQzPJtqmSgc53eDN7aSzDQwr9TALKFkpGIwYDELMAkGA1UEBhMCVVMxEzARBgNV
|
25
|
+
BAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xDzANBgNVBAoT
|
26
|
+
BlNpeEFybTETMBEGA1UEAxMKc2l4YXJtLmNvbYIJAKPwEETU5bHoMAwGA1UdEwQF
|
27
|
+
MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAooEexP/oPam1TP71SyuhxMb+uTrZbSQe
|
28
|
+
jVB+ExRwWadGwaNPUA56d39qwavwP+iu+3JpeonNMVvbWXF5naCX/dNFIeREHzER
|
29
|
+
ZDRQYMqru9TEMna6HD9zpcstF7vwThGovlOQ+3Y6plQ4nMzipXcZ9THqs65PIL0q
|
30
|
+
eabwpCbAopo=
|
31
|
+
-----END CERTIFICATE-----
|
32
|
+
|
33
|
+
date: 2011-04-18 00:00:00 -07:00
|
34
|
+
default_executable:
|
35
|
+
dependencies: []
|
36
|
+
|
37
|
+
description:
|
38
|
+
email: sixarm@sixarm.com
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files: []
|
44
|
+
|
45
|
+
files:
|
46
|
+
- .gemtest
|
47
|
+
- Rakefile
|
48
|
+
- README.rdoc
|
49
|
+
- INSTALL.txt
|
50
|
+
- LICENSE.txt
|
51
|
+
- lib/sixarm_ruby_current_user_id.rb
|
52
|
+
- test/sixarm_ruby_current_user_id_test.rb
|
53
|
+
has_rdoc: true
|
54
|
+
homepage: http://sixarm.com/
|
55
|
+
licenses: []
|
56
|
+
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0"
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
requirements: []
|
75
|
+
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 1.6.2
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: "SixArm.com \xC2\xBB Ruby \xC2\xBB CurrentUserId module for Rails sessions"
|
81
|
+
test_files:
|
82
|
+
- test/sixarm_ruby_current_user_id_test.rb
|
metadata.gz.sig
ADDED