devise_rails3_ennder 0.9.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.
Files changed (51) hide show
  1. data/.bnsignore +21 -0
  2. data/.rvmrc +2 -0
  3. data/CHANGELOG.rdoc +397 -0
  4. data/History.txt +3 -0
  5. data/INSTALL +93 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.rdoc +272 -0
  8. data/Rakefile +17 -0
  9. data/TODO +2 -0
  10. data/app/.directory +3 -0
  11. data/app/views/.directory +3 -0
  12. data/app/views/devise/.directory +3 -0
  13. data/app/views/devise/confirmations/new.html.erb +14 -0
  14. data/app/views/devise/mailer/confirmation_instructions.html.erb +7 -0
  15. data/app/views/devise/mailer/reset_password_instructions.html.erb +12 -0
  16. data/app/views/devise/mailer/unlock_instructions.html.erb +10 -0
  17. data/app/views/devise/passwords/edit.html.erb +20 -0
  18. data/app/views/devise/passwords/new.html.erb +14 -0
  19. data/app/views/devise/registrations/.directory +3 -0
  20. data/app/views/devise/registrations/edit.html.erb +31 -0
  21. data/app/views/devise/registrations/new.html.erb +18 -0
  22. data/app/views/devise/sessions/new.html.erb +17 -0
  23. data/app/views/devise/shared/_links.erb +25 -0
  24. data/app/views/devise/shared/_user_nav.html.erb +15 -0
  25. data/app/views/devise/unlocks/new.html.erb +14 -0
  26. data/bin/.directory +3 -0
  27. data/bin/devise_rails3_ennder.rb +6 -0
  28. data/config/.directory +4 -0
  29. data/config/routes.rb +25 -0
  30. data/lib/.directory +3 -0
  31. data/lib/app/.directory +3 -0
  32. data/lib/app/models/.directory +3 -0
  33. data/lib/app/models/user.rb +9 -0
  34. data/lib/config/.directory +3 -0
  35. data/lib/config/initializers/.directory +3 -0
  36. data/lib/config/initializers/devise.rb +194 -0
  37. data/lib/db/.directory +3 -0
  38. data/lib/db/migrate/.directory +3 -0
  39. data/lib/db/migrate/SSAAMMJJHHMMSS_devise_create_users.rb +26 -0
  40. data/lib/devise_rails3_ennder/.directory +3 -0
  41. data/lib/devise_rails3_ennder/config/.directory +3 -0
  42. data/lib/devise_rails3_ennder/config/locales/.directory +3 -0
  43. data/lib/devise_rails3_ennder/config/locales/devise.en.yml +98 -0
  44. data/lib/devise_rails3_ennder/config/locales/devise.fr.yml +109 -0
  45. data/lib/devise_rails3_ennder/engine.rb +8 -0
  46. data/lib/devise_rails3_ennder/load_locales.rb +12 -0
  47. data/lib/devise_rails3_ennder.rb +64 -0
  48. data/lib/tasks/.directory +3 -0
  49. data/lib/tasks/devise_rails3_ennder_tasks.rake +30 -0
  50. data/version.txt +1 -0
  51. metadata +134 -0
