devise_masquerade 0.6.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -2
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +2 -4
  5. data/Gemfile +12 -8
  6. data/Gemfile.lock +294 -0
  7. data/Makefile +6 -1
  8. data/README.md +12 -0
  9. data/app/controllers/devise/masquerades_controller.rb +26 -43
  10. data/devise_masquerade.gemspec +5 -4
  11. data/features/support/env.rb +23 -4
  12. data/lib/devise_masquerade.rb +6 -12
  13. data/lib/devise_masquerade/controllers/helpers.rb +0 -2
  14. data/lib/devise_masquerade/controllers/url_helpers.rb +2 -0
  15. data/lib/devise_masquerade/models.rb +9 -0
  16. data/lib/devise_masquerade/{model.rb → models/masqueradable.rb} +10 -14
  17. data/lib/devise_masquerade/rails.rb +16 -4
  18. data/lib/devise_masquerade/routes.rb +10 -8
  19. data/lib/devise_masquerade/version.rb +1 -1
  20. data/spec/controllers/admin/dashboard_controller_spec.rb +1 -1
  21. data/spec/controllers/dashboard_controller_spec.rb +1 -1
  22. data/spec/controllers/devise/masquerades_controller_spec.rb +11 -8
  23. data/spec/controllers/masquerades_controller_spec.rb +2 -2
  24. data/spec/dummy/app/controllers/admin/dashboard_controller.rb +2 -2
  25. data/spec/dummy/app/controllers/dashboard_controller.rb +2 -2
  26. data/spec/dummy/app/models/admin/user.rb +0 -7
  27. data/spec/dummy/app/models/user.rb +1 -10
  28. data/spec/dummy/config/application.rb +2 -0
  29. data/spec/dummy/config/environment.rb +1 -0
  30. data/spec/dummy/db/.gitignore +1 -0
  31. data/spec/dummy/db/migrate/20121119085620_devise_create_users.rb +1 -1
  32. data/spec/dummy/db/migrate/20140418160449_create_admin_users.rb +1 -1
  33. data/spec/dummy/db/schema.rb +29 -32
  34. data/spec/orm/active_record.rb +5 -2
  35. data/spec/spec_helper.rb +3 -3
  36. data/spec/support/factories.rb +5 -5
  37. metadata +29 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 205c70db504c2947a36a81c7296d6482b195a2cf
4
- data.tar.gz: 50dc3a8fc22efd8f4375a5368039da3533fdd865
2
+ SHA256:
3
+ metadata.gz: 53c11df20b59df74e7a1c60c2c895c4174583cfa8211a5922d2eafe4c5b92855
4
+ data.tar.gz: 8e39886ffd23cf8dcbe841da11802ffd3db437ba94ed8a38962a82cd29a8e475
5
5
  SHA512:
