tkh_authentication 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/README.md +2 -2
- data/lib/generators/tkh_authentication/{install/install_generator.rb → create_migration/create_migration_generator.rb} +2 -9
- data/lib/generators/tkh_authentication/{install → create_migration}/templates/create_users.rb +0 -0
- data/lib/generators/tkh_authentication/{update_locales/update_locales_generator.rb → create_or_update_locales/create_or_update_locales_generator.rb} +3 -5
- data/lib/generators/tkh_authentication/{install/templates/locales → create_or_update_locales/templates}/en.yml +0 -0
- data/lib/generators/tkh_authentication/{install/templates/locales → create_or_update_locales/templates}/es.yml +0 -0
- data/lib/generators/tkh_authentication/{install/templates/locales → create_or_update_locales/templates}/fr.yml +0 -0
- data/lib/tasks/tkh_authentication_tasks.rake +10 -4
- data/lib/tkh_authentication/version.rb +1 -1
- metadata +9 -9
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ And then execute:
|
|
18
18
|
|
19
19
|
Import migration and locale files
|
20
20
|
|
21
|
-
$
|
21
|
+
$ rake tkh_authentication:install
|
22
22
|
|
23
23
|
Run the migration
|
24
24
|
|
@@ -32,7 +32,7 @@ And then of course restart your server!
|
|
32
32
|
|
33
33
|
Upon upgrading to a new version of the gem you might have to update the translation files
|
34
34
|
|
35
|
-
$ rails g tkh_authentication:
|
35
|
+
$ rails g tkh_authentication:create_or_update_locales -f
|
36
36
|
|
37
37
|
|
38
38
|
## Usage
|
@@ -2,7 +2,7 @@ require 'rails/generators/migration'
|
|
2
2
|
|
3
3
|
module TkhAuthentication
|
4
4
|
module Generators
|
5
|
-
class
|
5
|
+
class CreateMigrationGenerator < ::Rails::Generators::Base
|
6
6
|
include Rails::Generators::Migration
|
7
7
|
source_root File.expand_path('../templates', __FILE__)
|
8
8
|
desc "add the migrations and locale files"
|
@@ -17,14 +17,7 @@ module TkhAuthentication
|
|
17
17
|
|
18
18
|
def copy_migrations
|
19
19
|
puts 'creating user migration'
|
20
|
-
migration_template "create_users.rb", "db/migrate/
|
21
|
-
end
|
22
|
-
|
23
|
-
def copy_locales
|
24
|
-
puts 'creating locale files'
|
25
|
-
I18n.available_locales.each do |l|
|
26
|
-
copy_file "locales/#{l.to_s}.yml", "config/locales/tkh_authentication.#{l.to_s}.yml"
|
27
|
-
end
|
20
|
+
migration_template "create_users.rb", "db/migrate/create_users2.rb"
|
28
21
|
end
|
29
22
|
|
30
23
|
end
|
data/lib/generators/tkh_authentication/{install → create_migration}/templates/create_users.rb
RENAMED
File without changes
|
@@ -2,17 +2,15 @@ require 'rails/generators/migration'
|
|
2
2
|
|
3
3
|
module TkhAuthentication
|
4
4
|
module Generators
|
5
|
-
class
|
6
|
-
# WARNING - sharing translations and using the ones from the install generator
|
5
|
+
class CreateOrUpdateLocalesGenerator < ::Rails::Generators::Base
|
7
6
|
source_root File.expand_path('../templates', __FILE__)
|
8
|
-
|
7
|
+
desc "copying latest version of locale files"
|
9
8
|
def copy_locales
|
10
9
|
puts 'creating locale files'
|
11
10
|
I18n.available_locales.each do |l|
|
12
|
-
copy_file "
|
11
|
+
copy_file "#{l.to_s}.yml", "config/locales/tkh_authentication.#{l.to_s}.yml"
|
13
12
|
end
|
14
13
|
end
|
15
|
-
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,4 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
namespace :tkh_authentication do
|
2
|
+
desc "Create migrations and locale files"
|
3
|
+
task :install do
|
4
|
+
system 'rails g tkh_authentication:create_migration'
|
5
|
+
system 'rails g tkh_authentication:create_or_update_locales'
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -112,12 +112,12 @@ files:
|
|
112
112
|
- app/views/users/index.html.erb
|
113
113
|
- app/views/users/new.html.erb
|
114
114
|
- config/routes.rb
|
115
|
-
- lib/generators/tkh_authentication/
|
116
|
-
- lib/generators/tkh_authentication/
|
117
|
-
- lib/generators/tkh_authentication/
|
118
|
-
- lib/generators/tkh_authentication/
|
119
|
-
- lib/generators/tkh_authentication/
|
120
|
-
- lib/generators/tkh_authentication/
|
115
|
+
- lib/generators/tkh_authentication/create_migration/create_migration_generator.rb
|
116
|
+
- lib/generators/tkh_authentication/create_migration/templates/create_users.rb
|
117
|
+
- lib/generators/tkh_authentication/create_or_update_locales/create_or_update_locales_generator.rb
|
118
|
+
- lib/generators/tkh_authentication/create_or_update_locales/templates/en.yml
|
119
|
+
- lib/generators/tkh_authentication/create_or_update_locales/templates/es.yml
|
120
|
+
- lib/generators/tkh_authentication/create_or_update_locales/templates/fr.yml
|
121
121
|
- lib/tasks/tkh_authentication_tasks.rake
|
122
122
|
- lib/tkh_authentication/tkh_authentication_action_controller_extension.rb
|
123
123
|
- lib/tkh_authentication/tkh_authentication_helper.rb
|
@@ -171,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
segments:
|
173
173
|
- 0
|
174
|
-
hash:
|
174
|
+
hash: -4440211809923125949
|
175
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
176
|
none: false
|
177
177
|
requirements:
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
version: '0'
|
181
181
|
segments:
|
182
182
|
- 0
|
183
|
-
hash:
|
183
|
+
hash: -4440211809923125949
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
186
|
rubygems_version: 1.8.23
|