martinet 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7914315d279e69dcd5889732360ebecadc51a36
4
- data.tar.gz: f22d5419bca4025fb15e1111c634dfa7291c40a1
3
+ metadata.gz: 72a97714f50f5b834978ba9287641427f33f9df6
4
+ data.tar.gz: 451b38c810c615d1c92b8e7aec546c64a710b799
5
5
  SHA512:
6
- metadata.gz: 537f987a9ad2089ffbdc68f518ce859545707f8f5cf16c39cf39ce797f2f2240f01d3f2d4dc99c0d2c554c0a9ff7695463fad80385ed26da4dac66c4e1c6c34a
7
- data.tar.gz: 6df66ab1eaf9cd76a3946397a1426e639d9595899f1d38d24868af3e7cae24674d64e267dcb1ffa7699e14b5f468879ec2f4bae5944c76964e32e9789d5214e8
6
+ metadata.gz: c42105d13b539ef194d31d41e6a43c86ee0d1b23c6aa2162599081644c70484e486ac0587bad212222111afc626f68fca07cc7fa58b3c675ff596d14c91ad5dd
7
+ data.tar.gz: 5f55f44421caf79ed0172b00b3cb8efd6306209a3dba80606d9932a4249ceebb99804040ff8adc09cd76360d69fd897a3d12578d2573626639c8c8ee85d7d4db
data/.codeclimate.yml CHANGED
@@ -16,7 +16,6 @@ engines:
16
16
 
17
17
  ratings:
18
18
  paths:
19
- - lib/**/*
20
19
  - "**.rb"
21
20
  - "**.md"
22
21
 
data/.rubocop.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.1
2
3
  Exclude:
3
4
  - "vendor/**/*"
4
5
  - "db/schema.rb"
data/.travis.yml CHANGED
@@ -12,7 +12,6 @@ before_install:
12
12
  - gem cleanup bundler
13
13
 
14
14
  gemfile:
15
- - gemfiles/activerecord_4_0.gemfile
16
15
  - gemfiles/activerecord_4_1.gemfile
17
16
  - gemfiles/activerecord_4_2.gemfile
18
17
  - gemfiles/activerecord_5_0.gemfile
data/Appraisals CHANGED
@@ -1,13 +1,9 @@
1
- appraise 'activerecord-4-0' do
2
- gem 'activerecord', '~> 4.0', '>= 4.0.13'
3
- end
4
-
5
1
  appraise 'activerecord-4-1' do
6
- gem 'activerecord', '~> 4.1', '>= 4.1.15'
2
+ gem 'activerecord', '~> 4.1.0', '>= 4.1.15'
7
3
  end
8
4
 
9
5
  appraise 'activerecord-4-2' do
10
- gem 'activerecord', '~> 4.2', '>= 4.2.6'
6
+ gem 'activerecord', '~> 4.2.0', '>= 4.2.6'
11
7
  end
12
8
 
13
9
  appraise 'activerecord-5-0' do
data/README.md CHANGED
@@ -12,22 +12,11 @@
12
12
 
13
13
 
14
14
 
15
-
16
- TODO: Add badges because they're cool
17
-
18
- TODO: Add martinet class
19
-
20
- TODO: Add tests
21
-
22
- TODO: Test CI servers
23
-
24
- TODO: Publish 0.1.0
25
-
26
15
  TODO: Add impersonate functions
27
16
 
28
17
  TODO: Add tests
29
18
 
30
- TODO: Publish 0.2.0
19
+ TODO: Publish 0.3.0
31
20
 
32
21
  TODO: Write usage instructions
33
22
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activerecord", "~> 4.1", ">= 4.1.15"
5
+ gem "activerecord", "~> 4.1.0", ">= 4.1.15"
6
6
 
7
7
  gemspec :path => "../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activerecord", "~> 4.2", ">= 4.2.6"
5
+ gem "activerecord", "~> 4.2.0", ">= 4.2.6"
6
6
 
7
7
  gemspec :path => "../"
@@ -5,20 +5,24 @@ module Martinet
5
5
  @warden = warden
6
6
  end
7
7
 
8
- def current_user
9
- @warden.user
8
+ def current_user(scope: nil)
9
+ @warden.user(scope)
10
10
  end
11
11
 
12
- def signed_in?
13
- @warden.user
12
+ def signed_in?(scope: nil)
13
+ @warden.user(scope)
14
14
  end
15
15
 
16
- def sign_in!(user)
17
- @warden.set_user(user)
16
+ def sign_in!(user, *args)
17
+ @warden.set_user(user, *args)
18
18
  end
19
19
 
