simple_login 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@ module SimpleLogin
|
|
3
3
|
class SimpleLoginGenerator < Rails::Generators::Base
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
5
5
|
|
6
|
+
|
6
7
|
def generate_user
|
7
8
|
# Copy the controllers for user, sessions and password_reset
|
8
9
|
directory "controllers", "app/controllers/"
|
@@ -25,26 +26,21 @@ module SimpleLogin
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def insert_routes
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
f = "resources :password_resets\n"
|
35
|
-
a+b+c+d+e+f
|
36
|
-
end
|
29
|
+
route("match 'signup', to: 'users#new', as: 'signup'")
|
30
|
+
route("match 'login', to: 'sessions#new', as: 'login'")
|
31
|
+
route("match 'logout', to: 'sessions#destroy', as: 'logout'")
|
32
|
+
route("resources :users")
|
33
|
+
route("resources :sessions")
|
34
|
+
route("resources :password_resets")
|
37
35
|
end
|
38
36
|
|
39
|
-
def
|
40
|
-
|
41
|
-
|
42
|
-
a
|
43
|
-
end
|
37
|
+
def create_user
|
38
|
+
generate("model", "users email:string password_digest:string auth_token:string password_reset_token:string password_reset_sent_at:datetime")
|
39
|
+
rake("db:migrate")
|
44
40
|
end
|
45
41
|
|
46
|
-
def
|
47
|
-
|
42
|
+
def add_gems
|
43
|
+
gem("bcrypt-ruby")
|
48
44
|
end
|
49
45
|
|
50
46
|
|
data/lib/simple_login/version.rb
CHANGED