gettext_simple_rails 0.0.17 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gettext_simple_rails/translators/active_record_validations_translator.rb +37 -15
- data/lib/gettext_simple_rails/version.rb +1 -1
- data/spec/active_record_validations_spec.rb +4 -3
- data/spec/dummy/app/models/user.rb +3 -3
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20140816124855_add_email_to_users.rb +6 -0
- data/spec/dummy/db/schema.rb +4 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb +18 -16
- data/spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb +2 -0
- data/spec/dummy/log/development.log +28 -0
- data/spec/dummy/log/test.log +171 -0
- data/spec/factories/role.rb +6 -0
- data/spec/factories/user.rb +6 -0
- data/spec/models/user_spec.rb +13 -0
- data/spec/spec_helper.rb +3 -2
- metadata +170 -130
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09e4c971a0fcd00b1e4cd229fccf759dcd07f59c
|
4
|
+
data.tar.gz: 6a94d3c4de1cf7782fc9346de181466a069385aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52364b9bec0b896ee10d95fa16d4385060aa365eb7b6268de751b4ee2741e1425b1017fe8dae2afad96235b54f2e7c9bbe404d21b9003993fffb68ff4a7e2f51
|
7
|
+
data.tar.gz: ab1a389efa6e4c67272fb5c368c081293959892ea98fe03f03ae38f56af6b3deabd63d3d3bd33c7d898b019a9e598bfcdda52879495bbbd8e05e204036552180
|
@@ -2,7 +2,7 @@ class GettextSimpleRails::Translators::ActiveRecordValidationsTranslator
|
|
2
2
|
def detected?
|
3
3
|
::Kernel.const_defined?("ActiveRecord")
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
def translations
|
7
7
|
@translations_hash = {
|
8
8
|
"activerecord" => {
|
@@ -14,27 +14,28 @@ class GettextSimpleRails::Translators::ActiveRecordValidationsTranslator
|
|
14
14
|
}
|
15
15
|
}
|
16
16
|
}
|
17
|
-
|
17
|
+
|
18
18
|
scan_validation_errors
|
19
|
-
|
19
|
+
scan_relation_errors
|
20
|
+
|
20
21
|
return @translations_hash
|
21
22
|
end
|
22
|
-
|
23
|
+
|
23
24
|
private
|
24
|
-
|
25
|
+
|
25
26
|
def scan_validation_errors
|
26
27
|
GettextSimpleRails::ModelInspector.model_classes do |inspector|
|
27
28
|
clazz_snake_name = StringCases.camel_to_snake(inspector.clazz.name)
|
28
29
|
@translations_hash["activerecord"]["errors"]["models"][clazz_snake_name] = {"attributes" => {}} unless @translations_hash["activerecord"]["errors"]["models"].key?(clazz_snake_name)
|
29
30
|
attributes_hash = @translations_hash["activerecord"]["errors"]["models"][clazz_snake_name]["attributes"]
|
30
|
-
|
31
|
+
|
31
32
|
inspector.clazz._validators.each do |attribute_name, validators|
|
32
33
|
attribute_name = attribute_name.to_s
|
33
|
-
|
34
|
+
|
34
35
|
validators.each do |validator|
|
35
36
|
attributes_hash[attribute_name] = {} unless attributes_hash.key?(attribute_name)
|
36
37
|
attribute_hash = attributes_hash[attribute_name]
|
37
|
-
|
38
|
+
|
38
39
|
translations_for_length_validator(validator, attribute_hash) if validator.is_a?(ActiveModel::Validations::LengthValidator)
|
39
40
|
translations_for_format_validator(validator, attribute_hash) if validator.is_a?(ActiveModel::Validations::FormatValidator)
|
40
41
|
translations_for_uniqueness_validator(validator, attribute_hash) if validator.is_a?(ActiveRecord::Validations::UniquenessValidator)
|
@@ -44,33 +45,54 @@ private
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
47
|
-
|
48
|
+
|
49
|
+
def scan_relation_errors
|
50
|
+
GettextSimpleRails::ModelInspector.model_classes do |inspector|
|
51
|
+
clazz_snake_name = StringCases.camel_to_snake(inspector.clazz.name)
|
52
|
+
@translations_hash["activerecord"]["errors"]["models"][clazz_snake_name] = {"attributes" => {}} unless @translations_hash["activerecord"]["errors"]["models"].key?(clazz_snake_name)
|
53
|
+
attributes_hash = @translations_hash["activerecord"]["errors"]["models"][clazz_snake_name]["attributes"]
|
54
|
+
base_hash = attributes_hash["base"] ||= {}
|
55
|
+
|
56
|
+
inspector.relationships do |name, reflection|
|
57
|
+
if reflection.options[:dependent] == :restrict_with_error || reflection.options[:dependent] == :restrict_with_exception
|
58
|
+
base_hash["restrict_dependent_destroy"] ||= {}
|
59
|
+
|
60
|
+
if reflection.macro == :has_many
|
61
|
+
base_hash["restrict_dependent_destroy"]["many"] ||= "Cannot delete record because dependent %{record} exist"
|
62
|
+
elsif reflection.macro == :has_one
|
63
|
+
base_hash["restrict_dependent_destroy"]["one"] ||= "Cannot delete record because a dependent %{record} exists"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
48
70
|
def translations_for_length_validator(validator, attribute_hash)
|
49
71
|
if validator.options[:minimum].present?
|
50
72
|
attribute_hash["too_short"] = "is too short. The minimum is %{count}"
|
51
73
|
end
|
52
|
-
|
74
|
+
|
53
75
|
if validator.options[:maximum].present?
|
54
76
|
attribute_hash["too_long"] = "is too long. The maximum is %{count}"
|
55
77
|
end
|
56
|
-
|
78
|
+
|
57
79
|
if validator.options[:is].present?
|
58
80
|
attribute_hash["wrong_length"] = "is not the correct length: %{count}"
|
59
81
|
end
|
60
82
|
end
|
61
|
-
|
83
|
+
|
62
84
|
def translations_for_format_validator(validator, attribute_hash)
|
63
85
|
attribute_hash["invalid"] = "is invalid"
|
64
86
|
end
|
65
|
-
|
87
|
+
|
66
88
|
def translations_for_uniqueness_validator(validator, attribute_hash)
|
67
89
|
attribute_hash["taken"] = "has already been taken"
|
68
90
|
end
|
69
|
-
|
91
|
+
|
70
92
|
def translations_for_presence_validator(validator, attribute_hash)
|
71
93
|
attribute_hash["blank"] = "cannot be blank"
|
72
94
|
end
|
73
|
-
|
95
|
+
|
74
96
|
def translations_for_email_validator(validator, attribute_hash)
|
75
97
|
attribute_hash["invalid"] = "is invalid"
|
76
98
|
end
|
@@ -4,14 +4,14 @@ describe GettextSimpleRails::Translators::ActiveRecordValidationsTranslator do
|
|
4
4
|
before do
|
5
5
|
# Make it possible to call the Rake task.
|
6
6
|
::Dummy::Application.load_tasks
|
7
|
-
|
7
|
+
|
8
8
|
# Clean up any existing translations.
|
9
9
|
FileUtils.rm_r(GettextSimpleRails.translation_dir) if File.exists?(GettextSimpleRails.translation_dir)
|
10
|
-
|
10
|
+
|
11
11
|
# Generate model translations so we can check them.
|
12
12
|
::Rake::Task["gettext_simple_rails:generate_translator_files"].execute
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it "should generate translations for validations" do
|
16
16
|
filepath = "#{GettextSimpleRails.translation_dir}/active_record_validations_translator_translations.rb"
|
17
17
|
cont = File.read(filepath)
|
@@ -21,5 +21,6 @@ describe GettextSimpleRails::Translators::ActiveRecordValidationsTranslator do
|
|
21
21
|
cont.should include "_('activerecord.errors.models.user.attributes.name.taken')"
|
22
22
|
cont.should include "_('activerecord.errors.models.user.attributes.name.invalid')"
|
23
23
|
cont.should include "_('activerecord.errors.models.user.attributes.email.invalid')"
|
24
|
+
cont.should include "_('activerecord.errors.models.user.attributes.base.restrict_dependent_destroy.many')"
|
24
25
|
end
|
25
26
|
end
|
@@ -2,9 +2,9 @@ require "email_validator"
|
|
2
2
|
|
3
3
|
class User < ActiveRecord::Base
|
4
4
|
translates :title
|
5
|
-
|
6
|
-
has_many :roles
|
7
|
-
|
5
|
+
|
6
|
+
has_many :roles, dependent: :restrict_with_error
|
7
|
+
|
8
8
|
validates :name, :length => {:in => 2..255}
|
9
9
|
validates :name, :uniqueness => true, :presence => true
|
10
10
|
validates :name, :format => {:with => /\A[A-z]+\Z/}
|
Binary file
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20140816124855) do
|
15
15
|
|
16
16
|
create_table "roles", force: true do |t|
|
17
17
|
t.string "role"
|
@@ -37,6 +37,9 @@ ActiveRecord::Schema.define(version: 20140515092420) do
|
|
37
37
|
t.integer "age"
|
38
38
|
t.datetime "created_at"
|
39
39
|
t.datetime "updated_at"
|
40
|
+
t.string "email"
|
40
41
|
end
|
41
42
|
|
43
|
+
add_index "users", ["email"], name: "index_users_on_email"
|
44
|
+
|
42
45
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
CHANGED
@@ -1,17 +1,5 @@
|
|
1
1
|
class GettextSimpleRails::MonthNames
|
2
2
|
def translations
|
3
|
-
#. Default value: id
|
4
|
-
_('activerecord.attributes.role.id')
|
5
|
-
#. Default value: role
|
6
|
-
_('activerecord.attributes.role.role')
|
7
|
-
#. Default value: user_id
|
8
|
-
_('activerecord.attributes.role.user_id')
|
9
|
-
#. Default value: created_at
|
10
|
-
_('activerecord.attributes.role.created_at')
|
11
|
-
#. Default value: updated_at
|
12
|
-
_('activerecord.attributes.role.updated_at')
|
13
|
-
#. Default value: user
|
14
|
-
_('activerecord.attributes.role.user')
|
15
3
|
#. Default value: id
|
16
4
|
_('activerecord.attributes.user.id')
|
17
5
|
#. Default value: name
|
@@ -24,17 +12,31 @@ class GettextSimpleRails::MonthNames
|
|
24
12
|
_('activerecord.attributes.user.created_at')
|
25
13
|
#. Default value: updated_at
|
26
14
|
_('activerecord.attributes.user.updated_at')
|
15
|
+
#. Default value: email
|
16
|
+
_('activerecord.attributes.user.email')
|
27
17
|
#. Default value: translations
|
28
18
|
_('activerecord.attributes.user.translations')
|
29
19
|
#. Default value: roles
|
30
20
|
_('activerecord.attributes.user.roles')
|
31
|
-
#. Default value:
|
32
|
-
_('activerecord.
|
33
|
-
#. Default value:
|
34
|
-
_('activerecord.
|
21
|
+
#. Default value: id
|
22
|
+
_('activerecord.attributes.role.id')
|
23
|
+
#. Default value: role
|
24
|
+
_('activerecord.attributes.role.role')
|
25
|
+
#. Default value: user_id
|
26
|
+
_('activerecord.attributes.role.user_id')
|
27
|
+
#. Default value: created_at
|
28
|
+
_('activerecord.attributes.role.created_at')
|
29
|
+
#. Default value: updated_at
|
30
|
+
_('activerecord.attributes.role.updated_at')
|
31
|
+
#. Default value: user
|
32
|
+
_('activerecord.attributes.role.user')
|
35
33
|
#. Default value: User
|
36
34
|
_('activerecord.models.user.one')
|
37
35
|
#. Default value: User
|
38
36
|
_('activerecord.models.user.other')
|
37
|
+
#. Default value: Role
|
38
|
+
_('activerecord.models.role.one')
|
39
|
+
#. Default value: Role
|
40
|
+
_('activerecord.models.role.other')
|
39
41
|
end
|
40
42
|
end
|
data/spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb
CHANGED
@@ -14,5 +14,7 @@ class GettextSimpleRails::MonthNames
|
|
14
14
|
_('activerecord.errors.models.user.attributes.name.invalid')
|
15
15
|
#. Default value: is invalid
|
16
16
|
_('activerecord.errors.models.user.attributes.email.invalid')
|
17
|
+
#. Default value: Cannot delete record because dependent %{record} exist
|
18
|
+
_('activerecord.errors.models.user.attributes.base.restrict_dependent_destroy.many')
|
17
19
|
end
|
18
20
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
[1m[36m (27.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
|
+
[1m[35m (24.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4
|
+
Migrating to CreateUsers (20140410170418)
|
5
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "birthday_at" date, "age" integer, "created_at" datetime, "updated_at" datetime) [0m
|
7
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140410170418"]]
|
8
|
+
[1m[36m (25.5ms)[0m [1mcommit transaction[0m
|
9
|
+
Migrating to CreateRoles (20140411112622)
|
10
|
+
[1m[35m (0.1ms)[0m begin transaction
|
11
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "role" varchar(255), "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
12
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140411112622"]]
|
13
|
+
[1m[36m (23.7ms)[0m [1mcommit transaction[0m
|
14
|
+
Migrating to CreateUserTranslations (20140515092420)
|
15
|
+
[1m[35m (0.1ms)[0m begin transaction
|
16
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "user_translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer NOT NULL, "locale" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime) [0m
|
17
|
+
[1m[35m (0.2ms)[0m ALTER TABLE "user_translations" ADD "title" varchar(255)
|
18
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_user_translations_on_user_id" ON "user_translations" ("user_id")[0m
|
19
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_user_translations_on_locale" ON "user_translations" ("locale")
|
20
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20140515092420"]]
|
21
|
+
[1m[35m (21.7ms)[0m commit transaction
|
22
|
+
Migrating to AddEmailToUsers (20140816124855)
|
23
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
24
|
+
[1m[35m (0.3ms)[0m ALTER TABLE "users" ADD "email" varchar(255)
|
25
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_users_on_email" ON "users" ("email")[0m
|
26
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140816124855"]]
|
27
|
+
[1m[36m (27.2ms)[0m [1mcommit transaction[0m
|
28
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
data/spec/dummy/log/test.log
CHANGED
@@ -1043,3 +1043,174 @@ Migrating to CreateUserTranslations (20140515092420)
|
|
1043
1043
|
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1044
1044
|
[1m[35m (0.0ms)[0m begin transaction
|
1045
1045
|
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1046
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1047
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1048
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1049
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1050
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1051
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1052
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1053
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1054
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
1055
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1056
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1057
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1058
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1059
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1060
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1061
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1062
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1063
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1064
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1065
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1066
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1067
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1068
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1069
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1070
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1071
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1072
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1073
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1074
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1075
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1076
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1077
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1078
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1079
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1080
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1081
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1082
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1083
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1084
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1085
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1086
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1087
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1088
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1089
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1090
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1091
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1092
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1093
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1094
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1095
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1096
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1097
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1098
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1099
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1100
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1101
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1102
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1103
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1104
|
+
Migrating to AddEmailToUsers (20140816124855)
|
1105
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1106
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "users" ADD "email" varchar(255)[0m
|
1107
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_users_on_email" ON "users" ("email")
|
1108
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20140816124855"]]
|
1109
|
+
[1m[35m (22.8ms)[0m commit transaction
|
1110
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1111
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1112
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1113
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1114
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."name" = 'Eugene Anderson' LIMIT 1
|
1115
|
+
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
1116
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1117
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1118
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1119
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1120
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."name" = 'Shirley Mason' LIMIT 1
|
1121
|
+
[1m[36mSQL (2.1ms)[0m [1mINSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Sat, 16 Aug 2014 12:49:52 UTC +00:00], ["email", "jbishop@eire.info"], ["name", "Shirley Mason"], ["updated_at", Sat, 16 Aug 2014 12:49:52 UTC +00:00]]
|
1122
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1123
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1124
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "roles" ("created_at", "role", "updated_at", "user_id") VALUES (?, ?, ?, ?) [["created_at", Sat, 16 Aug 2014 12:49:52 UTC +00:00], ["role", "administrator"], ["updated_at", Sat, 16 Aug 2014 12:49:52 UTC +00:00], ["user_id", 1]]
|
1125
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1126
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1127
|
+
[1m[36mRole Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "roles" WHERE "roles"."user_id" = ? LIMIT 1[0m [["user_id", 1]]
|
1128
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
1129
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1130
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1131
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1132
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1133
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."name" = 'Frances' LIMIT 1
|
1134
|
+
[1m[36mSQL (1.6ms)[0m [1mINSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Sat, 16 Aug 2014 12:50:01 UTC +00:00], ["email", "ahenderson@buzzbean.com"], ["name", "Frances"], ["updated_at", Sat, 16 Aug 2014 12:50:01 UTC +00:00]]
|
1135
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1136
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1137
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "roles" ("created_at", "role", "updated_at", "user_id") VALUES (?, ?, ?, ?) [["created_at", Sat, 16 Aug 2014 12:50:01 UTC +00:00], ["role", "administrator"], ["updated_at", Sat, 16 Aug 2014 12:50:01 UTC +00:00], ["user_id", 1]]
|
1138
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1139
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1140
|
+
[1m[36mRole Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "roles" WHERE "roles"."user_id" = ? LIMIT 1[0m [["user_id", 1]]
|
1141
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
1142
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1143
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1144
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1145
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1146
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."name" = 'Lori' LIMIT 1
|
1147
|
+
[1m[36mSQL (1.6ms)[0m [1mINSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Sat, 16 Aug 2014 12:50:18 UTC +00:00], ["email", "rstewart@linkbridge.org"], ["name", "Lori"], ["updated_at", Sat, 16 Aug 2014 12:50:18 UTC +00:00]]
|
1148
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1149
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1150
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "roles" ("created_at", "role", "updated_at", "user_id") VALUES (?, ?, ?, ?) [["created_at", Sat, 16 Aug 2014 12:50:18 UTC +00:00], ["role", "administrator"], ["updated_at", Sat, 16 Aug 2014 12:50:18 UTC +00:00], ["user_id", 1]]
|
1151
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1152
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1153
|
+
[1m[36mRole Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "roles" WHERE "roles"."user_id" = ? LIMIT 1[0m [["user_id", 1]]
|
1154
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
1155
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1156
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1157
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1158
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1159
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."name" = 'Jennifer' LIMIT 1
|
1160
|
+
[1m[36mSQL (1.7ms)[0m [1mINSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Sat, 16 Aug 2014 12:50:28 UTC +00:00], ["email", "kperez@wikibox.edu"], ["name", "Jennifer"], ["updated_at", Sat, 16 Aug 2014 12:50:28 UTC +00:00]]
|
1161
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1162
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1163
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "roles" ("created_at", "role", "updated_at", "user_id") VALUES (?, ?, ?, ?) [["created_at", Sat, 16 Aug 2014 12:50:28 UTC +00:00], ["role", "administrator"], ["updated_at", Sat, 16 Aug 2014 12:50:28 UTC +00:00], ["user_id", 1]]
|
1164
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1165
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1166
|
+
[1m[36mRole Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "roles" WHERE "roles"."user_id" = ? LIMIT 1[0m [["user_id", 1]]
|
1167
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
1168
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1169
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1170
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1171
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1172
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1173
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1174
|
+
[1m[35mUser Exists (0.1ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."name" = 'Jean' LIMIT 1
|
1175
|
+
[1m[36mSQL (1.8ms)[0m [1mINSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Sat, 16 Aug 2014 12:51:13 UTC +00:00], ["email", "lbailey@skiptube.info"], ["name", "Jean"], ["updated_at", Sat, 16 Aug 2014 12:51:13 UTC +00:00]]
|
1176
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1177
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1178
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "roles" ("created_at", "role", "updated_at", "user_id") VALUES (?, ?, ?, ?) [["created_at", Sat, 16 Aug 2014 12:51:13 UTC +00:00], ["role", "administrator"], ["updated_at", Sat, 16 Aug 2014 12:51:13 UTC +00:00], ["user_id", 1]]
|
1179
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1180
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1181
|
+
[1m[36mRole Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "roles" WHERE "roles"."user_id" = ? LIMIT 1[0m [["user_id", 1]]
|
1182
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
1183
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1184
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1185
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1186
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1187
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1188
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1189
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1190
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1191
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1192
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1193
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1194
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1195
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1196
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1197
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
1198
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1199
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1200
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1201
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1202
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1203
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1204
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1205
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1206
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1207
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1208
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1209
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1210
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1211
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1212
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1213
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1214
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
1215
|
+
[1m[35m (0.3ms)[0m begin transaction
|
1216
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe User do
|
4
|
+
let!(:user){ create :user }
|
5
|
+
let(:role){ create :role, user: user }
|
6
|
+
|
7
|
+
it "#destroy" do
|
8
|
+
role
|
9
|
+
user.destroy
|
10
|
+
user.errors.any?.should eq true
|
11
|
+
user.errors[:base].should eq ["Cannot delete record because dependent roles exist"]
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,6 +4,8 @@ require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
|
4
4
|
require 'rspec/rails'
|
5
5
|
require 'rspec/autorun'
|
6
6
|
require "rails/test_help"
|
7
|
+
require 'factory_girl_rails'
|
8
|
+
require 'forgery'
|
7
9
|
|
8
10
|
Rails.backtrace_cleaner.remove_silencers!
|
9
11
|
|
@@ -24,8 +26,7 @@ RSpec.configure do |config|
|
|
24
26
|
# config.mock_with :flexmock
|
25
27
|
# config.mock_with :rr
|
26
28
|
|
27
|
-
|
28
|
-
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
29
|
+
config.include FactoryGirl::Syntax::Methods
|
29
30
|
|
30
31
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
31
32
|
# examples within a transaction, remove the following line or assign false
|
metadata
CHANGED
@@ -1,111 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gettext_simple_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0.
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0.
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gettext_simple
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.0.9
|
34
34
|
type: :runtime
|
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.0.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: string-cases
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sqlite3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: email_validator
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: forgery
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: factory_girl_rails
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
95
123
|
- !ruby/object:Gem::Version
|
96
124
|
version: '0'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
126
|
name: globalize
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
100
128
|
requirements:
|
101
|
-
- - ~>
|
129
|
+
- - "~>"
|
102
130
|
- !ruby/object:Gem::Version
|
103
131
|
version: 4.0.1
|
104
132
|
type: :development
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
|
-
- - ~>
|
136
|
+
- - "~>"
|
109
137
|
- !ruby/object:Gem::Version
|
110
138
|
version: 4.0.1
|
111
139
|
description: Inspects models and other modules to easily generate .po-files and translate
|
@@ -116,95 +144,101 @@ executables: []
|
|
116
144
|
extensions: []
|
117
145
|
extra_rdoc_files: []
|
118
146
|
files:
|
119
|
-
-
|
147
|
+
- MIT-LICENSE
|
148
|
+
- Rakefile
|
120
149
|
- app/assets/javascripts/gettext_simple_rails/application.js
|
121
|
-
- app/
|
150
|
+
- app/assets/stylesheets/gettext_simple_rails/application.css
|
122
151
|
- app/controllers/gettext_simple_rails/application_controller.rb
|
152
|
+
- app/helpers/gettext_simple_rails/application_helper.rb
|
123
153
|
- app/views/layouts/gettext_simple_rails/application.html.erb
|
154
|
+
- config/default.po
|
124
155
|
- config/poedit_ruby_parser.conf
|
125
156
|
- config/routes.rb
|
126
|
-
- config/default.po
|
127
157
|
- lib/gettext_simple_rails.rb
|
128
|
-
- lib/
|
158
|
+
- lib/gettext_simple_rails/cache_handler.rb
|
159
|
+
- lib/gettext_simple_rails/engine.rb
|
160
|
+
- lib/gettext_simple_rails/i18n_injector.rb
|
161
|
+
- lib/gettext_simple_rails/model_inspector.rb
|
162
|
+
- lib/gettext_simple_rails/setup_helper.rb
|
163
|
+
- lib/gettext_simple_rails/translators/active_admin_translator.rb
|
129
164
|
- lib/gettext_simple_rails/translators/active_record_attributes_translator.rb
|
130
165
|
- lib/gettext_simple_rails/translators/active_record_validations_translator.rb
|
131
|
-
- lib/gettext_simple_rails/translators/number_translator.rb
|
132
|
-
- lib/gettext_simple_rails/translators/simple_form_translator.rb
|
133
166
|
- lib/gettext_simple_rails/translators/date_translator.rb
|
134
|
-
- lib/gettext_simple_rails/translators/globalize_translator.rb
|
135
167
|
- lib/gettext_simple_rails/translators/devise_translator.rb
|
136
|
-
- lib/gettext_simple_rails/translators/
|
137
|
-
- lib/gettext_simple_rails/
|
138
|
-
- lib/gettext_simple_rails/
|
139
|
-
- lib/gettext_simple_rails/setup_helper.rb
|
140
|
-
- lib/gettext_simple_rails/i18n_injector.rb
|
168
|
+
- lib/gettext_simple_rails/translators/globalize_translator.rb
|
169
|
+
- lib/gettext_simple_rails/translators/number_translator.rb
|
170
|
+
- lib/gettext_simple_rails/translators/simple_form_translator.rb
|
141
171
|
- lib/gettext_simple_rails/version.rb
|
142
|
-
- lib/
|
143
|
-
- MIT-LICENSE
|
144
|
-
- Rakefile
|
145
|
-
- spec/poedit_config_with_ruby.conf
|
146
|
-
- spec/poedit_config_without_ruby.conf
|
147
|
-
- spec/spec_helper.rb
|
148
|
-
- spec/date_translator_spec.rb
|
172
|
+
- lib/tasks/gettext_simple_rails_tasks.rake
|
149
173
|
- spec/active_record_validations_spec.rb
|
150
174
|
- spec/cache_handler_spec.rb
|
151
|
-
- spec/
|
152
|
-
- spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb
|
153
|
-
- spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb
|
154
|
-
- spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb
|
155
|
-
- spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
|
156
|
-
- spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb
|
157
|
-
- spec/dummy/log/test.log
|
175
|
+
- spec/date_translator_spec.rb
|
158
176
|
- spec/dummy/README.rdoc
|
159
|
-
- spec/dummy/
|
160
|
-
- spec/dummy/
|
161
|
-
- spec/dummy/
|
162
|
-
- spec/dummy/
|
163
|
-
- spec/dummy/
|
164
|
-
- spec/dummy/
|
165
|
-
- spec/dummy/
|
166
|
-
- spec/dummy/
|
177
|
+
- spec/dummy/Rakefile
|
178
|
+
- spec/dummy/app/assets/javascripts/application.js
|
179
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
180
|
+
- spec/dummy/app/controllers/application_controller.rb
|
181
|
+
- spec/dummy/app/helpers/application_helper.rb
|
182
|
+
- spec/dummy/app/models/role.rb
|
183
|
+
- spec/dummy/app/models/user.rb
|
184
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
185
|
+
- spec/dummy/bin/bundle
|
186
|
+
- spec/dummy/bin/rails
|
187
|
+
- spec/dummy/bin/rake
|
188
|
+
- spec/dummy/config.ru
|
189
|
+
- spec/dummy/config/application.rb
|
167
190
|
- spec/dummy/config/boot.rb
|
168
|
-
- spec/dummy/config/secrets.yml
|
169
|
-
- spec/dummy/config/environments/test.rb
|
170
|
-
- spec/dummy/config/environments/production.rb
|
171
|
-
- spec/dummy/config/environments/development.rb
|
172
191
|
- spec/dummy/config/database.yml
|
173
|
-
- spec/dummy/config/
|
192
|
+
- spec/dummy/config/environment.rb
|
193
|
+
- spec/dummy/config/environments/development.rb
|
194
|
+
- spec/dummy/config/environments/production.rb
|
195
|
+
- spec/dummy/config/environments/test.rb
|
196
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
174
197
|
- spec/dummy/config/initializers/cookies_serializer.rb
|
175
|
-
- spec/dummy/config/initializers/
|
176
|
-
- spec/dummy/config/initializers/mime_types.rb
|
198
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
177
199
|
- spec/dummy/config/initializers/inflections.rb
|
178
|
-
- spec/dummy/config/initializers/
|
200
|
+
- spec/dummy/config/initializers/mime_types.rb
|
179
201
|
- spec/dummy/config/initializers/session_store.rb
|
180
|
-
- spec/dummy/config/
|
181
|
-
- spec/dummy/config/locales/en.yml
|
202
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
182
203
|
- spec/dummy/config/locales/da.yml
|
183
|
-
- spec/dummy/config/
|
184
|
-
- spec/dummy/config/locales_gettext/static_translation_file.json
|
204
|
+
- spec/dummy/config/locales/en.yml
|
185
205
|
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.mo
|
186
206
|
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.po
|
187
207
|
- spec/dummy/config/locales_gettext/en/LC_MESSAGES/default.po
|
208
|
+
- spec/dummy/config/locales_gettext/static_translation_file.json
|
188
209
|
- spec/dummy/config/routes.rb
|
189
|
-
- spec/dummy/
|
190
|
-
- spec/dummy/
|
191
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
192
|
-
- spec/dummy/app/assets/javascripts/application.js
|
193
|
-
- spec/dummy/app/helpers/application_helper.rb
|
194
|
-
- spec/dummy/app/controllers/application_controller.rb
|
195
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
210
|
+
- spec/dummy/config/secrets.yml
|
211
|
+
- spec/dummy/db/development.sqlite3
|
196
212
|
- spec/dummy/db/migrate/20140410170418_create_users.rb
|
197
|
-
- spec/dummy/db/migrate/20140515092420_create_user_translations.rb
|
198
213
|
- spec/dummy/db/migrate/20140411112622_create_roles.rb
|
199
|
-
- spec/dummy/db/
|
214
|
+
- spec/dummy/db/migrate/20140515092420_create_user_translations.rb
|
215
|
+
- spec/dummy/db/migrate/20140816124855_add_email_to_users.rb
|
200
216
|
- spec/dummy/db/schema.rb
|
201
|
-
- spec/dummy/
|
202
|
-
- spec/dummy/
|
203
|
-
- spec/dummy/
|
204
|
-
- spec/dummy/
|
217
|
+
- spec/dummy/db/test.sqlite3
|
218
|
+
- spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
|
219
|
+
- spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb
|
220
|
+
- spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb
|
221
|
+
- spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb
|
222
|
+
- spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb
|
223
|
+
- spec/dummy/log/development.log
|
224
|
+
- spec/dummy/log/test.log
|
225
|
+
- spec/dummy/public/404.html
|
226
|
+
- spec/dummy/public/422.html
|
227
|
+
- spec/dummy/public/500.html
|
228
|
+
- spec/dummy/public/favicon.ico
|
229
|
+
- spec/dummy/test/fixtures/roles.yml
|
230
|
+
- spec/dummy/test/fixtures/users.yml
|
231
|
+
- spec/dummy/test/models/role_test.rb
|
232
|
+
- spec/dummy/test/models/user_test.rb
|
233
|
+
- spec/factories/role.rb
|
234
|
+
- spec/factories/user.rb
|
235
|
+
- spec/gettext_simple_rails_spec.rb
|
205
236
|
- spec/globalize_translator_spec.rb
|
237
|
+
- spec/models/user_spec.rb
|
238
|
+
- spec/poedit_config_with_ruby.conf
|
239
|
+
- spec/poedit_config_without_ruby.conf
|
206
240
|
- spec/setup_helper_spec.rb
|
207
|
-
- spec/
|
241
|
+
- spec/spec_helper.rb
|
208
242
|
homepage: http://www.github.com/kaspernj/gettext_simple_rails
|
209
243
|
licenses:
|
210
244
|
- MIT
|
@@ -215,81 +249,87 @@ require_paths:
|
|
215
249
|
- lib
|
216
250
|
required_ruby_version: !ruby/object:Gem::Requirement
|
217
251
|
requirements:
|
218
|
-
- -
|
252
|
+
- - ">="
|
219
253
|
- !ruby/object:Gem::Version
|
220
254
|
version: '0'
|
221
255
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
256
|
requirements:
|
223
|
-
- -
|
257
|
+
- - ">="
|
224
258
|
- !ruby/object:Gem::Version
|
225
259
|
version: '0'
|
226
260
|
requirements: []
|
227
261
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.0
|
262
|
+
rubygems_version: 2.4.0
|
229
263
|
signing_key:
|
230
264
|
specification_version: 4
|
231
265
|
summary: Helpers for translating a Rails app with Gettext and POEdit.
|
232
266
|
test_files:
|
233
|
-
- spec/poedit_config_with_ruby.conf
|
234
|
-
- spec/poedit_config_without_ruby.conf
|
235
|
-
- spec/spec_helper.rb
|
236
|
-
- spec/date_translator_spec.rb
|
237
267
|
- spec/active_record_validations_spec.rb
|
238
|
-
- spec/
|
239
|
-
- spec/
|
240
|
-
- spec/
|
268
|
+
- spec/globalize_translator_spec.rb
|
269
|
+
- spec/setup_helper_spec.rb
|
270
|
+
- spec/models/user_spec.rb
|
271
|
+
- spec/factories/role.rb
|
272
|
+
- spec/factories/user.rb
|
273
|
+
- spec/date_translator_spec.rb
|
274
|
+
- spec/dummy/README.rdoc
|
241
275
|
- spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb
|
276
|
+
- spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb
|
277
|
+
- spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb
|
242
278
|
- spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb
|
243
279
|
- spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
|
244
|
-
- spec/dummy/
|
245
|
-
- spec/dummy/
|
246
|
-
- spec/dummy/
|
247
|
-
- spec/dummy/
|
248
|
-
- spec/dummy/
|
249
|
-
- spec/dummy/
|
250
|
-
- spec/dummy/
|
251
|
-
- spec/dummy/test/models/user_test.rb
|
280
|
+
- spec/dummy/app/controllers/application_controller.rb
|
281
|
+
- spec/dummy/app/models/role.rb
|
282
|
+
- spec/dummy/app/models/user.rb
|
283
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
284
|
+
- spec/dummy/app/assets/javascripts/application.js
|
285
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
286
|
+
- spec/dummy/app/helpers/application_helper.rb
|
252
287
|
- spec/dummy/test/models/role_test.rb
|
288
|
+
- spec/dummy/test/models/user_test.rb
|
253
289
|
- spec/dummy/test/fixtures/roles.yml
|
254
290
|
- spec/dummy/test/fixtures/users.yml
|
255
|
-
- spec/dummy/
|
256
|
-
- spec/dummy/
|
257
|
-
- spec/dummy/
|
258
|
-
- spec/dummy/
|
259
|
-
- spec/dummy/
|
260
|
-
- spec/dummy/
|
261
|
-
- spec/dummy/
|
262
|
-
- spec/dummy/
|
291
|
+
- spec/dummy/public/500.html
|
292
|
+
- spec/dummy/public/422.html
|
293
|
+
- spec/dummy/public/404.html
|
294
|
+
- spec/dummy/public/favicon.ico
|
295
|
+
- spec/dummy/log/development.log
|
296
|
+
- spec/dummy/log/test.log
|
297
|
+
- spec/dummy/bin/rake
|
298
|
+
- spec/dummy/bin/rails
|
299
|
+
- spec/dummy/bin/bundle
|
300
|
+
- spec/dummy/db/schema.rb
|
301
|
+
- spec/dummy/db/test.sqlite3
|
302
|
+
- spec/dummy/db/migrate/20140515092420_create_user_translations.rb
|
303
|
+
- spec/dummy/db/migrate/20140816124855_add_email_to_users.rb
|
304
|
+
- spec/dummy/db/migrate/20140411112622_create_roles.rb
|
305
|
+
- spec/dummy/db/migrate/20140410170418_create_users.rb
|
306
|
+
- spec/dummy/db/development.sqlite3
|
307
|
+
- spec/dummy/Rakefile
|
308
|
+
- spec/dummy/config.ru
|
263
309
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
264
|
-
- spec/dummy/config/initializers/
|
310
|
+
- spec/dummy/config/initializers/session_store.rb
|
265
311
|
- spec/dummy/config/initializers/inflections.rb
|
312
|
+
- spec/dummy/config/initializers/mime_types.rb
|
313
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
266
314
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
267
|
-
- spec/dummy/config/initializers/
|
268
|
-
- spec/dummy/config/environment.rb
|
269
|
-
- spec/dummy/config/locales/en.yml
|
270
|
-
- spec/dummy/config/locales/da.yml
|
271
|
-
- spec/dummy/config/application.rb
|
315
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
272
316
|
- spec/dummy/config/locales_gettext/static_translation_file.json
|
273
|
-
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.mo
|
274
|
-
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.po
|
275
317
|
- spec/dummy/config/locales_gettext/en/LC_MESSAGES/default.po
|
318
|
+
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.po
|
319
|
+
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.mo
|
320
|
+
- spec/dummy/config/environments/production.rb
|
321
|
+
- spec/dummy/config/environments/test.rb
|
322
|
+
- spec/dummy/config/environments/development.rb
|
323
|
+
- spec/dummy/config/application.rb
|
324
|
+
- spec/dummy/config/environment.rb
|
325
|
+
- spec/dummy/config/secrets.yml
|
326
|
+
- spec/dummy/config/boot.rb
|
327
|
+
- spec/dummy/config/locales/da.yml
|
328
|
+
- spec/dummy/config/locales/en.yml
|
329
|
+
- spec/dummy/config/database.yml
|
276
330
|
- spec/dummy/config/routes.rb
|
277
|
-
- spec/
|
278
|
-
- spec/
|
279
|
-
- spec/
|
280
|
-
- spec/
|
281
|
-
- spec/dummy/app/helpers/application_helper.rb
|
282
|
-
- spec/dummy/app/controllers/application_controller.rb
|
283
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
284
|
-
- spec/dummy/db/migrate/20140410170418_create_users.rb
|
285
|
-
- spec/dummy/db/migrate/20140515092420_create_user_translations.rb
|
286
|
-
- spec/dummy/db/migrate/20140411112622_create_roles.rb
|
287
|
-
- spec/dummy/db/test.sqlite3
|
288
|
-
- spec/dummy/db/schema.rb
|
289
|
-
- spec/dummy/config.ru
|
290
|
-
- spec/dummy/bin/bundle
|
291
|
-
- spec/dummy/bin/rake
|
292
|
-
- spec/dummy/bin/rails
|
293
|
-
- spec/globalize_translator_spec.rb
|
294
|
-
- spec/setup_helper_spec.rb
|
331
|
+
- spec/poedit_config_with_ruby.conf
|
332
|
+
- spec/cache_handler_spec.rb
|
333
|
+
- spec/spec_helper.rb
|
334
|
+
- spec/poedit_config_without_ruby.conf
|
295
335
|
- spec/gettext_simple_rails_spec.rb
|