lobby 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/lobby/sessions_controller.rb +5 -5
- data/app/models/lobby/auth_user.rb +18 -0
- data/app/models/lobby/auth_user.rb~ +19 -1
- data/config/locales/de.yml +84 -464
- data/config/locales/de.yml~ +78 -467
- data/config/locales/en.yml +67 -76
- data/config/locales/en.yml~ +88 -97
- data/config/routes.rb +0 -2
- data/config/routes.rb~ +21 -0
- data/lib/generators/lobby/install_generator.rb +86 -0
- data/lib/generators/lobby/install_generator.rb~ +86 -0
- data/lib/generators/lobby/lobby_generator.rb~ +97 -0
- data/lib/generators/templates/config/config.yml +31 -0
- data/lib/generators/templates/config/initializers/action_mailer.rb +75 -0
- data/lib/generators/templates/config/initializers/constants.rb +1 -0
- data/lib/generators/templates/config/locales/de.yml +149 -0
- data/lib/generators/templates/config/locales/en.yml +148 -0
- data/{db/migrate/20131205180849_create_users.rb → lib/generators/templates/db/migrate/create_users.rb} +2 -2
- data/lib/generators/templates/views/common/_form_errors.html.haml +6 -0
- data/lib/generators/templates/views/confirmation/new_email_token.html.haml +10 -0
- data/lib/generators/templates/views/confirmation/registration.html.haml +11 -0
- data/lib/generators/templates/views/confirmation/registration.html.haml~ +15 -0
- data/lib/generators/templates/views/confirmation/resend_signup_token.html.haml +13 -0
- data/lib/generators/templates/views/confirmation/resend_signup_token.html.haml~ +17 -0
- data/lib/generators/templates/views/confirmation_mailer/new_email_request.text.haml +1 -0
- data/lib/generators/templates/views/confirmation_mailer/registration.text.haml +1 -0
- data/lib/generators/templates/views/confirmation_mailer/resend_signup_token.text.haml +1 -0
- data/lib/generators/templates/views/confirmation_mailer/send_password_reset.text.haml +1 -0
- data/lib/generators/templates/views/password_forgotten/new.html.haml +17 -0
- data/lib/generators/templates/views/password_forgotten/new.html.haml~ +21 -0
- data/lib/generators/templates/views/password_forgotten/order_new_password.html.haml +9 -0
- data/lib/generators/templates/views/password_forgotten/order_new_password.html.haml~ +13 -0
- data/lib/generators/templates/views/password_forgotten/recover_password_auth.html.haml +9 -0
- data/lib/generators/templates/views/sessions/new.html.haml +12 -0
- data/lib/generators/templates/views/sessions/new.html.haml~ +12 -0
- data/lib/generators/templates/views/users/new.html.haml +20 -0
- data/lib/generators/templates/views/users/new.html.haml~ +20 -0
- data/lib/lobby/engine.rb +8 -0
- data/lib/lobby/engine.rb~ +12 -3
- data/lib/lobby/version.rb +1 -1
- data/lib/lobby/version.rb~ +1 -1
- metadata +31 -3
data/config/locales/en.yml
CHANGED
@@ -4,154 +4,145 @@
|
|
4
4
|
en:
|
5
5
|
common:
|
6
6
|
button:
|
7
|
-
send: '
|
7
|
+
send: 'send'
|
8
8
|
form:
|
9
|
-
error: "
|
9
|
+
error: "error"
|
10
10
|
|
11
11
|
activerecord:
|
12
12
|
errors:
|
13
13
|
full_messages:
|
14
14
|
format: "{{message}}"
|
15
15
|
messages:
|
16
|
-
confirmation: "
|
16
|
+
confirmation: "Repeat Password is incorrect."
|
17
17
|
models:
|
18
18
|
user:
|
19
19
|
attributes:
|
20
20
|
password:
|
21
|
-
blank: "
|
22
|
-
too_short: "
|
21
|
+
blank: "Please enter a password."
|
22
|
+
too_short: "Password is too short."
|
23
23
|
password_confirmation:
|
24
|
-
blank: "
|
24
|
+
blank: "Please verify the password."
|
25
25
|
email:
|
26
|
-
taken: '
|
27
|
-
blank: "
|
28
|
-
invalid: "
|
26
|
+
taken: 'This e-mail is already in the system.'
|
27
|
+
blank: "Please enter an e-mail."
|
28
|
+
invalid: "The e-mail has an incorrect format."
|
29
29
|
password_digest:
|
30
|
-
blank: "
|
30
|
+
blank: "Please enter a password"
|
31
31
|
username:
|
32
|
-
blank: "
|
33
|
-
taken: '
|
32
|
+
blank: "Please enter a user name."
|
33
|
+
taken: 'This username is already in the system.'
|
34
34
|
activemodel:
|
35
35
|
errors:
|
36
36
|
models:
|
37
37
|
password_forgotten_form:
|
38
38
|
attributes:
|
39
39
|
new_password:
|
40
|
-
too_short: '
|
40
|
+
too_short: 'The new password is too short (minimum 5 characters)'
|
41
41
|
new_password_confirmation:
|
42
|
-
confirmation: '
|
42
|
+
confirmation: 'Incorrect password confirmation.'
|
43
43
|
|
44
44
|
lobby:
|
45
|
-
navigation:
|
46
|
-
main:
|
47
|
-
link_text:
|
48
|
-
settings: "Account/Einstellungen"
|
49
|
-
will_paginate:
|
50
|
-
previous_label: "zurück"
|
51
|
-
next_label: "weiter"
|
52
|
-
layouts:
|
53
|
-
application:
|
54
|
-
link_text:
|
55
|
-
settings: "Einstellungen"
|
56
|
-
change_email: "E-Mail ändern"
|
57
|
-
change_password: "Passwort ändern"
|
58
45
|
|
59
46
|
users:
|
60
47
|
new:
|
61
|
-
title: '
|
62
|
-
label_email: '
|
48
|
+
title: 'Register'
|
49
|
+
label_email: 'e-mail'
|
63
50
|
label_username: 'Username'
|
64
|
-
label_password: '
|
65
|
-
label_password_confirmation: '
|
51
|
+
label_password: 'Password'
|
52
|
+
label_password_confirmation: 'Password confirmation'
|
66
53
|
create:
|
67
|
-
success: "
|
54
|
+
success: "To complete the registration please click on the link we've just sent you."
|
68
55
|
|
69
56
|
sessions:
|
70
57
|
destroy:
|
71
|
-
success: "
|
58
|
+
success: "You logged out. Bye."
|
72
59
|
new:
|
73
60
|
title: 'Login'
|
74
|
-
label_email: '
|
75
|
-
label_password: '
|
61
|
+
label_email: 'e-mail or username'
|
62
|
+
label_password: 'password'
|
63
|
+
link_password_forgotten: 'Forgot Password?'
|
76
64
|
create:
|
77
65
|
flash:
|
78
|
-
success: "
|
66
|
+
success: "You're in."
|
79
67
|
error:
|
80
|
-
not_active: "
|
81
|
-
not_confirmed: "
|
82
|
-
wrong_password_or_email: "
|
68
|
+
not_active: "Your account has been disabled."
|
69
|
+
not_confirmed: "Please confirm the registration first."
|
70
|
+
wrong_password_or_email: "Incorrect email and / or password"
|
83
71
|
|
84
72
|
info:
|
85
73
|
login_status:
|
86
74
|
logged_in:
|
87
|
-
message_html: "
|
88
|
-
link1: "
|
75
|
+
message_html: "You are logged in as: %{email}. %{logout_link}"
|
76
|
+
link1: "log off?"
|
89
77
|
logged_out:
|
90
|
-
message_html: "
|
91
|
-
link1: "
|
92
|
-
link2: "
|
78
|
+
message_html: "You are not logged in. %{signin_link} or %{signup_link}"
|
79
|
+
link1: "Sign up?"
|
80
|
+
link2: "Log in?"
|
93
81
|
|
94
82
|
confirmation:
|
95
|
-
new_email:
|
96
|
-
flash:
|
97
|
-
success: 'Deine neue E-Mail-Adresse ist nun aktiviert.'
|
98
|
-
new_email_token:
|
99
|
-
title: "Neue E-Mail bestätigen"
|
100
83
|
registration:
|
101
84
|
title: "Token"
|
102
|
-
resend_signup_token_link: "
|
85
|
+
resend_signup_token_link: "or send token again."
|
103
86
|
flash:
|
104
|
-
success: '
|
105
|
-
error: '
|
87
|
+
success: 'Your registration was successful. Now you can login'
|
88
|
+
error: 'Your registration could not be confirmed. Was the link incorrect? If your email program does not properly represent the confirmation link, so you can copy it to the field activation token below.'
|
106
89
|
resend_signup_token:
|
107
|
-
label_email: "E-
|
108
|
-
label_password: "
|
109
|
-
title: "
|
90
|
+
label_email: "E-mail"
|
91
|
+
label_password: "Password"
|
92
|
+
title: "Send activation token again"
|
110
93
|
flash:
|
111
|
-
success: "
|
112
|
-
error: "
|
94
|
+
success: "The activation token was again sent"
|
95
|
+
error: "You are already confirmed. This link is no longer valid."
|
113
96
|
|
114
97
|
|
115
98
|
password_forgotten:
|
116
99
|
recover_password_auth:
|
117
|
-
title: '
|
100
|
+
title: 'Create new password'
|
118
101
|
label_token: 'Token'
|
119
102
|
order_new_password:
|
120
|
-
title: "
|
121
|
-
label_email: "
|
103
|
+
title: "Generate new password"
|
104
|
+
label_email: "Your registered e-mail"
|
122
105
|
flash:
|
123
|
-
success: '
|
106
|
+
success: 'Please check your e-mails. There you will find a link to set your password.'
|
124
107
|
|
125
108
|
confirmation_mailer:
|
126
109
|
|
127
|
-
|
128
|
-
subject: '
|
110
|
+
new_email_request:
|
111
|
+
subject: 'Confirm new email'
|
129
112
|
body: "Hallo,
|
130
|
-
|
113
|
+
to complete the change of your e-mail address at XYZ please click on the following link:
|
114
|
+
|
115
|
+
%{url}
|
116
|
+
|
117
|
+
Thank you very much"
|
118
|
+
|
119
|
+
registration:
|
120
|
+
subject: 'Please confirm registration'
|
121
|
+
body: "Hello,
|
122
|
+
many Thanks for registering with XYZ. To complete your registration please click on the following link:
|
131
123
|
|
132
124
|
%{url}
|
133
125
|
|
134
|
-
|
126
|
+
Thank you very much"
|
135
127
|
|
136
128
|
|
137
129
|
send_password_reset:
|
138
|
-
subject: '
|
139
|
-
body: "
|
140
|
-
|
141
|
-
|
130
|
+
subject: 'Requested new password'
|
131
|
+
body: "Hello.
|
132
|
+
This is an automatically generated message from XYZ for users who have forgotten their login details. Enclosed you will receive,
|
133
|
+
as requested, a link with which you can generate your new password:
|
142
134
|
|
143
135
|
%{url}
|
144
136
|
|
145
|
-
|
146
|
-
|
137
|
+
Thank you very much"
|
147
138
|
|
148
139
|
|
149
140
|
resend_signup_token:
|
150
|
-
subject: '
|
151
|
-
body: "
|
152
|
-
|
153
|
-
|
141
|
+
subject: 'New registration token'
|
142
|
+
body: "Hello.
|
143
|
+
This is an automatically generated message from XYZ for users who have lost their registration email. Enclosed you will receive,
|
144
|
+
as requested, a link with which you can confirm your registration:
|
154
145
|
|
155
146
|
%{url}
|
156
147
|
|
157
|
-
|
148
|
+
VThank you very much"
|
data/config/locales/en.yml~
CHANGED
@@ -4,154 +4,145 @@
|
|
4
4
|
en:
|
5
5
|
common:
|
6
6
|
button:
|
7
|
-
send: '
|
7
|
+
send: 'send'
|
8
8
|
form:
|
9
|
-
error: "
|
9
|
+
error: "error"
|
10
|
+
|
11
|
+
activerecord:
|
12
|
+
errors:
|
13
|
+
full_messages:
|
14
|
+
format: "{{message}}"
|
15
|
+
messages:
|
16
|
+
confirmation: "Repeat Password is incorrect."
|
17
|
+
models:
|
18
|
+
user:
|
19
|
+
attributes:
|
20
|
+
password:
|
21
|
+
blank: "Please enter a password."
|
22
|
+
too_short: "Password is too short."
|
23
|
+
password_confirmation:
|
24
|
+
blank: "Please verify the password."
|
25
|
+
email:
|
26
|
+
taken: 'This e-mail is already in the system.'
|
27
|
+
blank: "Please enter an e-mail."
|
28
|
+
invalid: "The e-mail has an incorrect format."
|
29
|
+
password_digest:
|
30
|
+
blank: "Please enter a password"
|
31
|
+
username:
|
32
|
+
blank: "Please enter a user name."
|
33
|
+
taken: 'This username is already in the system.'
|
34
|
+
activemodel:
|
35
|
+
errors:
|
36
|
+
models:
|
37
|
+
password_forgotten_form:
|
38
|
+
attributes:
|
39
|
+
new_password:
|
40
|
+
too_short: 'The new password is too short (minimum 5 characters)'
|
41
|
+
new_password_confirmation:
|
42
|
+
confirmation: 'Incorrect password confirmation.'
|
10
43
|
|
11
44
|
lobby:
|
12
|
-
navigation:
|
13
|
-
main:
|
14
|
-
link_text:
|
15
|
-
settings: "Account/Einstellungen"
|
16
|
-
will_paginate:
|
17
|
-
previous_label: "zurück"
|
18
|
-
next_label: "weiter"
|
19
|
-
layouts:
|
20
|
-
application:
|
21
|
-
link_text:
|
22
|
-
settings: "Einstellungen"
|
23
|
-
change_email: "E-Mail ändern"
|
24
|
-
change_password: "Passwort ändern"
|
25
|
-
|
26
|
-
activerecord:
|
27
|
-
errors:
|
28
|
-
full_messages:
|
29
|
-
format: "{{message}}"
|
30
|
-
messages:
|
31
|
-
confirmation: "Passwortwiederholung ist falsch."
|
32
|
-
models:
|
33
|
-
user:
|
34
|
-
attributes:
|
35
|
-
password:
|
36
|
-
blank: "Bitte gib ein Passwort ein."
|
37
|
-
too_short: "Passwort ist zu kurz."
|
38
|
-
password_confirmation:
|
39
|
-
blank: "Passwort bitte wiederholen."
|
40
|
-
email:
|
41
|
-
taken: 'Diese E-Mail ist schon im System.'
|
42
|
-
blank: "Bitte gib eine E-Mail an."
|
43
|
-
invalid: "Die E-Mail hat ein falsches Format."
|
44
|
-
password_digest:
|
45
|
-
blank: "Bitte gib ein Passwort ein."
|
46
|
-
username:
|
47
|
-
blank: "Bitte gib einen Username an."
|
48
|
-
taken: 'Dieser Username ist schon im System.'
|
49
|
-
activemodel:
|
50
|
-
errors:
|
51
|
-
models:
|
52
|
-
password_forgotten_form:
|
53
|
-
attributes:
|
54
|
-
new_password:
|
55
|
-
too_short: 'Das neue Passwort ist zu kurz (mind. 5 Zeichen)'
|
56
|
-
new_password_confirmation:
|
57
|
-
confirmation: 'Die Passwortbestätigung war falsch.'
|
58
45
|
|
59
46
|
users:
|
60
47
|
new:
|
61
|
-
title: '
|
62
|
-
label_email: '
|
48
|
+
title: 'Register'
|
49
|
+
label_email: 'e-mail'
|
63
50
|
label_username: 'Username'
|
64
|
-
label_password: '
|
65
|
-
label_password_confirmation: '
|
51
|
+
label_password: 'Password'
|
52
|
+
label_password_confirmation: 'Password confirmation'
|
66
53
|
create:
|
67
|
-
success: "
|
54
|
+
success: "To complete the registration please click on the link we've just sent you."
|
68
55
|
|
69
56
|
sessions:
|
70
57
|
destroy:
|
71
|
-
success: "
|
58
|
+
success: "You logged out. Bye."
|
72
59
|
new:
|
73
60
|
title: 'Login'
|
74
|
-
label_email: '
|
75
|
-
label_password: '
|
61
|
+
label_email: 'e-mail or username'
|
62
|
+
label_password: 'password'
|
63
|
+
link_password_forgotten: 'Forgot Password?'
|
76
64
|
create:
|
77
65
|
flash:
|
78
|
-
success: "
|
66
|
+
success: "You're in."
|
79
67
|
error:
|
80
|
-
not_active: "
|
81
|
-
not_confirmed: "
|
82
|
-
wrong_password_or_email: "
|
68
|
+
not_active: "Your account has been disabled."
|
69
|
+
not_confirmed: "Please confirm the registration first."
|
70
|
+
wrong_password_or_email: "Incorrect email and / or password"
|
83
71
|
|
84
72
|
info:
|
85
73
|
login_status:
|
86
74
|
logged_in:
|
87
|
-
message_html: "
|
88
|
-
link1: "
|
75
|
+
message_html: "You are logged in as: %{email}. %{logout_link}"
|
76
|
+
link1: "log off?"
|
89
77
|
logged_out:
|
90
|
-
message_html: "
|
91
|
-
link1: "
|
92
|
-
link2: "
|
78
|
+
message_html: "You are not logged in. %{signin_link} or %{signup_link}"
|
79
|
+
link1: "Sign up?"
|
80
|
+
link2: "Log in?"
|
93
81
|
|
94
82
|
confirmation:
|
95
|
-
new_email:
|
96
|
-
flash:
|
97
|
-
success: 'Deine neue E-Mail-Adresse ist nun aktiviert.'
|
98
|
-
new_email_token:
|
99
|
-
title: "Neue E-Mail bestätigen"
|
100
83
|
registration:
|
101
84
|
title: "Token"
|
102
|
-
resend_signup_token_link: "
|
85
|
+
resend_signup_token_link: "or send token again."
|
103
86
|
flash:
|
104
|
-
success: '
|
105
|
-
error: '
|
87
|
+
success: 'Your registration was successful. Now you can login'
|
88
|
+
error: 'Your registration could not be confirmed. Was the link incorrect? If your email program does not properly represent the confirmation link, so you can copy it to the field activation token below.'
|
106
89
|
resend_signup_token:
|
107
|
-
label_email: "E-
|
108
|
-
label_password: "
|
109
|
-
title: "
|
90
|
+
label_email: "E-mail"
|
91
|
+
label_password: "Password"
|
92
|
+
title: "Send activation token again"
|
110
93
|
flash:
|
111
|
-
success: "
|
112
|
-
error: "
|
94
|
+
success: "The activation token was again sent"
|
95
|
+
error: "You are already confirmed. This link is no longer valid."
|
113
96
|
|
114
97
|
|
115
98
|
password_forgotten:
|
116
99
|
recover_password_auth:
|
117
|
-
title: '
|
100
|
+
title: 'Create new password'
|
118
101
|
label_token: 'Token'
|
119
102
|
order_new_password:
|
120
|
-
title: "
|
121
|
-
label_email: "
|
103
|
+
title: "Generate new password"
|
104
|
+
label_email: "Your registered e-mail"
|
122
105
|
flash:
|
123
|
-
success: '
|
106
|
+
success: 'Please check your e-mails. There you will find a link to set your password.'
|
124
107
|
|
125
108
|
confirmation_mailer:
|
126
109
|
|
127
|
-
|
128
|
-
subject: '
|
110
|
+
new_email_request:
|
111
|
+
subject: 'Confirm new email'
|
129
112
|
body: "Hallo,
|
130
|
-
|
113
|
+
to complete the change of your e-mail address at XYZ please click on the following link:
|
114
|
+
|
115
|
+
%{url}
|
116
|
+
|
117
|
+
Thank you very much"
|
118
|
+
|
119
|
+
registration:
|
120
|
+
subject: 'Please confirm registration'
|
121
|
+
body: "Hello,
|
122
|
+
many Thanks for registering with XYZ. To complete your registration please click on the following link:
|
131
123
|
|
132
124
|
%{url}
|
133
125
|
|
134
|
-
|
126
|
+
Thank you very much"
|
135
127
|
|
136
128
|
|
137
129
|
send_password_reset:
|
138
|
-
subject: '
|
139
|
-
body: "
|
140
|
-
|
141
|
-
|
130
|
+
subject: 'Requested new password'
|
131
|
+
body: "Hello.
|
132
|
+
This is an automatically generated message from XYZ for users who have forgotten their login details. Enclosed you will receive,
|
133
|
+
as requested, a link with which you can generate your new password:
|
142
134
|
|
143
135
|
%{url}
|
144
136
|
|
145
|
-
|
146
|
-
|
137
|
+
Thank you very much"
|
147
138
|
|
148
139
|
|
149
140
|
resend_signup_token:
|
150
|
-
subject: '
|
151
|
-
body: "
|
152
|
-
|
153
|
-
|
141
|
+
subject: 'New registration token'
|
142
|
+
body: "Hello.
|
143
|
+
This is an automatically generated message from XYZ for users who have lost their registration email. Enclosed you will receive,
|
144
|
+
as requested, a link with which you can confirm your registration:
|
154
145
|
|
155
146
|
%{url}
|
156
147
|
|
157
|
-
|
148
|
+
VThank you very much"
|
data/config/routes.rb
CHANGED
@@ -15,7 +15,5 @@ Lobby::Engine.routes.draw do
|
|
15
15
|
post 'recover_password' => 'password_forgotten#create', as: 'recover_password'
|
16
16
|
match 'request_password' => 'password_forgotten#order_new_password', as: 'order_new_password', via: [:get, :post]
|
17
17
|
|
18
|
-
# new email confirmation
|
19
|
-
match 'new_email(/:token)' => 'confirmation#new_email', as: 'new_email', via: [:get, :post]
|
20
18
|
default_url_options :host => 'localhost:3000'
|
21
19
|
end
|
data/config/routes.rb~
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Lobby::Engine.routes.draw do
|
2
|
+
|
3
|
+
root to: 'sessions#new'
|
4
|
+
|
5
|
+
post 'log_in' => 'sessions#create', as: 'log_in'
|
6
|
+
get 'log_in' => 'sessions#new', as: 'log_in_link'
|
7
|
+
match 'confirm/resend_confirmation' => 'confirmation#resend_signup_token', as: 'resend_signup_token', via: [:get, :post]
|
8
|
+
match 'confirm/:action(/:token)', :controller => :confirmation, as: 'confirm', via: [:get, :post]
|
9
|
+
post 'register' => 'users#create', as: 'sign_up'
|
10
|
+
get 'register' => 'users#new', as: 'sign_up_form'
|
11
|
+
get 'log_out' => 'sessions#destroy', as: 'log_out'
|
12
|
+
|
13
|
+
# forgotten password
|
14
|
+
get 'recover_password(/:token)' => 'password_forgotten#new', as: 'recover_password_form'
|
15
|
+
post 'recover_password' => 'password_forgotten#create', as: 'recover_password'
|
16
|
+
match 'request_password' => 'password_forgotten#order_new_password', as: 'order_new_password', via: [:get, :post]
|
17
|
+
|
18
|
+
# new email confirmation
|
19
|
+
match 'new_email(/:token)' => 'confirmation#new_email', as: 'new_email', via: [:get, :post]
|
20
|
+
default_url_options :host => 'localhost:3000'
|
21
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/migration'
|
3
|
+
|
4
|
+
module Lobby
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
|
8
|
+
attr_accessor :user_name, :session_name
|
9
|
+
|
10
|
+
argument :user_name, :type => :string, :default => "user"
|
11
|
+
argument :session_name, :type => :string, :default => "session"
|
12
|
+
|
13
|
+
source_root File.expand_path("../../templates", __FILE__)
|
14
|
+
|
15
|
+
def create_views
|
16
|
+
directory "views", "app/views/lobby"
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_locales
|
20
|
+
template "config/locales/de.yml", "config/locales/de.lobby.yml"
|
21
|
+
template "config/locales/en.yml", "config/locales/en.lobby.yml"
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_config_files
|
25
|
+
template "config/config.yml", "config/app_config.yml"
|
26
|
+
template "config/locales/en.yml", "config/locales/en.lobby.yml"
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_config_files
|
30
|
+
template "config/config.yml", "config/app_config.yml"
|
31
|
+
template "config/initializers/action_mailer.rb", "config/initializers/action_mailer.rb"
|
32
|
+
template "config/initializers/constants.rb", "config/initializers/constants.rb"
|
33
|
+
end
|
34
|
+
|
35
|
+
def setup_routes
|
36
|
+
route "mount Lobby::Engine => '/', :as => 'lobby_engine'"
|
37
|
+
end
|
38
|
+
|
39
|
+
def create_migration
|
40
|
+
migration_template 'db/migrate/create_users.rb', "db/migrate/create_#{user_plural_name}.rb"
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def user_singular_name
|
46
|
+
user_name.underscore
|
47
|
+
end
|
48
|
+
|
49
|
+
def user_plural_name
|
50
|
+
user_singular_name.pluralize
|
51
|
+
end
|
52
|
+
|
53
|
+
def user_class_name
|
54
|
+
user_name.camelize
|
55
|
+
end
|
56
|
+
|
57
|
+
def user_plural_class_name
|
58
|
+
user_plural_name.camelize
|
59
|
+
end
|
60
|
+
|
61
|
+
def session_singular_name
|
62
|
+
session_name.underscore
|
63
|
+
end
|
64
|
+
|
65
|
+
def session_plural_name
|
66
|
+
session_singular_name.pluralize
|
67
|
+
end
|
68
|
+
|
69
|
+
def session_class_name
|
70
|
+
session_name.camelize
|
71
|
+
end
|
72
|
+
|
73
|
+
def session_plural_class_name
|
74
|
+
session_plural_name.camelize
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.next_migration_number(dirname) #:nodoc:
|
78
|
+
if ActiveRecord::Base.timestamped_migrations
|
79
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S")
|
80
|
+
else
|
81
|
+
"%.3d" % (current_migration_number(dirname) + 1)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
end
|