6
- metadata.gz: 28b8161d8e6c3cf80d0dee9834abe5fc5cafa28b2361d5c331684a209bd68bee3eab26b94ee50cb30d80b6b44927110da396d6852f2aef655fabb451a02c8bf6
7
- data.tar.gz: 03c22856e74195605aac5d585be63fa1dbf0cca6ff0fd200ea3f0fe1b9e4ad70b33b4bfd2581809c5966c43f26f7ab85987b4fceab0bc192258e28562578c65e
6
+ metadata.gz: '0528ff0b74a4008536b5cbaa404d16483bc3a6fe399f00899d3297d2a8dac95bedb945c5b65c920b47c3721799e02d82644cca2152145db19b7026e3a1674e32'
7
+ data.tar.gz: 47123c4f6eccfc61ff5171ece7db757cd05bf7fa87f32731d4b4bfe13d1cfe542d3f8a28c251bcd6bb4a6e4de95a7d070b3fb7fee4d2aebdbbd0dfd646d9f039
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -19,4 +18,4 @@ spec/dummy/db/*.sqlite3
19
18
  tmp
20
19
  tags
21
20
  .vimrc
22
-
21
+ vendor/
@@ -1 +1 @@
1
- 2.3.3
1
+ 2.6.0
@@ -1,12 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.5
4
- - 2.3.1
5
- - 2.3.3
3
+ - 2.5.1
4
+ - 2.6.0
6
5
  gemfile:
7
6
  - Gemfile
8
7
  script: time ./script/travis.sh
9
- cache: bundler
10
8
  sudo: false
11
9
  addons:
12
10
  apt:
data/Gemfile CHANGED
@@ -4,10 +4,10 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- gem 'activerecord', '~> 3.0'
8
- gem 'actionmailer', '~> 3.0'
9
- gem "bson_ext", "~> 1.3"
10
- gem 'sqlite3'
7
+ gem 'activerecord', '>= 5.2'
8
+ gem 'actionmailer', '>= 5.2'
9
+ gem 'bson_ext', '~> 1.3'
10
+ gem 'sqlite3', '~> 1.4'
11
11
 
12
12
  gem 'test-unit'
13
13
 
@@ -19,17 +19,21 @@ group :test do
19
19
  gem 'guard-bundler'
20
20
  gem 'guard-cucumber'
21
21
 
22
- gem 'rspec-rails'
23
22
  gem 'rspec'
24
- gem 'rspec-mocks'
23
+ gem 'rspec-core', github: 'rspec/rspec-core'
24
+ gem 'rspec-expectations', github: 'rspec/rspec-expectations'
25
+ gem 'rspec-mocks', github: 'rspec/rspec-mocks'
26
+ gem 'rspec-rails', github: 'rspec/rspec-rails'
27
+ gem 'rspec-support', github: 'rspec/rspec-support'
25
28
 
26
29
  gem 'shoulda'
27
30
  gem 'rb-fsevent'
28
- gem 'factory_girl_rails'
31
+ gem 'factory_bot_rails'
29
32
  gem 'database_cleaner', '< 1.1.0'
30
33
  gem 'cucumber'
31
34
  gem 'cucumber-rails'
32
35
  gem 'capybara'
33
- gem 'capybara-webkit'
36
+ gem 'selenium-webdriver'
37
+ gem 'chromedriver-helper'
34
38
  gem 'launchy'
35
39
  end
@@ -0,0 +1,294 @@
1
+ GIT
2
+ remote: https://github.com/rspec/rspec-core.git
3
+ revision: b7067c5da4fde57cbbff739b168008482e61db44
4
+ specs:
5
+ rspec-core (3.10.0.pre)
6
+ rspec-support (= 3.10.0.pre)
7
+
8
+ GIT
9
+ remote: https://github.com/rspec/rspec-expectations.git
10
+ revision: 99f9bcaff2a6f3d82f4e350e829eca6ab015694f
11
+ specs:
12
+ rspec-expectations (3.10.0.pre)
13
+ diff-lcs (>= 1.2.0, < 2.0)
14
+ rspec-support (= 3.10.0.pre)
15
+
16
+ GIT
17
+ remote: https://github.com/rspec/rspec-mocks.git
18
+ revision: 5b897e8f74f3059aef43f1ed5f91719f2267a04e
19
+ specs:
20
+ rspec-mocks (3.10.0.pre)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (= 3.10.0.pre)
23
+
24
+ GIT
25
+ remote: https://github.com/rspec/rspec-rails.git
26
+ revision: 9b7ab39c027a8cb25e2ebe9e0e985756025b0549
27
+ specs:
28
+ rspec-rails (4.0.0.pre)
29
+ actionpack (>= 4.2)
30
+ activesupport (>= 4.2)
31
+ railties (>= 4.2)
32
+ rspec-core (= 3.10.0.pre)
33
+ rspec-expectations (= 3.10.0.pre)
34
+ rspec-mocks (= 3.10.0.pre)
35
+ rspec-support (= 3.10.0.pre)
36
+
37
+ GIT
38
+ remote: https://github.com/rspec/rspec-support.git
39
+ revision: 673133cdd13b17077b3d88ece8d7380821f8d7dc
40
+ specs:
41
+ rspec-support (3.10.0.pre)
42
+
43
+ PATH
44
+ remote: .
45
+ specs:
46
+ devise_masquerade (1.0.0)
47
+ devise (>= 4.7.0)
48
+ railties (>= 5.2.0)
49
+ zeitwerk (>= 2.2.0)
50
+
51
+ GEM
52
+ remote: https://rubygems.org/
53
+ specs:
54
+ actionmailer (6.0.0)
55
+ actionpack (= 6.0.0)
56
+ actionview (= 6.0.0)
57
+ activejob (= 6.0.0)
58
+ mail (~> 2.5, >= 2.5.4)
59
+ rails-dom-testing (~> 2.0)
60
+ actionpack (6.0.0)
61
+ actionview (= 6.0.0)
62
+ activesupport (= 6.0.0)
63
+ rack (~> 2.0)
64
+ rack-test (>= 0.6.3)
65
+ rails-dom-testing (~> 2.0)
66
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
67
+ actionview (6.0.0)
68
+ activesupport (= 6.0.0)
69
+ builder (~> 3.1)
70
+ erubi (~> 1.4)
71
+ rails-dom-testing (~> 2.0)
72
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
73
+ activejob (6.0.0)
74
+ activesupport (= 6.0.0)
75
+ globalid (>= 0.3.6)
76
+ activemodel (6.0.0)
77
+ activesupport (= 6.0.0)
78
+ activerecord (6.0.0)
79
+ activemodel (= 6.0.0)
80
+ activesupport (= 6.0.0)
81
+ activesupport (6.0.0)
82
+ concurrent-ruby (~> 1.0, >= 1.0.2)
83
+ i18n (>= 0.7, < 2)
84
+ minitest (~> 5.1)
85
+ tzinfo (~> 1.1)
86
+ zeitwerk (~> 2.1, >= 2.1.8)
87
+ addressable (2.7.0)
88
+ public_suffix (>= 2.0.2, < 5.0)
89
+ archive-zip (0.12.0)
90
+ io-like (~> 0.3.0)
91
+ backports (3.15.0)
92
+ bcrypt (3.1.13)
93
+ bson (1.12.5)
94
+ bson_ext (1.12.5)
95
+ bson (~> 1.12.5)
96
+ builder (3.2.3)
97
+ byebug (11.0.1)
98
+ capybara (3.29.0)
99
+ addressable
100
+ mini_mime (>= 0.1.3)
101
+ nokogiri (~> 1.8)
102
+ rack (>= 1.6.0)
103
+ rack-test (>= 0.6.3)
104
+ regexp_parser (~> 1.5)
105
+ xpath (~> 3.2)
106
+ childprocess (3.0.0)
107
+ chromedriver-helper (2.1.1)
108
+ archive-zip (~> 0.10)
109
+ nokogiri (~> 1.8)
110
+ coderay (1.1.2)
111
+ concurrent-ruby (1.1.5)
112
+ crass (1.0.5)
113
+ cucumber (3.1.2)
114
+ builder (>= 2.1.2)
115
+ cucumber-core (~> 3.2.0)
116
+ cucumber-expressions (~> 6.0.1)
117
+ cucumber-wire (~> 0.0.1)
118
+ diff-lcs (~> 1.3)
119
+ gherkin (~> 5.1.0)
120
+ multi_json (>= 1.7.5, < 2.0)
121
+ multi_test (>= 0.1.2)
122
+ cucumber-core (3.2.1)
123
+ backports (>= 3.8.0)
124
+ cucumber-tag_expressions (~> 1.1.0)
125
+ gherkin (~> 5.0)
126
+ cucumber-expressions (6.0.1)
127
+ cucumber-rails (1.8.0)
128
+ capybara (>= 2.12, < 4)
129
+ cucumber (>= 3.0.2, < 4)
130
+ mime-types (>= 2.0, < 4)
131
+ nokogiri (~> 1.8)
132
+ railties (>= 4.2, < 7)
133
+ cucumber-tag_expressions (1.1.1)
134
+ cucumber-wire (0.0.1)
135
+ database_cleaner (1.0.1)
136
+ devise (4.7.1)
137
+ bcrypt (~> 3.0)
138
+ orm_adapter (~> 0.1)
139
+ railties (>= 4.1.0)
140
+ responders
141
+ warden (~> 1.2.3)
142
+ diff-lcs (1.3)
143
+ erubi (1.9.0)
144
+ factory_bot (5.1.1)
145
+ activesupport (>= 4.2.0)
146
+ factory_bot_rails (5.1.1)
147
+ factory_bot (~> 5.1.0)
148
+ railties (>= 4.2.0)
149
+ ffi (1.11.1)
150
+ formatador (0.2.5)
151
+ gherkin (5.1.0)
152
+ globalid (0.4.2)
153
+ activesupport (>= 4.2.0)
154
+ guard (2.15.1)
155
+ formatador (>= 0.2.4)
156
+ listen (>= 2.7, < 4.0)
157
+ lumberjack (>= 1.0.12, < 2.0)
158
+ nenv (~> 0.1)
159
+ notiffany (~> 0.0)
160
+ pry (>= 0.9.12)
161
+ shellany (~> 0.0)
162
+ thor (>= 0.18.1)
163
+ guard-bundler (2.2.1)
164
+ bundler (>= 1.3.0, < 3)
165
+ guard (~> 2.2)
166
+ guard-compat (~> 1.1)
167
+ guard-compat (1.2.1)
168
+ guard-cucumber (1.5.4)
169
+ cucumber (>= 1.3.0)
170
+ guard-compat (~> 1.0)
171
+ nenv (~> 0.1)
172
+ guard-rspec (1.2.2)
173
+ guard (>= 1.1)
174
+ i18n (1.7.0)
175
+ concurrent-ruby (~> 1.0)
176
+ io-like (0.3.0)
177
+ launchy (2.4.3)
178
+ addressable (~> 2.3)
179
+ listen (3.2.0)
180
+ rb-fsevent (~> 0.10, >= 0.10.3)
181
+ rb-inotify (~> 0.9, >= 0.9.10)
182
+ loofah (2.3.0)
183
+ crass (~> 1.0.2)
184
+ nokogiri (>= 1.5.9)
185
+ lumberjack (1.0.13)
186
+ mail (2.7.1)
187
+ mini_mime (>= 0.1.1)
188
+ method_source (0.9.2)
189
+ mime-types (3.3)
190
+ mime-types-data (~> 3.2015)
191
+ mime-types-data (3.2019.1009)
192
+ mini_mime (1.0.2)
193
+ mini_portile2 (2.4.0)
194
+ minitest (5.12.2)
195
+ multi_json (1.14.1)
196
+ multi_test (0.1.2)
197
+ nenv (0.3.0)
198
+ nokogiri (1.10.4)
199
+ mini_portile2 (~> 2.4.0)
200
+ notiffany (0.1.3)
201
+ nenv (~> 0.1)
202
+ shellany (~> 0.0)
203
+ orm_adapter (0.5.0)
204
+ power_assert (1.1.5)
205
+ pry (0.12.2)
206
+ coderay (~> 1.1.0)
207
+ method_source (~> 0.9.0)
208
+ pry-byebug (3.7.0)
209
+ byebug (~> 11.0)
210
+ pry (~> 0.10)
211
+ public_suffix (4.0.1)
212
+ rack (2.0.7)
213
+ rack-test (1.1.0)
214
+ rack (>= 1.0, < 3)
215
+ rails-dom-testing (2.0.3)
216
+ activesupport (>= 4.2.0)
217
+ nokogiri (>= 1.6)
218
+ rails-html-sanitizer (1.3.0)
219
+ loofah (~> 2.3)
220
+ railties (6.0.0)
221
+ actionpack (= 6.0.0)
222
+ activesupport (= 6.0.0)
223
+ method_source
224
+ rake (>= 0.8.7)
225
+ thor (>= 0.20.3, < 2.0)
226
+ rake (13.0.0)
227
+ rb-fsevent (0.10.3)
228
+ rb-inotify (0.10.0)
229
+ ffi (~> 1.0)
230
+ regexp_parser (1.6.0)
231
+ responders (3.0.0)
232
+ actionpack (>= 5.0)
233
+ railties (>= 5.0)
234
+ rspec (1.3.2)
235
+ rubyzip (2.0.0)
236
+ selenium-webdriver (3.142.6)
237
+ childprocess (>= 0.5, < 4.0)
238
+ rubyzip (>= 1.2.2)
239
+ shellany (0.0.1)
240
+ shoulda (3.6.0)
241
+ shoulda-context (~> 1.0, >= 1.0.1)
242
+ shoulda-matchers (~> 3.0)
243
+ shoulda-context (1.2.2)
244
+ shoulda-matchers (3.1.3)
245
+ activesupport (>= 4.0.0)
246
+ sqlite3 (1.4.1)
247
+ test-unit (3.3.4)
248
+ power_assert
249
+ thor (0.20.3)
250
+ thread_safe (0.3.6)
251
+ tzinfo (1.2.5)
252
+ thread_safe (~> 0.1)
253
+ warden (1.2.8)
254
+ rack (>= 2.0.6)
255
+ xpath (3.2.0)
256
+ nokogiri (~> 1.8)
257
+ zeitwerk (2.2.0)
258
+
259
+ PLATFORMS
260
+ ruby
261
+
262
+ DEPENDENCIES
263
+ actionmailer (>= 5.2)
264
+ activerecord (>= 5.2)
265
+ bson_ext (~> 1.3)
266
+ bundler (>= 2.0.0)
267
+ capybara
268
+ chromedriver-helper
269
+ cucumber
270
+ cucumber-rails
271
+ database_cleaner (< 1.1.0)
272
+ devise_masquerade!
273
+ factory_bot_rails
274
+ guard
275
+ guard-bundler
276
+ guard-cucumber
277
+ guard-rspec
278
+ launchy
279
+ pry
280
+ pry-byebug
281
+ rb-fsevent
282
+ rspec
283
+ rspec-core!
284
+ rspec-expectations!
285
+ rspec-mocks!
286
+ rspec-rails!
287
+ rspec-support!
288
+ selenium-webdriver
289
+ shoulda
290
+ sqlite3 (~> 1.4)
291
+ test-unit
292
+
293
+ BUNDLED WITH
294
+ 2.0.2
data/Makefile CHANGED
@@ -1,6 +1,11 @@
1
+ release:
2
+ bundle exec rake release
3
+ .PHONY: release
4
+
1
5
  setup:
2
6
  cd spec/dummy && \
3
- RAILS_ENV=test rake db:setup
7
+ bundle exec rails db:environment:set RAILS_ENV=test && \
8
+ RAILS_ENV=test bundle exec rails db:setup
4
9
  .PHONY: setup
5
10
 
6
11
  rspec:
data/README.md CHANGED
@@ -109,6 +109,18 @@ In your view:
109
109
  end
110
110
  ```
111
111
 
112
+ ## Custom url redirect after finishing masquerade:
113
+
114
+ ```ruby
115
+ class Admin::MasqueradesController < Devise::MasqueradesController
116
+ protected
117
+
118
+ def after_back_masquerade_path_for(resource)
119
+ "/custom_url"
120
+ end
121
+ end
122
+ ```
123
+
112
124
  ## Overriding the finder
113
125
 
114
126
  For example, if you use FriendlyId:
@@ -1,68 +1,43 @@
1
1
  class Devise::MasqueradesController < DeviseController
2
- if respond_to?(:prepend_before_action)
3
- prepend_before_action :authenticate_scope!, :masquerade_authorize!
4
- else
5
- prepend_before_filter :authenticate_scope!, :masquerade_authorize!
6
- end
2
+ prepend_before_action :authenticate_scope!, :masquerade_authorize!
7
3
 
8
- if respond_to?(:before_action)
9
- before_action :save_masquerade_owner_session, :only => :show
10
- else
11
- before_filter :save_masquerade_owner_session, :only => :show
12
- end
4
+ before_action :save_masquerade_owner_session, only: :show
13
5
 
14
- if respond_to?(:after_action)
15
- after_action :cleanup_masquerade_owner_session, :only => :back
16
- else
17
- after_filter :cleanup_masquerade_owner_session, :only => :back
18
- end
6
+ after_action :cleanup_masquerade_owner_session, only: :back
19
7
 
20
8
  def show
21
9
  self.resource = find_resource
22
10
 
23
- unless self.resource
11
+ unless resource
24
12
  flash[:error] = "#{masqueraded_resource_class} not found."
25
13
  redirect_to(new_user_session_path) and return
26
14
  end
27
15
 
28
- self.resource.masquerade!
16
+ resource.masquerade!
29
17
  request.env["devise.skip_trackable"] = "1"
30
18
 
31
- masquerade_sign_in(self.resource)
19
+ masquerade_sign_in(resource)
32
20
 
33
- if Devise.masquerade_routes_back && Rails::VERSION::MAJOR == 5
34
- redirect_back(fallback_location: after_masquerade_full_path_for(resource))
35
- elsif Devise.masquerade_routes_back && request.env['HTTP_REFERER'].present?
36
- redirect_to :back
37
- else
38
- redirect_to(after_masquerade_full_path_for(resource))
39
- end
21
+ go_back(resource, path: after_masquerade_full_path_for(resource))
40
22
  end
41
23
 
42
24
  def back
43
25
  user_id = session[session_key]
44
26
 
45
- owner_user = if user_id.present?
46
- masquerading_resource_class.to_adapter.find_first(:id => user_id)
47
- else
48
- send(:"current_#{masquerading_resource_name}")
49
- end
27
+ resource = if user_id.present?
28
+ masquerading_resource_class.to_adapter.find_first(:id => user_id)
29
+ else
30
+ send(:"current_#{masquerading_resource_name}")
31
+ end
50
32
 
51
33
  if masquerading_resource_class != masqueraded_resource_class
52
34
  sign_out(send("current_#{masqueraded_resource_name}"))
53
35
  end
54
36
 
55
- masquerade_sign_in(owner_user)
56
- request.env["devise.skip_trackable"] = nil
37
+ masquerade_sign_in(resource)
38
+ request.env['devise.skip_trackable'] = nil
57
39
 
58
- if Devise.masquerade_routes_back && Rails::VERSION::MAJOR == 5
59
- # If using the masquerade_routes_back and Rails 5
60
- redirect_back(fallback_location: after_back_masquerade_path_for(owner_user))
61
- elsif Devise.masquerade_routes_back && request.env['HTTP_REFERER'].present?
62
- redirect_to :back
63
- else
64
- redirect_to after_back_masquerade_path_for(owner_user)
65
- end
40
+ go_back(resource, path: after_back_masquerade_path_for(resource))
66
41
  end
67
42
 
68
43
  protected
@@ -76,7 +51,15 @@ class Devise::MasqueradesController < DeviseController
76
51
  end
77
52
 
78
53
  def find_resource
79
- masqueraded_resource_class.to_adapter.find_first(:id => params[:id])
54
+ masqueraded_resource_class.to_adapter.find_first(id: params[:id])
55
+ end
56
+
57
+ def go_back(user, path:)
58
+ if Devise.masquerade_routes_back
59
+ redirect_back(fallback_location: path)
60
+ else
61
+ redirect_to path
62
+ end
80
63
  end
81
64
 
82
65
  private
@@ -98,11 +81,11 @@ class Devise::MasqueradesController < DeviseController
98
81
  end
99
82
 
100
83
  def authenticate_scope!
101
- send(:"authenticate_#{masquerading_resource_name}!", :force => true)
84
+ send(:"authenticate_#{masquerading_resource_name}!", force: true)
102
85
  end
103
86
 
104
87
  def after_masquerade_path_for(resource)
105
- "/"
88
+ '/'
106
89
  end
107
90
 
108
91
  def after_masquerade_full_path_for(resource)
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.email = ['alex.korsak@gmail.com']
12
12
  gem.description = 'devise masquerade library'
13
13
  gem.summary = 'use for login as functionallity on your admin users pages'
14
- gem.homepage = 'http://github.com/oivoodoo/devise_masquerade/'
14
+ gem.homepage = 'http://github.com/oivoodoo/devise_masquerade'
15
15
 
16
16
  gem.files = `git ls-files`.split($/)
17
17
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
@@ -20,8 +20,9 @@ Gem::Specification.new do |gem|
20
20
 
21
21
  gem.license = 'MIT'
22
22
 
23
- gem.add_development_dependency('bundler', '>= 1.1.0')
23
+ gem.add_development_dependency('bundler', '>= 2.0.0')
24
24
 
25
- gem.add_runtime_dependency('railties', '>= 3.0')
26
- gem.add_runtime_dependency('devise', '>= 2.1.0')
25
+ gem.add_runtime_dependency('railties', '>= 5.2.0')
26
+ gem.add_runtime_dependency('devise', '>= 4.7.0')
27
+ gem.add_runtime_dependency('zeitwerk', '>= 2.2.0')
27
28
  end
@@ -1,5 +1,5 @@
1
1
  require 'cucumber/rails'
2
- require 'factory_girl'
2
+ require 'factory_bot'
3
3
  require 'database_cleaner'
4
4
  require 'cucumber/rspec/doubles'
5
5
 
@@ -9,9 +9,11 @@ ENV["RAILS_ENV"] = "test"
9
9
 
10
10
  Capybara.default_selector = :css
11
11
 
12
- ActionController::Base.allow_rescue = false
12
+ ActiveSupport.on_load(:action_controller) do
13
+ self.allow_rescue = false
14
+ end
13
15
 
14
- World(FactoryGirl::Syntax::Methods)
16
+ World(FactoryBot::Syntax::Methods)
15
17
 
16
18
  begin
17
19
  DatabaseCleaner.strategy = :transaction
@@ -20,7 +22,24 @@ rescue NameError
20
22
  end
21
23
 
22
24
  Cucumber::Rails::Database.javascript_strategy = :truncation
23
- Capybara.javascript_driver = :webkit
25
+
26
+ Capybara.register_driver :chrome do |app|
27
+ Capybara::Selenium::Driver.new(app, browser: :chrome)
28
+ end
29
+
30
+ Capybara.register_driver :headless_chrome do |app|
31
+ caps = Selenium::WebDriver::Remote::Capabilities.chrome(loggingPrefs: { browser: 'ALL' })
32
+ opts = Selenium::WebDriver::Chrome::Options.new
33
+
34
+ chrome_args = %w[--headless --window-size=1920,1080 --no-sandbox --disable-dev-shm-usage]
35
+ chrome_args.each { |arg| opts.add_argument(arg) }
36
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: opts, desired_capabilities: caps)
37
+ end
38
+
39
+ Capybara.configure do |config|
40
+ # change this to :chrome to observe tests in a real browser
41
+ config.javascript_driver = :headless_chrome
42
+ end
24
43
 
25
44
  Before do
26
45
  allow_any_instance_of(DeviseController).to receive(:devise_mapping) { Devise.mappings[:user] }
@@ -1,16 +1,10 @@
1
- require 'devise'
1
+ require 'zeitwerk'
2
+ loader = Zeitwerk::Loader.for_gem
3
+ loader.setup # ready!
2
4
 
3
- require 'action_controller'
4
- require 'action_controller/base'
5
- require 'devise_masquerade/version'
6
- require 'devise_masquerade/routes'
7
- require 'devise_masquerade/controllers/helpers'
8
- require 'devise_masquerade/controllers/url_helpers'
5
+ require 'devise'
9
6
  require 'devise_masquerade/rails'
10
7
 
11
- module DeviseMasquerade
12
- end
13
-
14
8
  module Devise
15
9
  mattr_accessor :masquerade_param
16
10
  @@masquerade_param = 'masquerade'
@@ -42,5 +36,5 @@ module Devise
42
36
  @@helpers << DeviseMasquerade::Controllers::Helpers
43
37
  end
44
38
 
45
- Devise.add_module :masqueradable, :controller => :masquerades,
46
- :model => 'devise_masquerade/model', :route => :masquerade
39
+ Devise.add_module :masqueradable, controller: :masquerades,
40
+ model: 'devise_masquerade/models', route: :masquerade
@@ -50,5 +50,3 @@ module DeviseMasquerade
50
50
  end
51
51
  end
52
52
  end
53
-
54
- ActionController::Base.send(:include, DeviseMasquerade::Controllers::Helpers)
@@ -1,5 +1,6 @@
1
1
  module DeviseMasquerade
2
2
  module Controllers
3
+
3
4
  module UrlHelpers
4
5
  def masquerade_path(resource, *args)
5
6
  scope = Devise::Mapping.find_scope!(resource)
@@ -11,6 +12,7 @@ module DeviseMasquerade
11
12
  send("back_#{scope}_masquerade_index_path", *args)
12
13
  end
13
14
  end
15
+
14
16
  end
15
17
  end
16
18
 
@@ -0,0 +1,9 @@
1
+ require 'devise_masquerade/models/masqueradable'
2
+
3
+ module DeviseMasquerade
4
+ module Models
5
+
6
+ end
7
+ end
8
+
9
+ Devise::Models.send :include, DeviseMasquerade::Models
@@ -1,20 +1,17 @@
1
- module Devise
1
+ module DeviseMasquerade
2
2
  module Models
3
3
  module Masqueradable
4
- def self.included(base)
5
- base.class_eval do
6
- attr_reader :masquerade_key
4
+ extend ActiveSupport::Concern
7
5
 
8
- include InstanceMethods
9
- extend ClassMethods
10
- end
11
- end
6
+ included do
7
+ attr_reader :masquerade_key
12
8
 
13
- module InstanceMethods
14
9
  def masquerade!
15
- @masquerade_key = SecureRandom.urlsafe_base64(Devise.masquerade_key_size)
10
+ @masquerade_key = SecureRandom.urlsafe_base64(
11
+ Devise.masquerade_key_size)
16
12
  cache_key = self.class.cache_masquerade_key_by(@masquerade_key)
17
- Rails.cache.write(cache_key, id, :expires_in => Devise.masquerade_expires_in)
13
+ ::Rails.cache.write(
14
+ cache_key, id, expires_in: Devise.masquerade_expires_in)
18
15
  end
19
16
  end
20
17
 
@@ -24,11 +21,11 @@ module Devise
24
21
  end
25
22
 
26
23
  def remove_masquerade_key!(key)
27
- Rails.cache.delete(cache_masquerade_key_by(key))
24
+ ::Rails.cache.delete(cache_masquerade_key_by(key))
28
25
  end
29
26
 
30
27
  def find_by_masquerade_key(key)
31
- id = Rails.cache.read(cache_masquerade_key_by(key))
28
+ id = ::Rails.cache.read(cache_masquerade_key_by(key))
32
29
 
33
30
  # clean up the cached masquerade key value
34
31
  remove_masquerade_key!(key)
@@ -39,4 +36,3 @@ module Devise
39
36
  end
40
37
  end
41
38
  end
42
-
@@ -1,7 +1,19 @@
1
+ require 'devise_masquerade/routes'
2
+ require 'devise_masquerade/models'
3
+
1
4
  module DeviseMasquerade
2
- class Engine < ::Rails::Engine
3
- ActiveSupport.on_load(:action_controller) { include DeviseMasquerade::Controllers::UrlHelpers }
4
- ActiveSupport.on_load(:action_view) { include DeviseMasquerade::Controllers::UrlHelpers }
5
+ module Rails
6
+
7
+ class Engine < ::Rails::Engine
8
+ ActiveSupport.on_load(:action_controller) do
9
+ include DeviseMasquerade::Controllers::Helpers
10
+ include DeviseMasquerade::Controllers::UrlHelpers
11
+ end
12
+
13
+ ActiveSupport.on_load(:action_view) do
14
+ include DeviseMasquerade::Controllers::UrlHelpers
15
+ end
16
+ end
17
+
5
18
  end
6
19
  end
7
-
@@ -1,17 +1,19 @@
1
- module ActionDispatch::Routing
2
- class Mapper
3
-
4
- protected
1
+ module DeviseMasquerade
2
+ module Routes
5
3
 
6
4
  def devise_masquerade(mapping, controllers)
7
5
  resources :masquerade,
8
- :only => :show,
9
- :path => mapping.path_names[:masquerade],
10
- :controller => controllers[:masquerades] do
6
+ only: :show,
7
+ path: mapping.path_names[:masquerade],
8
+ controller: controllers[:masquerades] do
11
9
 
12
- get :back, :on => :collection
10
+ collection do
11
+ get :back
12
+ end
13
13
  end
14
14
  end
15
+
15
16
  end
16
17
  end
17
18
 
19
+ ActionDispatch::Routing::Mapper.send :include, DeviseMasquerade::Routes
@@ -1,3 +1,3 @@
1
1
  module DeviseMasquerade
2
- VERSION = '0.6.5'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
@@ -9,7 +9,7 @@ describe Admin::DashboardController, type: :controller do
9
9
 
10
10
  before do
11
11
  user.masquerade!
12
- get :index, :masquerade => user.masquerade_key
12
+ get :index, params: { masquerade: user.masquerade_key }
13
13
  end
14
14
 
15
15
  it { expect(current_admin_user.reload).to eq(user) }
@@ -10,7 +10,7 @@ describe DashboardController, type: :controller do
10
10
  before do
11
11
  user.masquerade!
12
12
 
13
- get :index, :masquerade => user.masquerade_key
13
+ get :index, params: { masquerade: user.masquerade_key }
14
14
  end
15
15
 
16
16
  it { expect(current_user.reload).to eq(user) }
@@ -12,7 +12,7 @@ describe Devise::MasqueradesController, type: :controller do
12
12
 
13
13
  before do
14
14
  expect(SecureRandom).to receive(:urlsafe_base64) { "secure_key" }
15
- get :show, :id => mask.to_param
15
+ get :show, params: { id: mask.to_param }
16
16
  end
17
17
 
18
18
  it { expect(session.keys).to include('devise_masquerade_user') }
@@ -29,26 +29,29 @@ describe Devise::MasqueradesController, type: :controller do
29
29
 
30
30
  # Configure masquerade_routes_back setting
31
31
  describe 'config#masquerade_routes_back' do
32
- before { Devise.setup {|c| c.masquerade_routes_back = true } }
32
+ before { Devise.setup { |c| c.masquerade_routes_back = true } }
33
+
34
+ after { Devise.masquerade_routes_back = false }
33
35
 
34
36
  context 'show' do
35
37
  before { expect(SecureRandom).to receive(:urlsafe_base64) { "secure_key" } }
36
38
 
37
- context '< Rails 5 version' do
39
+ context 'with http referrer' do
38
40
  before do
39
41
  @request.env['HTTP_REFERER'] = 'previous_location'
40
- get :show, id: mask.to_param
42
+ get :show, params: { id: mask.to_param }
41
43
  end # before
42
44
 
43
45
  it { should redirect_to('previous_location') }
44
46
  end # context
45
47
 
46
- context '< Rails 5, fallback if http_referer not present' do
48
+ context 'no http referrer' do
47
49
  before do
48
- allow_any_instance_of(described_class).to receive(:after_masquerade_path_for).and_return("/dashboard?color=red")
50
+ allow_any_instance_of(described_class).to(
51
+ receive(:after_masquerade_path_for).and_return("/dashboard?color=red"))
49
52
  end
50
53
 
51
- before { get :show, id: mask.to_param }
54
+ before { get :show, params: { id: mask.to_param } }
52
55
 
53
56
  it { should redirect_to("/dashboard?color=red&masquerade=secure_key") }
54
57
  end # context
@@ -73,7 +76,7 @@ describe Devise::MasqueradesController, type: :controller do
73
76
  end
74
77
 
75
78
  context 'when not logged in' do
76
- before { get :show, :id => 'any_id' }
79
+ before { get :show, params: { id: 'any_id' } }
77
80
 
78
81
  it { should redirect_to(new_user_session_path) }
79
82
  end
@@ -13,7 +13,7 @@ describe MasqueradesController, type: :controller do
13
13
 
14
14
  let(:mask) { create(:user) }
15
15
 
16
- before { get :show, :id => mask.to_param }
16
+ before { get :show, params: { :id => mask.to_param } }
17
17
 
18
18
  it { expect(response.status).to eq(403) }
19
19
  it { expect(session.keys).not_to include('devise_masquerade_user') }
@@ -32,7 +32,7 @@ describe MasqueradesController, type: :controller do
32
32
 
33
33
  before do
34
34
  expect(SecureRandom).to receive(:urlsafe_base64) { "secure_key" }
35
- get :show, :id => mask.to_param
35
+ get :show, params: { id: mask.to_param }
36
36
  end
37
37
 
38
38
  it { expect(response.status).to eq(302) }
@@ -1,6 +1,6 @@
1
1
  class Admin::DashboardController < ApplicationController
2
- before_filter :authenticate_admin_user!
3
- before_filter :masquerade_admin_user!
2
+ before_action :authenticate_admin_user!
3
+ before_action :masquerade_admin_user!
4
4
 
5
5
  def index
6
6
  @users = Admin::User.where("admin_users.id != ?", current_admin_user.id).all
@@ -1,6 +1,6 @@
1
1
  class DashboardController < ApplicationController
2
- before_filter :authenticate_user!
3
- before_filter :masquerade_user!
2
+ before_action :authenticate_user!
3
+ before_action :masquerade_user!
4
4
 
5
5
  def index
6
6
  @users = User.where("users.id != ?", current_user.id).all
@@ -1,13 +1,6 @@
1
1
  class Admin::User < ActiveRecord::Base
2
- # Include default devise modules. Others available are:
3
- # :token_authenticatable, :confirmable,
4
- # :lockable, :timeoutable and :omniauthable
5
2
  devise :database_authenticatable, :registerable,
6
3
  :recoverable, :rememberable, :trackable, :validatable,
7
4
  :masqueradable
8
-
9
- # Setup accessible (or protected) attributes for your model
10
- attr_accessible :email, :password, :password_confirmation, :remember_me
11
- # attr_accessible :title, :body
12
5
  end
13
6
 
@@ -1,12 +1,3 @@
1
1
  class User < ActiveRecord::Base
2
- # Include default devise modules. Others available are:
3
- # :token_authenticatable, :confirmable,
4
- # :lockable, :timeoutable and :omniauthable
5
- devise :database_authenticatable, :registerable,
6
- :recoverable, :rememberable, :trackable, :validatable,
7
- :masqueradable
8
-
9
- # Setup accessible (or protected) attributes for your model
10
- attr_accessible :email, :password, :password_confirmation, :remember_me
11
- # attr_accessible :title, :body
2
+ devise :database_authenticatable, :validatable, :masqueradable
12
3
  end
@@ -16,6 +16,8 @@ module Dummy
16
16
  config.encoding = "utf-8"
17
17
 
18
18
  config.filter_parameters += [:password]
19
+
20
+ config.eager_load = false
19
21
  end
20
22
  end
21
23
 
@@ -2,4 +2,5 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the rails application
5
+ #
5
6
  Dummy::Application.initialize!
@@ -0,0 +1 @@
1
+ test.sqlite3*
@@ -1,4 +1,4 @@
1
- class DeviseCreateUsers < ActiveRecord::Migration
1
+ class DeviseCreateUsers < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table(:users) do |t|
4
4
  ## Database authenticatable
@@ -1,4 +1,4 @@
1
- class CreateAdminUsers < ActiveRecord::Migration
1
+ class CreateAdminUsers < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table(:admin_users) do |t|
4
4
  ## Database authenticatable
@@ -1,52 +1,49 @@
1
- # encoding: UTF-8
2
1
  # This file is auto-generated from the current state of the database. Instead
3
2
  # of editing this file, please use the migrations feature of Active Record to
4
3
  # incrementally modify your database, and then regenerate this schema definition.
5
4
  #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
5
+ # This file is the source Rails uses to define your schema when running `rails
6
+ # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
11
10
  #
12
- # It's strongly recommended to check this file into your version control system.
11
+ # It's strongly recommended that you check this file into your version control system.
13
12
 
14
- ActiveRecord::Schema.define(:version => 20140418160449) do
13
+ ActiveRecord::Schema.define(version: 2014_04_18_160449) do
15
14
 
16
- create_table "admin_users", :force => true do |t|
17
- t.string "email", :default => "", :null => false
18
- t.string "encrypted_password", :default => "", :null => false
19
- t.string "reset_password_token"
15
+ create_table "admin_users", force: :cascade do |t|
16
+ t.string "email", default: "", null: false
17
+ t.string "encrypted_password", default: "", null: false
18
+ t.string "reset_password_token"
20
19
  t.datetime "reset_password_sent_at"
21
20
  t.datetime "remember_created_at"
22
- t.integer "sign_in_count", :default => 0
21
+ t.integer "sign_in_count", default: 0
23
22
  t.datetime "current_sign_in_at"
24
23
  t.datetime "last_sign_in_at"
25
- t.string "current_sign_in_ip"
26
- t.string "last_sign_in_ip"
27
- t.datetime "created_at", :null => false
28
- t.datetime "updated_at", :null => false
24
+ t.string "current_sign_in_ip"
25
+ t.string "last_sign_in_ip"
26
+ t.datetime "created_at", null: false
27
+ t.datetime "updated_at", null: false
28
+ t.index ["email"], name: "index_admin_users_on_email", unique: true
29
+ t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
29
30
  end
30
31
 
31
- add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true
32
- add_index "admin_users", ["reset_password_token"], :name => "index_admin_users_on_reset_password_token", :unique => true
33
-
34
- create_table "users", :force => true do |t|
35
- t.string "email", :default => "", :null => false
36
- t.string "encrypted_password", :default => "", :null => false
37
- t.string "reset_password_token"
32
+ create_table "users", force: :cascade do |t|
33
+ t.string "email", default: "", null: false
34
+ t.string "encrypted_password", default: "", null: false
35
+ t.string "reset_password_token"
38
36
  t.datetime "reset_password_sent_at"
39
37
  t.datetime "remember_created_at"
40
- t.integer "sign_in_count", :default => 0
38
+ t.integer "sign_in_count", default: 0
41
39
  t.datetime "current_sign_in_at"
42
40
  t.datetime "last_sign_in_at"
43
- t.string "current_sign_in_ip"
44
- t.string "last_sign_in_ip"
45
- t.datetime "created_at", :null => false
46
- t.datetime "updated_at", :null => false
41
+ t.string "current_sign_in_ip"
42
+ t.string "last_sign_in_ip"
43
+ t.datetime "created_at", null: false
44
+ t.datetime "updated_at", null: false
45
+ t.index ["email"], name: "index_users_on_email", unique: true
46
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
47
47
  end
48
48
 
49
- add_index "users", ["email"], :name => "index_users_on_email", :unique => true
50
- add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
51
-
52
49
  end
@@ -1,5 +1,8 @@
1
1
  ActiveRecord::Migration.verbose = false
2
2
  ActiveRecord::Base.logger = Logger.new(nil)
3
3
 
4
- ActiveRecord::Migrator.migrate(File.expand_path("../dummy/db/migrate/", __FILE__))
5
-
4
+ ActiveRecord::MigrationContext.
5
+ new(
6
+ File.expand_path("../../dummy/db/migrate/", __FILE__),
7
+ ActiveRecord::Base.connection.schema_migration
8
+ ).migrate
@@ -6,7 +6,7 @@ require 'devise_masquerade'
6
6
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
7
7
  require 'rails/test_help'
8
8
  require 'rspec/rails'
9
- require 'factory_girl'
9
+ require 'factory_bot'
10
10
  require 'database_cleaner'
11
11
 
12
12
  Rails.backtrace_cleaner.remove_silencers!
@@ -18,9 +18,9 @@ RSpec.configure do |config|
18
18
  require 'rspec/expectations'
19
19
  config.include RSpec::Matchers
20
20
 
21
- config.include Devise::TestHelpers, :type => :controller
21
+ config.include Devise::Test::ControllerHelpers, :type => :controller
22
22
  config.include Warden::Test::Helpers
23
- config.include FactoryGirl::Syntax::Methods
23
+ config.include FactoryBot::Syntax::Methods
24
24
  config.include Authentication
25
25
 
26
26
  config.raise_errors_for_deprecations!
@@ -1,16 +1,16 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  sequence(:email) { |i| "john#{i}@example.com" }
3
3
 
4
4
  factory :user do
5
5
  email
6
- password 'password'
7
- password_confirmation 'password'
6
+ password { 'password' }
7
+ password_confirmation { 'password' }
8
8
  end
9
9
 
10
10
  factory :admin_user, :class => 'Admin::User' do
11
11
  email
12
- password 'password'
13
- password_confirmation 'password'
12
+ password { 'password' }
13
+ password_confirmation { 'password' }
14
14
  end
15
15
  end
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_masquerade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Korsak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-23 00:00:00.000000000 Z
11
+ date: 2019-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,42 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: 2.0.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: railties
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: 5.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: 5.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: devise
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.1.0
47
+ version: 4.7.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 2.1.0
54
+ version: 4.7.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: zeitwerk
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 2.2.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 2.2.0
55
69
  description: devise masquerade library
56
70
  email:
57
71
  - alex.korsak@gmail.com
@@ -65,6 +79,7 @@ files:
65
79
  - ".rvmrc"
66
80
  - ".travis.yml"
67
81
  - Gemfile
82
+ - Gemfile.lock
68
83
  - Guardfile
69
84
  - LICENSE.txt
70
85
  - Makefile
@@ -80,7 +95,8 @@ files:
80
95
  - lib/devise_masquerade.rb
81
96
  - lib/devise_masquerade/controllers/helpers.rb
82
97
  - lib/devise_masquerade/controllers/url_helpers.rb
83
- - lib/devise_masquerade/model.rb
98
+ - lib/devise_masquerade/models.rb
99
+ - lib/devise_masquerade/models/masqueradable.rb
84
100
  - lib/devise_masquerade/rails.rb
85
101
  - lib/devise_masquerade/routes.rb
86
102
  - lib/devise_masquerade/version.rb
@@ -120,6 +136,7 @@ files:
120
136
  - spec/dummy/config/locales/devise.en.yml
121
137
  - spec/dummy/config/locales/en.yml
122
138
  - spec/dummy/config/routes.rb
139
+ - spec/dummy/db/.gitignore
123
140
  - spec/dummy/db/migrate/20121119085620_devise_create_users.rb
124
141
  - spec/dummy/db/migrate/20140418160449_create_admin_users.rb
125
142
  - spec/dummy/db/schema.rb
@@ -131,7 +148,7 @@ files:
131
148
  - spec/spec_helper.rb
132
149
  - spec/support/authentication.rb
133
150
  - spec/support/factories.rb
134
- homepage: http://github.com/oivoodoo/devise_masquerade/
151
+ homepage: http://github.com/oivoodoo/devise_masquerade
135
152
  licenses:
136
153
  - MIT
137
154
  metadata: {}
@@ -150,8 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
167
  - !ruby/object:Gem::Version
151
168
  version: '0'
152
169
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.5.2
170
+ rubygems_version: 3.0.1
155
171
  signing_key:
156
172
  specification_version: 4
157
173
  summary: use for login as functionallity on your admin users pages
@@ -195,6 +211,7 @@ test_files:
195
211
  - spec/dummy/config/locales/devise.en.yml
196
212
  - spec/dummy/config/locales/en.yml
197
213
  - spec/dummy/config/routes.rb
214
+ - spec/dummy/db/.gitignore
198
215
  - spec/dummy/db/migrate/20121119085620_devise_create_users.rb
199
216
  - spec/dummy/db/migrate/20140418160449_create_admin_users.rb
200
217
  - spec/dummy/db/schema.rb