@@ -0,0 +1,194 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
+ # four configuration values can also be set straight in your models.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in DeviseMailer.
6
+ config.mailer_sender = "svp-changez-moi-a-config-initializers-devise@exemple.com"
7
+
8
+ # Configure the class responsible to send e-mails.
9
+ # config.mailer = "Devise::Mailer"
10
+
11
+ # ==> ORM configuration
12
+ # Load and configure the ORM. Supports :active_record (default) and
13
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
14
+ # available as additional gems.
15
+ require 'devise/orm/active_record'
16
+
17
+ # ==> Configuration for any authentication mechanism
18
+ # Configure which keys are used when authenticating a user. The default is
19
+ # just :email. You can configure it to use [:username, :subdomain], so for
20
+ # authenticating a user, both parameters are required. Remember that those
21
+ # parameters are used only when authenticating and not when retrieving from
22
+ # session. If you need permissions, you should implement that in a before filter.
23
+ # You can also supply a hash where the value is a boolean determining whether
24
+ # or not authentication should be aborted when the value is not present.
25
+ # config.authentication_keys = [ :email ]
26
+
27
+ # Configure parameters from the request object used for authentication. Each entry
28
+ # given should be a request method and it will automatically be passed to the
29
+ # find_for_authentication method and considered in your model lookup. For instance,
30
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
31
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
32
+ # config.request_keys = []
33
+
34
+ # Configure which authentication keys should be case-insensitive.
35
+ # These keys will be downcased upon creating or modifying a user and when used
36
+ # to authenticate or find a user. Default is :email.
37
+ config.case_insensitive_keys = [ :email ]
38
+
39
+ # Tell if authentication through request.params is enabled. True by default.
40
+ # config.params_authenticatable = true
41
+
42
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
43
+ # config.http_authenticatable = false
44
+
45
+ # If http headers should be returned for AJAX requests. True by default.
46
+ # config.http_authenticatable_on_xhr = true
47
+
48
+ # The realm used in Http Basic Authentication. "Application" by default.
49
+ # config.http_authentication_realm = "Application"
50
+
51
+ # ==> Configuration for :database_authenticatable
52
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
53
+ # using other encryptors, it sets how many times you want the password re-encrypted.
54
+ config.stretches = 10
55
+
56
+ # Setup a pepper to generate the encrypted password.
57
+ # config.pepper = "94a683c3f13205a07644702dc58e0af0767809756d99dd99c38d02ba79537c70923aa70a2a42615722caea2721cd3cb78a91d634b121ab7d4b21a2e6e2ae2b85"
58
+
59
+ # ==> Configuration for :confirmable
60
+ # The time you want to give your user to confirm his account. During this time
61
+ # he will be able to access your application without confirming. Default is 0.days
62
+ # When confirm_within is zero, the user won't be able to sign in without confirming.
63
+ # You can use this to let your user access some features of your application
64
+ # without confirming the account, but blocking it after a certain period
65
+ # (ie 2 days).
66
+ # config.confirm_within = 2.days
67
+
68
+ # Defines which key will be used when confirming an account
69
+ # config.confirmation_keys = [ :email ]
70
+
71
+ # ==> Configuration for :rememberable
72
+ # The time the user will be remembered without asking for credentials again.
73
+ # config.remember_for = 2.weeks
74
+
75
+ # If true, a valid remember token can be re-used between multiple browsers.
76
+ # config.remember_across_browsers = true
77
+
78
+ # If true, extends the user's remember period when remembered via cookie.
79
+ # config.extend_remember_period = false
80
+
81
+ # If true, uses the password salt as remember token. This should be turned
82
+ # to false if you are not using database authenticatable.
83
+ config.use_salt_as_remember_token = true
84
+
85
+ # Options to be passed to the created cookie. For instance, you can set
86
+ # :secure => true in order to force SSL only cookies.
87
+ # config.cookie_options = {}
88
+
89
+ # ==> Configuration for :validatable
90
+ # Range for password length. Default is 6..128.
91
+ # config.password_length = 6..128
92
+
93
+ # Regex to use to validate the email address
94
+ # config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
95
+
96
+ # ==> Configuration for :timeoutable
97
+ # The time you want to timeout the user session without activity. After this
98
+ # time the user will be asked for credentials again. Default is 30 minutes.
99
+ # config.timeout_in = 30.minutes
100
+
101
+ # ==> Configuration for :lockable
102
+ # Defines which strategy will be used to lock an account.
103
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
104
+ # :none = No lock strategy. You should handle locking by yourself.
105
+ # config.lock_strategy = :failed_attempts
106
+
107
+ # Defines which key will be used when locking and unlocking an account
108
+ # config.unlock_keys = [ :email ]
109
+
110
+ # Defines which strategy will be used to unlock an account.
111
+ # :email = Sends an unlock link to the user email
112
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
113
+ # :both = Enables both strategies
114
+ # :none = No unlock strategy. You should handle unlocking by yourself.
115
+ # config.unlock_strategy = :both
116
+
117
+ # Number of authentication tries before locking an account if lock_strategy
118
+ # is failed attempts.
119
+ # config.maximum_attempts = 20
120
+
121
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
122
+ # config.unlock_in = 1.hour
123
+
124
+ # ==> Configuration for :recoverable
125
+ #
126
+ # Defines which key will be used when recovering the password for an account
127
+ # config.reset_password_keys = [ :email ]
128
+
129
+ # Time interval you can reset your password with a reset password key.
130
+ # Don't put a too small interval or your users won't have the time to
131
+ # change their passwords.
132
+ config.reset_password_within = 2.hours
133
+
134
+ # ==> Configuration for :encryptable
135
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
136
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
137
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
138
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
139
+ # REST_AUTH_SITE_KEY to pepper)
140
+ # config.encryptor = :sha512
141
+
142
+ # ==> Configuration for :token_authenticatable
143
+ # Defines name of the authentication token params key
144
+ # config.token_authentication_key = :auth_token
145
+
146
+ # If true, authentication through token does not store user in session and needs
147
+ # to be supplied on each request. Useful if you are using the token as API token.
148
+ # config.stateless_token = false
149
+
150
+ # ==> Scopes configuration
151
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
152
+ # "users/sessions/new". It's turned off by default because it's slower if you
153
+ # are using only default views.
154
+ # config.scoped_views = false
155
+
156
+ # Configure the default scope given to Warden. By default it's the first
157
+ # devise role declared in your routes (usually :user).
158
+ # config.default_scope = :user
159
+
160
+ # Configure sign_out behavior.
161
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
162
+ # The default is true, which means any logout action will sign out all active scopes.
163
+ # config.sign_out_all_scopes = true
164
+
165
+ # ==> Navigation configuration
166
+ # Lists the formats that should be treated as navigational. Formats like
167
+ # :html, should redirect to the sign in page when the user does not have
168
+ # access, but formats like :xml or :json, should return 401.
169
+ #
170
+ # If you have any extra navigational formats, like :iphone or :mobile, you
171
+ # should add them to the navigational formats lists.
172
+ #
173
+ # The :"*/*" and "*/*" formats below is required to match Internet
174
+ # Explorer requests.
175
+ # config.navigational_formats = [:"*/*", "*/*", :html]
176
+
177
+ # The default HTTP method used to sign out a resource. Default is :get.
178
+ # config.sign_out_via = :get
179
+
180
+ # ==> OmniAuth
181
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
182
+ # up on your models and hooks.
183
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
184
+
185
+ # ==> Warden configuration
186
+ # If you want to use other strategies, that are not supported by Devise, or
187
+ # change the failure app, you can configure them inside the config.warden block.
188
+ #
189
+ # config.warden do |manager|
190
+ # manager.failure_app = AnotherApp
191
+ # manager.intercept_401 = false
192
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
193
+ # end
194
+ end
data/lib/db/.directory ADDED
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2010,12,15,2,39,59
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2010,12,14,16,23,46
3
+ ViewMode=1
@@ -0,0 +1,26 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table(:users) do |t|
4
+ t.database_authenticatable :null => false
5
+ t.confirmable
6
+ t.recoverable
7
+ t.rememberable
8
+ t.trackable
9
+ # t.lockable
10
+ # t.token_authenticatable
11
+ # t.encryptable
12
+
13
+ t.timestamps
14
+ end
15
+
16
+ add_index :users, :email, :unique => true
17
+ add_index :users, :confirmation_token, :unique => true
18
+ add_index :users, :reset_password_token, :unique => true
19
+ # add_index :users, :unlock_token, :unique => true
20
+ # add_index :users, :authentication_token, :unique => true
21
+ end
22
+
23
+ def self.down
24
+ drop_table :users
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,1,3,3,5,58
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,6,7,14,33,15
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,1,7,18,28,9
3
+ ViewMode=1
@@ -0,0 +1,98 @@
1
+ # Additional translations at http://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: 'You need to sign in or sign up before continuing.'
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ #Ennder
28
+ link: 'Sign-in'
29
+ #Ennder
30
+ or: 'or'
31
+ #Ennder
32
+ Logout: 'Sign out'
33
+ #Ennder
34
+ signed_in_as: 'Signed-in as'
35
+ #Ennder
36
+ sign_in: 'Sign in'
37
+ passwords:
38
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
39
+ updated: 'Your password was changed successfully. You are now signed in.'
40
+ #Ennder:
41
+ link: 'Forgot your password?'
42
+ confirmations:
43
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
44
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
45
+ #Ennder:
46
+ link: "Didn't receive confirmation instructions?"
47
+ registrations:
48
+ signed_up: 'Welcome! You have signed up successfully.'
49
+ inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
50
+ updated: 'You updated your account successfully.'
51
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
52
+ link: 'Sign-up'
53
+ #Ennder
54
+ edit: 'Edit my profile'
55
+ #Ennder
56
+ sign_up: 'Sign up'
57
+ #Ennder
58
+ edit_only: 'Edit'
59
+ #Ennder
60
+ cancel_account: 'Cancel my account'
61
+ #Ennder
62
+ unhappy: 'Unhappy?'
63
+ #Ennder
64
+ leave_password_blank_dont_change: "leave blank if you don't want to change it"
65
+ #Ennder
66
+ need_current_passord: 'we need your current password to confirm your changes'
67
+ unlocks:
68
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
69
+ unlocked: 'Your account was successfully unlocked. You are now signed in.'
70
+ #Ennder
71
+ link: "Didn't receive unlock instructions?"
72
+ omniauth_callbacks:
73
+ success: 'Successfully authorized from %{kind} account.'
74
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
75
+ mailer:
76
+ confirmation_instructions:
77
+ subject: 'Confirmation instructions'
78
+ reset_password_instructions:
79
+ subject: 'Reset password instructions'
80
+ unlock_instructions:
81
+ subject: 'Unlock Instructions'
82
+ #Ennder
83
+ Change_my_password: 'Changer mon mot de passe'
84
+ #Ennder
85
+ Someone_requested_change_password: "Quelqu'un a demandé un lien pour changer votre mot de passe, ce que vous pouvez faire avec le lien ci-dessous."
86
+ #Ennder
87
+ If_you_didnt_request_this: "Si vous n'avez pas demandé ce changement, veuillez ignorer cet email."
88
+ #Ennder
89
+ Your_password_wont_change_until: "Votre mot de passe ne changera pas avant que vous n'accédiez au lien ci-dessous pour en créer un nouveau."
90
+ #Ennder
91
+ # sessions:
92
+ # self_link: 'Se loguer'
93
+ # Could_not_destroy_resource: "Suppression de l'Utilisateur impossible!"
94
+ # send_me_instructions: 'Envoyez-moi les instructions de ré-initialisation de mot de passe'
95
+ # registrations:
96
+ # self_link: "S'enregistrer"
97
+ # confirm_link: 'Vous pouvez confirmer votre compte avec le lien suivant :'
98
+
@@ -0,0 +1,109 @@
1
+ # Additional translations at http://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ fr:
4
+ errors:
5
+ messages:
6
+ expired: "a expiré, veuillez en demander un nouveau"
7
+ not_found: "pas trouvé"
8
+ already_confirmed: "a déjà été confirmé, veuillez vous loguer"
9
+ not_locked: "n'a pas été vérouillé"
10
+ not_saved:
11
+ one: "1 erreur a empêché cet %{resource} d'être enregistré :"
12
+ other: "%{count} erreurs ont empêché cet %{resource} d'être enregistré :"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'Vous êtes déjà logué.'
17
+ unauthenticated: 'Vous devez vous loguer ou vous enregistrer avant de continuer.'
18
+ unconfirmed: 'Vous devez confirmer votre compte avant de continuer.'
19
+ locked: 'Votre compte est vérrouillé.'
20
+ invalid: 'Email ou mot-de-passe invalide.'
21
+ invalid_token: "Jeton d'authentification invalide."
22
+ timeout: 'Votre session a expiré, veuillez vous re-loguer pour continuer.'
23
+ inactive: "Votre compte n'a pas encore été activé."
24
+ sessions:
25
+ signed_in: 'Vous êtes logué.'
26
+ signed_out: 'Vous avez été délogué.'
27
+ #Ennder
28
+ link: 'Connexion'
29
+ #Ennder
30
+ or: 'ou'
31
+ #Ennder
32
+ Logout: 'Déconnexion'
33
+ #Ennder
34
+ signed_in_as: 'Logué en tant que'
35
+ #Ennder
36
+ sign_in: 'Se connecter'
37
+ passwords:
38
+ send_instructions: 'Vous allez recevoir dans quelques minutes un email avec les instructions vous indiquant comment réinitiliser votre mot de passe.'
39
+ updated: 'Votre mot de passe a été changé avec succès. Vous êtes maintenant logué.'
40
+ #Ennder:
41
+ link: 'Mot de passe oublié ?'
42
+ confirmations:
43
+ send_instructions: 'Vous allez recevoir dans quelques minutes un email, avec les instructions vous permettant de confirmer votre compte.'
44
+ confirmed: 'Votre compte a été confirmé avec succès. Vous êtes maintenant logué.'
45
+ #Ennder:
46
+ link: "Vous n'avez pas reçu les instructions de confirmation ?"
47
+ registrations:
48
+ signed_up: 'Vous vous êtes enregistré avec succès. Si activé, une confirmation a été envoyée à votre adresse e-mail.'
49
+ inactive_signed_up: "Vous vous êtes enregistré avec succès. Cependant, nous n'avons pas pu vous loguer parceque votre compte est %{reason}."
50
+ updated: 'Vous avez mis à jour votre compte avec succès.'
51
+ destroyed: 'Au revoir! Votre compte a été supprimé avec succès. Nous espérons vous revoir bientôt.'
52
+ link: 'Enregistrement'
53
+ #Ennder
54
+ edit: 'Éditer mon profil'
55
+ #Ennder
56
+ sign_up: 'Enregistrement'
57
+ #Ennder
58
+ edit_only: 'Éditer'
59
+ #Ennder
60
+ cancel_account: 'Supprimer mon compte'
61
+ #Ennder
62
+ unhappy: 'Mécontent ?'
63
+ #Ennder
64
+ leave_password_blank_dont_change: "laissez-le blanc si vous ne voulez pas le changer"
65
+ #Ennder
66
+ need_current_passord: 'nous avons besoin de votre mot de passe courant pour confirmer le changement'
67
+ unlocks:
68
+ send_instructions: 'Vous allez recevoir dans quelques minutes un email, avec les instructions vous permettant de dé-verrouiller votre compte.'
69
+ unlocked: 'Votre compte a été dé-verouillé avec succès. Vous êtes maintenant logué.'
70
+ #Ennder
71
+ link: "Vous n'avez pas reçu les instructions de dé-verrouillage ?"
72
+ omniauth_callbacks:
73
+ success: 'Authorisé avec succès avec le compte %{kind}.'
74
+ failure: "Nous n'avons pas pu vous authoriser avec le compte %{kind} parceque \"%{reason}\"."
75
+ mailer:
76
+ confirmation_instructions:
77
+ subject: 'Instructions de confirmation'
78
+ reset_password_instructions:
79
+ subject: 'Instructions de ré-initialisation de mot de passe'
80
+ unlock_instructions:
81
+ subject: 'Instructions de dé-verrouillage'
82
+ #Ennder
83
+ Change_my_password: 'Changer mon mot de passe'
84
+ #Ennder
85
+ Someone_requested_change_password: "Quelqu'un a demandé un lien pour changer votre mot de passe, ce que vous pouvez faire avec le lien ci-dessous."
86
+ #Ennder
87
+ If_you_didnt_request_this: "Si vous n'avez pas demandé ce changement, veuillez ignorer cet email."
88
+ #Ennder
89
+ Your_password_wont_change_until: "Votre mot de passe ne changera pas avant que vous n'accédiez au lien ci-dessous pour en créer un nouveau."
90
+ #Ennder
91
+ # sessions:
92
+ # self_link: 'Se loguer'
93
+ # Could_not_destroy_resource: "Suppression de l'Utilisateur impossible!"
94
+ # passwords:
95
+ # link: 'Mot de passe oublié ?'
96
+ # send_me_instructions: 'Envoyez-moi les instructions de ré-initialisation de mot de passe'
97
+ # registrations:
98
+ # self_link: "S'enregistrer"
99
+ # confirm_link: 'Vous pouvez confirmer votre compte avec le lien suivant :'
100
+
101
+ activerecord:
102
+ models:
103
+ user: "Utilisateur"
104
+ attributes:
105
+ user:
106
+ password: 'Mot de passe'
107
+ password_confirmation: 'Confirmation du mot de passe'
108
+ current_password: 'Mot de passe courant'
109
+ remember_me: 'Se souvenir de moi'
@@ -0,0 +1,8 @@
1
+ if Rails::VERSION::MAJOR >= 3
2
+
3
+ module DeviseRails3Ennder
4
+ class Engine < Rails::Engine
5
+ end
6
+ end
7
+
8
+ end
@@ -0,0 +1,12 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ #Ajout des fichiers de traductions
4
+ puts 'GEM devise_rails3_ennder Locales Devise apportés par le Gem devise_rails3_ennder'
5
+ _locale_en = File.expand_path(File.join(File.dirname(__FILE__), 'config', 'locales', 'devise.en.yml'))
6
+ _locale_fr = File.expand_path(File.join(File.dirname(__FILE__), 'config', 'locales', 'devise.fr.yml'))
7
+
8
+ puts " - #{_locale_en}"
9
+ puts " - #{_locale_fr}"
10
+
11
+ I18n.load_path.unshift _locale_en
12
+ I18n.load_path.unshift _locale_fr
@@ -0,0 +1,64 @@
1
+
2
+ module DeviseRails3Ennder
3
+
4
+ # :stopdoc:
5
+ LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
6
+ PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
7
+ # :startdoc:
8
+
9
+ # Returns the version string for the library.
10
+ #
11
+ def self.version
12
+ @version ||= File.read(path('version.txt')).strip
13
+ end
14
+
15
+ # Returns the library path for the module. If any arguments are given,
16
+ # they will be joined to the end of the libray path using
17
+ # <tt>File.join</tt>.
18
+ #
19
+ def self.libpath( *args, &block )
20
+ rv = args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
21
+ if block
22
+ begin
23
+ $LOAD_PATH.unshift LIBPATH
24
+ rv = block.call
25
+ ensure
26
+ $LOAD_PATH.shift
27
+ end
28
+ end
29
+ return rv
30
+ end
31
+
32
+ # Returns the lpath for the module. If any arguments are given,
33
+ # they will be joined to the end of the path using
34
+ # <tt>File.join</tt>.
35
+ #
36
+ def self.path( *args, &block )
37
+ rv = args.empty? ? PATH : ::File.join(PATH, args.flatten)
38
+ if block
39
+ begin
40
+ $LOAD_PATH.unshift PATH
41
+ rv = block.call
42
+ ensure
43
+ $LOAD_PATH.shift
44
+ end
45
+ end
46
+ return rv
47
+ end
48
+
49
+ # Utility method used to require all files ending in .rb that lie in the
50
+ # directory below this file that has the same name as the filename passed
51
+ # in. Optionally, a specific _directory_ name can be passed in such that
52
+ # the _filename_ does not have to be equivalent to the directory.
53
+ #
54
+ def self.require_all_libs_relative_to( fname, dir = nil )
55
+ dir ||= ::File.basename(fname, '.*')
56
+ search_me = ::File.expand_path(
57
+ ::File.join(::File.dirname(fname), dir, '**', '*.rb'))
58
+
59
+ Dir.glob(search_me).sort.each {|rb| require rb}
60
+ end
61
+
62
+ end # module DeviseRails3Ennder
63
+
64
+ DeviseRails3Ennder.require_all_libs_relative_to(__FILE__)
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,6,7,17,6,5
3
+ ViewMode=1
@@ -0,0 +1,30 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ namespace :devise_rails3_ennder do
4
+ desc "Synchronise les migrations du gem devise_rails3_ennder vers l'appli"
5
+ task :sync_migrations do
6
+ _migration_source = File.join(File.dirname(__FILE__), %w[.. db migrate]) + '/SSAAMMJJHHMMSS_devise_create_users.rb'
7
+ _migration_dest = "db/migrate/#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_devise_create_users.rb"
8
+
9
+ puts "devise_rails3_ennder:sync_migrations #{_migration_source} -> #{_migration_dest}"
10
+ system "cp #{_migration_source} #{_migration_dest}"
11
+ end
12
+
13
+
14
+ desc "Synchronise le modèle user du gem devise_rails3_ennder vers l'appli"
15
+ task :sync_user_model do
16
+ _modele_source = File.join(File.dirname(__FILE__), %w[.. app models]) + '/user.rb'
17
+
18
+ puts "devise_rails3_ennder:sync_user_model #{_modele_source} -> app/models"
19
+ system "rsync -ruv #{_modele_source} app/models"
20
+ end
21
+
22
+
23
+ desc "Synchronise le fichier d'initialisation du gem devise_rails3_ennder vers l'appli"
24
+ task :sync_devise_initializer do
25
+ _devise_initializer_source = File.join(File.dirname(__FILE__), %w[.. config initializers ]) + '/devise.rb'
26
+
27
+ puts "devise_rails3_ennder:sync_devise_initializer #{_devise_initializer_source} -> config/initializers"
28
+ system "rsync -ruv #{_devise_initializer_source} config/initializers"
29
+ end
30
+ end
data/version.txt ADDED
@@ -0,0 +1 @@
1
+ 0.9.0