tkh_mailing_list 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/CHANGELOG.md +13 -0
- data/app/controllers/details_controller.rb +10 -0
- data/lib/generators/tkh_mailing_list/create_or_update_locales/create_or_update_locales_generator.rb +16 -0
- data/lib/generators/tkh_mailing_list/create_or_update_locales/templates/de.yml +12 -0
- data/lib/generators/tkh_mailing_list/create_or_update_locales/templates/en.yml +12 -0
- data/lib/generators/tkh_mailing_list/create_or_update_locales/templates/es.yml +12 -0
- data/lib/generators/tkh_mailing_list/create_or_update_locales/templates/fr.yml +12 -0
- data/lib/generators/tkh_mailing_list/create_or_update_locales/templates/it.yml +12 -0
- data/lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb +25 -0
- data/lib/generators/tkh_mailing_list/create_or_update_migrations/templates/add_teacher_status_to_users.rb +6 -0
- data/lib/tasks/tkh_mailing_list_tasks.rake +13 -0
- data/lib/tkh_mailing_list/version.rb +1 -1
- metadata +16 -6
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YzcwMWUzMGYzMjI1MTVhNDk2NjEyNTZhMmJhODc5ZTkzYjMyZjZmOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Zjk4ZjJlMjliM2YwOThmYTY0ZmMyOWUzOWEzNTdlN2M2NWJkMzczYw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YzQ1N2RjZDQzNDBiN2I2NDA0MmJmNTAwMWE0YmUwNjAzZGU0NDBjYmZiM2Yy
|
10
|
+
OTM3MzM3NGI0MDQ1NTVhMmQyMGFjYzQ2MmM1NTAwOTk3YjI1MjYzZWIyZDAx
|
11
|
+
ZDlhMTczNGQ1ZWE4ZGE5ZTZiOTA3ZTVlMmU3OWVmYWUzMTliZTI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Y2U3YjhiYWJjYmE4ZjU1NmI2MDQ4N2I0YjIxOTczYjMyZDNmZDQzODU1ODE2
|
14
|
+
ZGExNzAzZTgwMWE5NjNmOTkzMDBlZTljNThlMzdiNGFjMzcyYjhlMzc5MmQ1
|
15
|
+
NTE4NGNlNjE0Y2Q4MzdlNmM5N2IyYWM0MjFhZDdkOTMyOGVlMDM=
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# TKH Mailing List
|
2
|
+
|
3
|
+
|
4
|
+
## 0.0.2
|
5
|
+
|
6
|
+
* Added a rake task file and an add_teacher_status migration generator.
|
7
|
+
* Added a destroy action to the details controller to enable admin to delete users.
|
8
|
+
* Added generator for locale files.
|
9
|
+
|
10
|
+
|
11
|
+
## 0.0.1
|
12
|
+
|
13
|
+
* Initial release
|
@@ -20,6 +20,7 @@ class DetailsController < ApplicationController
|
|
20
20
|
|
21
21
|
def create
|
22
22
|
@detail = Detail.new(params[:detail])
|
23
|
+
# this is needed or has_secure_password won't validate the saving of a record
|
23
24
|
@detail.password = 'temporary'
|
24
25
|
@detail.password_confirmation = 'temporary'
|
25
26
|
if @detail.save
|
@@ -38,4 +39,13 @@ class DetailsController < ApplicationController
|
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
42
|
+
def destroy
|
43
|
+
@detail = Detail.find(params[:id])
|
44
|
+
if @detail.destroy
|
45
|
+
redirect_to users_path, notice: t('details.destroy.notice')
|
46
|
+
else
|
47
|
+
redirect_to users_path, warning: t('details.destroy.warning')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
41
51
|
end
|
data/lib/generators/tkh_mailing_list/create_or_update_locales/create_or_update_locales_generator.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rails/generators/migration'
|
2
|
+
|
3
|
+
module TkhMailingList
|
4
|
+
module Generators
|
5
|
+
class CreateOrUpdateLocalesGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path('../templates', __FILE__)
|
7
|
+
desc "copying latest version of locale files"
|
8
|
+
def copy_locales
|
9
|
+
puts 'creating locale files'
|
10
|
+
I18n.available_locales.each do |l|
|
11
|
+
copy_file "#{l.to_s}.yml", "config/locales/tkh_mailing_list.#{l.to_s}.yml"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
de:
|
2
|
+
|
3
|
+
details:
|
4
|
+
create:
|
5
|
+
notice: 'This user has been created.'
|
6
|
+
warning: 'A problem occurred while creating this user.'
|
7
|
+
update:
|
8
|
+
notice: 'This user has been updated.'
|
9
|
+
warning: "A problem occurred while updating this user's record."
|
10
|
+
destroy:
|
11
|
+
notice: 'This user has been deleted.'
|
12
|
+
warning: 'A problem occurred while deleting this user.'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
en:
|
2
|
+
|
3
|
+
details:
|
4
|
+
create:
|
5
|
+
notice: 'This user has been created.'
|
6
|
+
warning: 'A problem occurred while creating this user.'
|
7
|
+
update:
|
8
|
+
notice: 'This user has been updated.'
|
9
|
+
warning: "A problem occurred while updating this user's record."
|
10
|
+
destroy:
|
11
|
+
notice: 'This user has been deleted.'
|
12
|
+
warning: 'A problem occurred while deleting this user.'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
es:
|
2
|
+
|
3
|
+
details:
|
4
|
+
create:
|
5
|
+
notice: 'This user has been created.'
|
6
|
+
warning: 'A problem occurred while creating this user.'
|
7
|
+
update:
|
8
|
+
notice: 'This user has been updated.'
|
9
|
+
warning: "A problem occurred while updating this user's record."
|
10
|
+
destroy:
|
11
|
+
notice: 'This user has been deleted.'
|
12
|
+
warning: 'A problem occurred while deleting this user.'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
fr:
|
2
|
+
|
3
|
+
details:
|
4
|
+
create:
|
5
|
+
notice: 'Un nouvel utilisateur a été ajouté à la base de données.'
|
6
|
+
warning: "Il y a eu un problème qui n'a pas permis d'ajouter cet utilisateur"
|
7
|
+
update:
|
8
|
+
notice: 'Les données de cet utilisateur ont été modifiées'
|
9
|
+
warning: "Il y a eu un problème qui n'a pas permis de modifier les données de cet utilisateur"
|
10
|
+
destroy:
|
11
|
+
notice: "Cet utilisateur n'est plus dans la base de données."
|
12
|
+
warning: "Il y a eu un problème qui n'a pas permis d'éléliminer cet utilisateur"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
it:
|
2
|
+
|
3
|
+
details:
|
4
|
+
create:
|
5
|
+
notice: 'This user has been created.'
|
6
|
+
warning: 'A problem occurred while creating this user.'
|
7
|
+
update:
|
8
|
+
notice: 'This user has been updated.'
|
9
|
+
warning: "A problem occurred while updating this user's record."
|
10
|
+
destroy:
|
11
|
+
notice: 'This user has been deleted.'
|
12
|
+
warning: 'A problem occurred while deleting this user.'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rails/generaTors/migration'
|
2
|
+
|
3
|
+
module TkhMailingList
|
4
|
+
module Generators
|
5
|
+
class CreateOrUpdateMigrationsGenerator < ::Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
desc "add the migrations and locale files"
|
9
|
+
def self.next_migration_number(path)
|
10
|
+
unless @prev_migration_nr
|
11
|
+
@prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
|
12
|
+
else
|
13
|
+
@prev_migration_nr += 1
|
14
|
+
end
|
15
|
+
@prev_migration_nr.to_s
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_migrations
|
19
|
+
puts 'creating user migration'
|
20
|
+
migration_template "add_teacher_status_to_users.rb", "db/migrate/add_teacher_status_to_users.rb"
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
namespace :tkh_mailing_list do
|
2
|
+
desc "Create migrations and locale files"
|
3
|
+
task :install do
|
4
|
+
system 'rails g tkh_mailing_list:create_or_update_migrations'
|
5
|
+
system 'rails g tkh_mailing_list:create_or_update_locales -f'
|
6
|
+
end
|
7
|
+
|
8
|
+
desc "Update files. Skip existing migrations. Force overwrite locales"
|
9
|
+
task :update do
|
10
|
+
system 'rails g tkh_mailing_list:create_or_update_migrations -s'
|
11
|
+
system 'rails g tkh_mailing_list:create_or_update_locales -f'
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_mailing_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swami Atma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
|
+
- CHANGELOG.md
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|
@@ -72,6 +73,15 @@ files:
|
|
72
73
|
- app/views/details/new.html.erb
|
73
74
|
- app/views/details/show.html.erb
|
74
75
|
- config/routes.rb
|
76
|
+
- lib/generators/tkh_mailing_list/create_or_update_locales/create_or_update_locales_generator.rb
|
77
|
+
- lib/generators/tkh_mailing_list/create_or_update_locales/templates/de.yml
|
78
|
+
- lib/generators/tkh_mailing_list/create_or_update_locales/templates/en.yml
|
79
|
+
- lib/generators/tkh_mailing_list/create_or_update_locales/templates/es.yml
|
80
|
+
- lib/generators/tkh_mailing_list/create_or_update_locales/templates/fr.yml
|
81
|
+
- lib/generators/tkh_mailing_list/create_or_update_locales/templates/it.yml
|
82
|
+
- lib/generators/tkh_mailing_list/create_or_update_migrations/create_or_update_migrations_generator.rb
|
83
|
+
- lib/generators/tkh_mailing_list/create_or_update_migrations/templates/add_teacher_status_to_users.rb
|
84
|
+
- lib/tasks/tkh_mailing_list_tasks.rake
|
75
85
|
- lib/tkh_mailing_list.rb
|
76
86
|
- lib/tkh_mailing_list/version.rb
|
77
87
|
- tkh_mailing_list.gemspec
|
@@ -85,12 +95,12 @@ require_paths:
|
|
85
95
|
- lib
|
86
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
87
97
|
requirements:
|
88
|
-
- - '>='
|
98
|
+
- - ! '>='
|
89
99
|
- !ruby/object:Gem::Version
|
90
100
|
version: '0'
|
91
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
102
|
requirements:
|
93
|
-
- - '>='
|
103
|
+
- - ! '>='
|
94
104
|
- !ruby/object:Gem::Version
|
95
105
|
version: '0'
|
96
106
|
requirements: []
|