20
- def sign_out!
21
- @warden.logout
20
+ def sign_out!(scope: nil)
21
+ if scope
22
+ @warden.logout(scope)
23
+ else
24
+ @warden.logout
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -1,3 +1,3 @@
1
1
  module Martinet
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
data/martinet.gemspec CHANGED
@@ -23,11 +23,11 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency 'warden', '~> 1.2', '>= 1.2.6'
25
25
 
26
- spec.add_development_dependency 'bundler'
27
- spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'bundler', '~> 1.11', '>= 1.11.2'
27
+ spec.add_development_dependency 'rake', '~> 11.1', '>= 11.1.2'
28
28
  spec.add_development_dependency 'appraisal', '~> 2.1.0'
29
- spec.add_development_dependency 'minitest', '~> 5.0'
30
- spec.add_development_dependency 'codeclimate-test-reporter'
31
- spec.add_development_dependency 'activerecord'
32
- spec.add_development_dependency 'sqlite3'
29
+ spec.add_development_dependency 'minitest', '~> 5.8', '>= 5.8.4'
30
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.5.0'
31
+ spec.add_development_dependency 'activerecord', '>= 4.0.13'
32
+ spec.add_development_dependency 'sqlite3', '~> 1.3', '>= 1.3.11'
33
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: martinet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tang Rufus
@@ -34,30 +34,42 @@ dependencies:
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.11'
37
40
  - - ">="
38
41
  - !ruby/object:Gem::Version
39
- version: '0'
42
+ version: 1.11.2
40
43
  type: :development
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.11'
44
50
  - - ">="
45
51
  - !ruby/object:Gem::Version
46
- version: '0'
52
+ version: 1.11.2
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: rake
49
55
  requirement: !ruby/object:Gem::Requirement
50
56
  requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '11.1'
51
60
  - - ">="
52
61
  - !ruby/object:Gem::Version
53
- version: '0'
62
+ version: 11.1.2
54
63
  type: :development
55
64
  prerelease: false
56
65
  version_requirements: !ruby/object:Gem::Requirement
57
66
  requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '11.1'
58
70
  - - ">="
59
71
  - !ruby/object:Gem::Version
60
- version: '0'
72
+ version: 11.1.2
61
73
  - !ruby/object:Gem::Dependency
62
74
  name: appraisal
63
75
  requirement: !ruby/object:Gem::Requirement
@@ -78,56 +90,68 @@ dependencies:
78
90
  requirements:
79
91
  - - "~>"
80
92
  - !ruby/object:Gem::Version
81
- version: '5.0'
93
+ version: '5.8'
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 5.8.4
82
97
  type: :development
83
98
  prerelease: false
84
99
  version_requirements: !ruby/object:Gem::Requirement
85
100
  requirements:
86
101
  - - "~>"
87
102
  - !ruby/object:Gem::Version
88
- version: '5.0'
103
+ version: '5.8'
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 5.8.4
89
107
  - !ruby/object:Gem::Dependency
90
108
  name: codeclimate-test-reporter
91
109
  requirement: !ruby/object:Gem::Requirement
92
110
  requirements:
93
- - - ">="
111
+ - - "~>"
94
112
  - !ruby/object:Gem::Version
95
- version: '0'
113
+ version: 0.5.0
96
114
  type: :development
97
115
  prerelease: false
98
116
  version_requirements: !ruby/object:Gem::Requirement
99
117
  requirements:
100
- - - ">="
118
+ - - "~>"
101
119
  - !ruby/object:Gem::Version
102
- version: '0'
120
+ version: 0.5.0
103
121
  - !ruby/object:Gem::Dependency
104
122
  name: activerecord
105
123
  requirement: !ruby/object:Gem::Requirement
106
124
  requirements:
107
125
  - - ">="
108
126
  - !ruby/object:Gem::Version
109
- version: '0'
127
+ version: 4.0.13
110
128
  type: :development
111
129
  prerelease: false
112
130
  version_requirements: !ruby/object:Gem::Requirement
113
131
  requirements:
114
132
  - - ">="
115
133
  - !ruby/object:Gem::Version
116
- version: '0'
134
+ version: 4.0.13
117
135
  - !ruby/object:Gem::Dependency
118
136
  name: sqlite3
119
137
  requirement: !ruby/object:Gem::Requirement
120
138
  requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '1.3'
121
142
  - - ">="
122
143
  - !ruby/object:Gem::Version
123
- version: '0'
144
+ version: 1.3.11
124
145
  type: :development
125
146
  prerelease: false
126
147
  version_requirements: !ruby/object:Gem::Requirement
127
148
  requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '1.3'
128
152
  - - ">="
129
153
  - !ruby/object:Gem::Version
130
- version: '0'
154
+ version: 1.3.11
131
155
  description: Authorization component for warden and omniauth. Devise-less
