sentient_user 0.3.3 → 0.4.0
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.
- checksums.yaml +7 -0
- data/.rbenv-version +1 -1
- data/.travis.yml +9 -2
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile.lock +39 -48
- data/README.rdoc +11 -4
- data/lib/sentient_user.rb +1 -1
- data/lib/sentient_user/version.rb +1 -1
- data/sentient_user.gemspec +1 -1
- data/test/helper.rb +3 -3
- metadata +25 -46
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 6dfd6e56b189bfdf9b3aa9259fcc8ae318efb33e
|
|
4
|
+
data.tar.gz: cb056194c1d34ec530e47f007f759513048df1d0
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9dba531b5c19ededce385f3d7a8e74a8c5f86491688b3a75e09d48b6fcb697d038bc947dcfb625d6b4eb0671c64e0a6acaffe3e3ab1842701c3f11895f10a092
|
|
7
|
+
data.tar.gz: 054c51a81a183fc5ea3614c400e8a316fe0834f6cf2eb8e03a74ec3d78b1d6ea3cf6a1bd2fae9bf76a1ae168e356983c80b05d3ff7956c7aece22a37f8f49e6a
|
data/.rbenv-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.3.0
|
data/.travis.yml
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at [dbock at javaguy dot org]. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile.lock
CHANGED
|
@@ -1,67 +1,55 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
sentient_user (0.
|
|
4
|
+
sentient_user (0.4.0)
|
|
5
5
|
railties (>= 3.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
actionpack (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
builder (~> 3.0.0)
|
|
10
|
+
actionpack (4.0.13)
|
|
11
|
+
activesupport (= 4.0.13)
|
|
12
|
+
builder (~> 3.1.0)
|
|
14
13
|
erubis (~> 2.7.0)
|
|
15
|
-
|
|
16
|
-
rack (~>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ansi (1.4.3)
|
|
27
|
-
builder (3.0.4)
|
|
14
|
+
rack (~> 1.5.2)
|
|
15
|
+
rack-test (~> 0.6.2)
|
|
16
|
+
activesupport (4.0.13)
|
|
17
|
+
i18n (~> 0.6, >= 0.6.9)
|
|
18
|
+
minitest (~> 4.2)
|
|
19
|
+
multi_json (~> 1.3)
|
|
20
|
+
thread_safe (~> 0.1)
|
|
21
|
+
tzinfo (~> 0.3.37)
|
|
22
|
+
ansi (1.5.0)
|
|
23
|
+
builder (3.1.4)
|
|
24
|
+
docile (1.1.5)
|
|
28
25
|
erubis (2.7.0)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
journey (1.0.4)
|
|
32
|
-
json (1.7.5)
|
|
26
|
+
i18n (0.7.0)
|
|
27
|
+
json (1.8.3)
|
|
33
28
|
minitest (4.7.5)
|
|
34
29
|
minitest_should (0.3.1)
|
|
35
|
-
multi_json (1.
|
|
36
|
-
rack (1.
|
|
37
|
-
rack-
|
|
38
|
-
rack (>= 0.4)
|
|
39
|
-
rack-ssl (1.3.3)
|
|
40
|
-
rack
|
|
41
|
-
rack-test (0.6.2)
|
|
30
|
+
multi_json (1.12.1)
|
|
31
|
+
rack (1.5.5)
|
|
32
|
+
rack-test (0.6.3)
|
|
42
33
|
rack (>= 1.0)
|
|
43
|
-
railties (
|
|
44
|
-
actionpack (=
|
|
45
|
-
activesupport (=
|
|
46
|
-
rack-ssl (~> 1.3.2)
|
|
34
|
+
railties (4.0.13)
|
|
35
|
+
actionpack (= 4.0.13)
|
|
36
|
+
activesupport (= 4.0.13)
|
|
47
37
|
rake (>= 0.8.7)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
rdoc (3.12)
|
|
38
|
+
thor (>= 0.18.1, < 2.0)
|
|
39
|
+
rake (11.1.2)
|
|
40
|
+
rdoc (4.2.2)
|
|
52
41
|
json (~> 1.4)
|
|
53
|
-
simplecov (0.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
thor (0.18.1)
|
|
62
|
-
tilt (1.4.1)
|
|
63
|
-
turn (0.9.6)
|
|
42
|
+
simplecov (0.11.2)
|
|
43
|
+
docile (~> 1.1.0)
|
|
44
|
+
json (~> 1.8)
|
|
45
|
+
simplecov-html (~> 0.10.0)
|
|
46
|
+
simplecov-html (0.10.0)
|
|
47
|
+
thor (0.19.1)
|
|
48
|
+
thread_safe (0.3.5)
|
|
49
|
+
turn (0.9.7)
|
|
64
50
|
ansi
|
|
51
|
+
minitest (~> 4)
|
|
52
|
+
tzinfo (0.3.48)
|
|
65
53
|
|
|
66
54
|
PLATFORMS
|
|
67
55
|
ruby
|
|
@@ -74,3 +62,6 @@ DEPENDENCIES
|
|
|
74
62
|
sentient_user!
|
|
75
63
|
simplecov
|
|
76
64
|
turn
|
|
65
|
+
|
|
66
|
+
BUNDLED WITH
|
|
67
|
+
1.13.1
|
data/README.rdoc
CHANGED
|
@@ -11,17 +11,24 @@ How often have you needed to access the current user in your models? This happe
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
== Usage
|
|
14
|
-
include SentientUser in your user model
|
|
15
|
-
include SentientController in your application controller
|
|
14
|
+
* include SentientUser in your user model
|
|
15
|
+
* include SentientController in your application controller
|
|
16
16
|
|
|
17
17
|
== Assumptions and limitations
|
|
18
18
|
* Your user model is called 'User'.
|
|
19
19
|
* You have a current_user method available to your controllers
|
|
20
|
-
* You will write your own tests to cover this code.
|
|
20
|
+
* You will write your own tests to cover this code. The gem has tests, but its up to you to make sure you use this ability wisely.
|
|
21
21
|
|
|
22
22
|
If those assumptions don't work for you, feel free to unpack and hack. It's simple enough code to change. I purposefully didn't want to complicate it with an initializer, several config options, etc. as all that would blur this delightfully simple piece of code.
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
== Recent Changes
|
|
26
|
+
This gem has been remarkably stable for many years and many iterations of rails. The recent deprecation of before_filter in favor of before_action is making me update it.
|
|
27
|
+
|
|
28
|
+
* 0.4.0 - for use on Rails 5 and beyond.
|
|
29
|
+
* 0.3.3 - for versions prior to rails 5.
|
|
30
|
+
|
|
31
|
+
|
|
25
32
|
== Note on Patches/Pull Requests
|
|
26
33
|
|
|
27
34
|
* Fork the project.
|
|
@@ -34,4 +41,4 @@ If those assumptions don't work for you, feel free to unpack and hack. It's sim
|
|
|
34
41
|
|
|
35
42
|
== Copyright
|
|
36
43
|
|
|
37
|
-
Copyright (c)
|
|
44
|
+
Copyright (c) 2009-2016 bokmann. See LICENSE for details.
|
data/lib/sentient_user.rb
CHANGED
data/sentient_user.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ require File.expand_path('../lib/sentient_user/version.rb', __FILE__)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |gem|
|
|
5
5
|
gem.authors = ["bokmann"]
|
|
6
|
-
gem.email = ["dbock@
|
|
6
|
+
gem.email = ["dbock@javaguy.org"]
|
|
7
7
|
gem.description = %q{lets the User model in most authentication frameworks know who is the current user}
|
|
8
8
|
gem.summary = %q{A trivial bit of common code}
|
|
9
9
|
gem.homepage = "http://github.com/bokmann/sentient_user"
|
data/test/helper.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require 'rubygems'
|
|
2
|
-
require 'test/unit'
|
|
2
|
+
#require 'test/unit'
|
|
3
3
|
require "minitest/autorun"
|
|
4
4
|
require "minitest/should"
|
|
5
5
|
|
|
@@ -7,8 +7,8 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
|
7
7
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
8
8
|
require 'sentient_user'
|
|
9
9
|
|
|
10
|
-
class Test::Unit::TestCase
|
|
11
|
-
end
|
|
10
|
+
#class Test::Unit::TestCase
|
|
11
|
+
#end
|
|
12
12
|
|
|
13
13
|
class Person
|
|
14
14
|
include SentientUser
|
metadata
CHANGED
|
@@ -1,68 +1,60 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sentient_user
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 0.4.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- bokmann
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: railties
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
|
-
- -
|
|
17
|
+
- - ">="
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
21
19
|
version: '3.1'
|
|
22
20
|
type: :runtime
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
-
none: false
|
|
26
23
|
requirements:
|
|
27
|
-
- -
|
|
24
|
+
- - ">="
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
26
|
version: '3.1'
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
28
|
name: rake
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
|
-
- -
|
|
31
|
+
- - ">="
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
37
33
|
version: '0'
|
|
38
34
|
type: :development
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
|
-
- -
|
|
38
|
+
- - ">="
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
45
40
|
version: '0'
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
42
|
name: rdoc
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
|
-
- -
|
|
45
|
+
- - ">="
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
53
47
|
version: '0'
|
|
54
48
|
type: :development
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
|
-
- -
|
|
52
|
+
- - ">="
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
61
54
|
version: '0'
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
|
63
56
|
name: minitest
|
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
|
65
|
-
none: false
|
|
66
58
|
requirements:
|
|
67
59
|
- - '='
|
|
68
60
|
- !ruby/object:Gem::Version
|
|
@@ -70,7 +62,6 @@ dependencies:
|
|
|
70
62
|
type: :development
|
|
71
63
|
prerelease: false
|
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
65
|
requirements:
|
|
75
66
|
- - '='
|
|
76
67
|
- !ruby/object:Gem::Version
|
|
@@ -78,63 +69,58 @@ dependencies:
|
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
|
79
70
|
name: minitest_should
|
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
|
81
|
-
none: false
|
|
82
72
|
requirements:
|
|
83
|
-
- -
|
|
73
|
+
- - ">="
|
|
84
74
|
- !ruby/object:Gem::Version
|
|
85
75
|
version: '0'
|
|
86
76
|
type: :development
|
|
87
77
|
prerelease: false
|
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
-
none: false
|
|
90
79
|
requirements:
|
|
91
|
-
- -
|
|
80
|
+
- - ">="
|
|
92
81
|
- !ruby/object:Gem::Version
|
|
93
82
|
version: '0'
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
|
95
84
|
name: turn
|
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
|
97
|
-
none: false
|
|
98
86
|
requirements:
|
|
99
|
-
- -
|
|
87
|
+
- - ">="
|
|
100
88
|
- !ruby/object:Gem::Version
|
|
101
89
|
version: '0'
|
|
102
90
|
type: :development
|
|
103
91
|
prerelease: false
|
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
-
none: false
|
|
106
93
|
requirements:
|
|
107
|
-
- -
|
|
94
|
+
- - ">="
|
|
108
95
|
- !ruby/object:Gem::Version
|
|
109
96
|
version: '0'
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
|
111
98
|
name: simplecov
|
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
|
113
|
-
none: false
|
|
114
100
|
requirements:
|
|
115
|
-
- -
|
|
101
|
+
- - ">="
|
|
116
102
|
- !ruby/object:Gem::Version
|
|
117
103
|
version: '0'
|
|
118
104
|
type: :development
|
|
119
105
|
prerelease: false
|
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
none: false
|
|
122
107
|
requirements:
|
|
123
|
-
- -
|
|
108
|
+
- - ">="
|
|
124
109
|
- !ruby/object:Gem::Version
|
|
125
110
|
version: '0'
|
|
126
111
|
description: lets the User model in most authentication frameworks know who is the
|
|
127
112
|
current user
|
|
128
113
|
email:
|
|
129
|
-
- dbock@
|
|
114
|
+
- dbock@javaguy.org
|
|
130
115
|
executables: []
|
|
131
116
|
extensions: []
|
|
132
117
|
extra_rdoc_files: []
|
|
133
118
|
files:
|
|
134
|
-
- .document
|
|
135
|
-
- .gitignore
|
|
136
|
-
- .rbenv-version
|
|
137
|
-
- .travis.yml
|
|
119
|
+
- ".document"
|
|
120
|
+
- ".gitignore"
|
|
121
|
+
- ".rbenv-version"
|
|
122
|
+
- ".travis.yml"
|
|
123
|
+
- CODE_OF_CONDUCT.md
|
|
138
124
|
- Gemfile
|
|
139
125
|
- Gemfile.lock
|
|
140
126
|
- LICENSE
|
|
@@ -147,33 +133,26 @@ files:
|
|
|
147
133
|
- test/test_sentient_user.rb
|
|
148
134
|
homepage: http://github.com/bokmann/sentient_user
|
|
149
135
|
licenses: []
|
|
136
|
+
metadata: {}
|
|
150
137
|
post_install_message:
|
|
151
138
|
rdoc_options: []
|
|
152
139
|
require_paths:
|
|
153
140
|
- lib
|
|
154
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
|
-
none: false
|
|
156
142
|
requirements:
|
|
157
|
-
- -
|
|
143
|
+
- - ">="
|
|
158
144
|
- !ruby/object:Gem::Version
|
|
159
145
|
version: '0'
|
|
160
|
-
segments:
|
|
161
|
-
- 0
|
|
162
|
-
hash: 1916054897882198548
|
|
163
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
|
-
none: false
|
|
165
147
|
requirements:
|
|
166
|
-
- -
|
|
148
|
+
- - ">="
|
|
167
149
|
- !ruby/object:Gem::Version
|
|
168
150
|
version: '0'
|
|
169
|
-
segments:
|
|
170
|
-
- 0
|
|
171
|
-
hash: 1916054897882198548
|
|
172
151
|
requirements: []
|
|
173
152
|
rubyforge_project:
|
|
174
|
-
rubygems_version:
|
|
153
|
+
rubygems_version: 2.5.1
|
|
175
154
|
signing_key:
|
|
176
|
-
specification_version:
|
|
155
|
+
specification_version: 4
|
|
177
156
|
summary: A trivial bit of common code
|
|
178
157
|
test_files:
|
|
179
158
|
- test/helper.rb
|