132
156
  email:
133
157
  - tangrufus@gmail.com
@@ -146,14 +170,9 @@ files:
146
170
  - LICENSE.txt
147
171
  - README.md
148
172
  - Rakefile
149
- - gemfiles/activerecord_4_0.gemfile
150
- - gemfiles/activerecord_4_0.gemfile.lock
151
173
  - gemfiles/activerecord_4_1.gemfile
152
- - gemfiles/activerecord_4_1.gemfile.lock
153
174
  - gemfiles/activerecord_4_2.gemfile
154
- - gemfiles/activerecord_4_2.gemfile.lock
155
175
  - gemfiles/activerecord_5_0.gemfile
156
- - gemfiles/activerecord_5_0.gemfile.lock
157
176
  - gemfiles/activerecord_head.gemfile
158
177
  - lib/martinet.rb
159
178
  - lib/martinet/active_record_serializer.rb
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 4.0", ">= 4.0.13"
6
-
7
- gemspec :path => "../"
@@ -1,64 +0,0 @@
1
- PATH
2
- remote: ../
3
- specs:
4
- martinet (0.0.2)
5
- warden (~> 1.2, >= 1.2.6)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activemodel (4.2.6)
11
- activesupport (= 4.2.6)
12
- builder (~> 3.1)
13
- activerecord (4.2.6)
14
- activemodel (= 4.2.6)
15
- activesupport (= 4.2.6)
16
- arel (~> 6.0)
17
- activesupport (4.2.6)
18
- i18n (~> 0.7)
19
- json (~> 1.7, >= 1.7.7)
20
- minitest (~> 5.1)
21
- thread_safe (~> 0.3, >= 0.3.4)
22
- tzinfo (~> 1.1)
23
- appraisal (2.1.0)
24
- bundler
25
- rake
26
- thor (>= 0.14.0)
27
- arel (6.0.3)
28
- builder (3.2.2)
29
- codeclimate-test-reporter (0.5.0)
30
- simplecov (>= 0.7.1, < 1.0.0)
31
- docile (1.1.5)
32
- i18n (0.7.0)
33
- json (1.8.3)
34
- minitest (5.8.4)
35
- rack (1.6.4)
36
- rake (11.1.2)
37
- simplecov (0.11.2)
38
- docile (~> 1.1.0)
39
- json (~> 1.8)
40
- simplecov-html (~> 0.10.0)
41
- simplecov-html (0.10.0)
42
- sqlite3 (1.3.11)
43
- thor (0.19.1)
44
- thread_safe (0.3.5)
45
- tzinfo (1.2.2)
46
- thread_safe (~> 0.1)
47
- warden (1.2.6)
48
- rack (>= 1.0)
49
-
50
- PLATFORMS
51
- ruby
52
-
53
- DEPENDENCIES
54
- activerecord (~> 4.0, >= 4.0.13)
55
- appraisal (~> 2.1.0)
56
- bundler
57
- codeclimate-test-reporter
58
- martinet!
59
- minitest (~> 5.0)
60
- rake
61
- sqlite3
62
-
63
- BUNDLED WITH
64
- 1.11.2
@@ -1,64 +0,0 @@
1
- PATH
2
- remote: ../
3
- specs:
4
- martinet (0.0.2)
5
- warden (~> 1.2, >= 1.2.6)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activemodel (4.2.6)
11
- activesupport (= 4.2.6)
12
- builder (~> 3.1)
13
- activerecord (4.2.6)
14
- activemodel (= 4.2.6)
15
- activesupport (= 4.2.6)
16
- arel (~> 6.0)
17
- activesupport (4.2.6)
18
- i18n (~> 0.7)
19
- json (~> 1.7, >= 1.7.7)
20
- minitest (~> 5.1)
21
- thread_safe (~> 0.3, >= 0.3.4)
22
- tzinfo (~> 1.1)
23
- appraisal (2.1.0)
24
- bundler
25
- rake
26
- thor (>= 0.14.0)
27
- arel (6.0.3)
28
- builder (3.2.2)
29
- codeclimate-test-reporter (0.5.0)
30
- simplecov (>= 0.7.1, < 1.0.0)
31
- docile (1.1.5)
32
- i18n (0.7.0)
33
- json (1.8.3)
34
- minitest (5.8.4)
35
- rack (1.6.4)
36
- rake (11.1.2)
37
- simplecov (0.11.2)
38
- docile (~> 1.1.0)
39
- json (~> 1.8)
40
- simplecov-html (~> 0.10.0)
41
- simplecov-html (0.10.0)
42
- sqlite3 (1.3.11)
43
- thor (0.19.1)
44
- thread_safe (0.3.5)
45
- tzinfo (1.2.2)
46
- thread_safe (~> 0.1)
47
- warden (1.2.6)
48
- rack (>= 1.0)
49
-
50
- PLATFORMS
51
- ruby
52
-
53
- DEPENDENCIES
54
- activerecord (~> 4.1, >= 4.1.15)
55
- appraisal (~> 2.1.0)
56
- bundler
57
- codeclimate-test-reporter
58
- martinet!
59
- minitest (~> 5.0)
60
- rake
61
- sqlite3
62
-
63
- BUNDLED WITH
64
- 1.11.2
@@ -1,64 +0,0 @@
1
- PATH
2
- remote: ../
3
- specs:
4
- martinet (0.0.2)
5
- warden (~> 1.2, >= 1.2.6)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activemodel (4.2.6)
11
- activesupport (= 4.2.6)
12
- builder (~> 3.1)
13
- activerecord (4.2.6)
14
- activemodel (= 4.2.6)
15
- activesupport (= 4.2.6)
16
- arel (~> 6.0)
17
- activesupport (4.2.6)
18
- i18n (~> 0.7)
19
- json (~> 1.7, >= 1.7.7)
20
- minitest (~> 5.1)
21
- thread_safe (~> 0.3, >= 0.3.4)
22
- tzinfo (~> 1.1)
23
- appraisal (2.1.0)
24
- bundler
25
- rake
26
- thor (>= 0.14.0)
27
- arel (6.0.3)
28
- builder (3.2.2)
29
- codeclimate-test-reporter (0.5.0)
30
- simplecov (>= 0.7.1, < 1.0.0)
31
- docile (1.1.5)
32
- i18n (0.7.0)
33
- json (1.8.3)
34
- minitest (5.8.4)
35
- rack (1.6.4)
36
- rake (11.1.2)
37
- simplecov (0.11.2)
38
- docile (~> 1.1.0)
39
- json (~> 1.8)
40
- simplecov-html (~> 0.10.0)
41
- simplecov-html (0.10.0)
42
- sqlite3 (1.3.11)
43
- thor (0.19.1)
44
- thread_safe (0.3.5)
45
- tzinfo (1.2.2)
46
- thread_safe (~> 0.1)
47
- warden (1.2.6)
48
- rack (>= 1.0)
49
-
50
- PLATFORMS
51
- ruby
52
-
53
- DEPENDENCIES
54
- activerecord (~> 4.2, >= 4.2.6)
55
- appraisal (~> 2.1.0)
56
- bundler
57
- codeclimate-test-reporter
58
- martinet!
59
- minitest (~> 5.0)
60
- rake
61
- sqlite3
62
-
63
- BUNDLED WITH
64
- 1.11.2
@@ -1,62 +0,0 @@
1
- PATH
2
- remote: ../
3
- specs:
4
- martinet (0.0.2)
5
- warden (~> 1.2, >= 1.2.6)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activemodel (5.0.0.beta3)
11
- activesupport (= 5.0.0.beta3)
12
- activerecord (5.0.0.beta3)
13
- activemodel (= 5.0.0.beta3)
14
- activesupport (= 5.0.0.beta3)
15
- arel (~> 7.0)
16
- activesupport (5.0.0.beta3)
17
- concurrent-ruby (~> 1.0)
18
- i18n (~> 0.7)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- appraisal (2.1.0)
22
- bundler
23
- rake
24
- thor (>= 0.14.0)
25
- arel (7.0.0)
26
- codeclimate-test-reporter (0.5.0)
27
- simplecov (>= 0.7.1, < 1.0.0)
28
- concurrent-ruby (1.0.1)
29
- docile (1.1.5)
30
- i18n (0.7.0)
31
- json (1.8.3)
32
- minitest (5.8.4)
33
- rack (1.6.4)
34
- rake (11.1.2)
35
- simplecov (0.11.2)
36
- docile (~> 1.1.0)
37
- json (~> 1.8)
38
- simplecov-html (~> 0.10.0)
39
- simplecov-html (0.10.0)
40
- sqlite3 (1.3.11)
41
- thor (0.19.1)
42
- thread_safe (0.3.5)
43
- tzinfo (1.2.2)
44
- thread_safe (~> 0.1)
45
- warden (1.2.6)
46
- rack (>= 1.0)
47
-
48
- PLATFORMS
49
- ruby
50
-
51
- DEPENDENCIES
52
- activerecord (>= 5.0.0.beta3, < 5.1)
53
- appraisal (~> 2.1.0)
54
- bundler
55
- codeclimate-test-reporter
56
- martinet!
57
- minitest (~> 5.0)
58
- rake
59
- sqlite3
60
-
61
- BUNDLED WITH
62
- 1.11.2