flexi_generators 0.2.10 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +22 -0
  4. data/README.md +29 -0
  5. data/Rakefile +2 -16
  6. data/flexi_generators.gemspec +17 -114
  7. data/lib/flexi_generators.rb +11 -0
  8. data/lib/generators/flexi/config/config_generator.rb +25 -0
  9. data/lib/generators/flexi/config/templates/field_error.rb +9 -0
  10. data/lib/generators/flexi/config/templates/inflector_portuguese.rb +62 -0
  11. data/lib/generators/flexi/config/templates/pt-BR.yml +224 -0
  12. data/lib/generators/flexi/config/templates/will_paginate.rb +26 -0
  13. data/lib/generators/flexi/install/install_generator.rb +28 -0
  14. data/lib/generators/flexi/install/templates/application.css +15 -0
  15. data/lib/generators/flexi/install/templates/application.js +16 -0
  16. data/lib/generators/flexi/layout/layout_generator.rb +46 -0
  17. data/lib/generators/flexi/layout/templates/_flash.html.erb +4 -0
  18. data/lib/generators/flexi/layout/templates/_navbar.html.erb +6 -0
  19. data/lib/generators/flexi/layout/templates/_sidebar.html.erb +16 -0
  20. data/lib/generators/flexi/layout/templates/_user_dropdown.html.erb +11 -0
  21. data/lib/generators/flexi/layout/templates/application.css +16 -0
  22. data/lib/generators/flexi/layout/templates/dashboard.html.erb +49 -0
  23. data/lib/generators/flexi/layout/templates/error_messages_helper.rb +33 -0
  24. data/lib/generators/flexi/layout/templates/layout.css +8 -0
  25. data/lib/generators/flexi/layout/templates/layout.html.erb +76 -0
  26. data/lib/generators/flexi/layout/templates/layout_helper.rb +47 -0
  27. data/lib/generators/flexi/scaffold/scaffold_generator.rb +24 -109
  28. data/lib/generators/flexi/scaffold/templates/_form.html.erb +22 -0
  29. data/lib/generators/flexi/scaffold/templates/edit.html.erb +1 -0
  30. data/lib/generators/flexi/scaffold/templates/index.html.erb +36 -0
  31. data/lib/generators/flexi/scaffold/templates/new.html.erb +1 -0
  32. data/lib/generators/flexi/scaffold/templates/show.html.erb +21 -0
  33. data/lib/twitter-bootstrap/engine.rb +6 -0
  34. data/lib/twitter-bootstrap/railtie.rb +6 -0
  35. data/lib/twitter-bootstrap/version.rb +5 -0
  36. data/lib/version.rb +3 -0
  37. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  38. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  39. data/vendor/assets/javascripts/bootstrap.js +1825 -0
  40. data/vendor/assets/stylesheets/bootstrap-responsive.css +815 -0
  41. data/vendor/assets/stylesheets/bootstrap.css +4983 -0
  42. metadata +51 -89
  43. data/README.textile +0 -64
  44. data/VERSION +0 -1
  45. data/lib/generators/flexi.rb +0 -16
  46. data/lib/generators/flexi/auth/USAGE +0 -5
  47. data/lib/generators/flexi/auth/auth_generator.rb +0 -122
  48. data/lib/generators/flexi/auth/templates/authentication.rb +0 -55
  49. data/lib/generators/flexi/auth/templates/authlogic_session.rb +0 -2
  50. data/lib/generators/flexi/auth/templates/fixtures.yml +0 -24
  51. data/lib/generators/flexi/auth/templates/migration.rb +0 -16
  52. data/lib/generators/flexi/auth/templates/sessions_controller.rb +0 -26
  53. data/lib/generators/flexi/auth/templates/sessions_helper.rb +0 -2
  54. data/lib/generators/flexi/auth/templates/tests/testunit/sessions_controller.rb +0 -20
  55. data/lib/generators/flexi/auth/templates/tests/testunit/user.rb +0 -4
  56. data/lib/generators/flexi/auth/templates/tests/testunit/users_controller.rb +0 -23
  57. data/lib/generators/flexi/auth/templates/user.rb +0 -3
  58. data/lib/generators/flexi/auth/templates/users_controller.rb +0 -43
  59. data/lib/generators/flexi/auth/templates/users_helper.rb +0 -2
  60. data/lib/generators/flexi/auth/templates/views/erb/_error_messages.html.erb +0 -11
  61. data/lib/generators/flexi/auth/templates/views/erb/_menu.html.erb +0 -16
  62. data/lib/generators/flexi/auth/templates/views/erb/application.html.erb +0 -39
  63. data/lib/generators/flexi/auth/templates/views/erb/edit.html.erb +0 -24
  64. data/lib/generators/flexi/auth/templates/views/erb/index.html.erb +0 -27
  65. data/lib/generators/flexi/auth/templates/views/erb/login.html.erb +0 -22
  66. data/lib/generators/flexi/auth/templates/views/erb/new.html.erb +0 -24
  67. data/lib/generators/flexi/auth/templates/views/erb/show.html.erb +0 -16
  68. data/lib/generators/flexi/prepare/USAGE +0 -6
  69. data/lib/generators/flexi/prepare/prepare_generator.rb +0 -68
  70. data/lib/generators/flexi/prepare/templates/add.png +0 -0
  71. data/lib/generators/flexi/prepare/templates/admin_home_controller.rb +0 -6
  72. data/lib/generators/flexi/prepare/templates/admin_home_index.html.erb +0 -16
  73. data/lib/generators/flexi/prepare/templates/application.css +0 -279
  74. data/lib/generators/flexi/prepare/templates/application_helper.rb +0 -44
  75. data/lib/generators/flexi/prepare/templates/back.png +0 -0
  76. data/lib/generators/flexi/prepare/templates/bg.png +0 -0
  77. data/lib/generators/flexi/prepare/templates/bg2.png +0 -0
  78. data/lib/generators/flexi/prepare/templates/boxheader.gif +0 -0
  79. data/lib/generators/flexi/prepare/templates/btn-bg-hover.png +0 -0
  80. data/lib/generators/flexi/prepare/templates/btn-bg.png +0 -0
  81. data/lib/generators/flexi/prepare/templates/custom_field_error.rb +0 -12
  82. data/lib/generators/flexi/prepare/templates/delete.png +0 -0
  83. data/lib/generators/flexi/prepare/templates/edit.png +0 -0
  84. data/lib/generators/flexi/prepare/templates/inflector_portuguese.rb +0 -60
  85. data/lib/generators/flexi/prepare/templates/login.css +0 -142
  86. data/lib/generators/flexi/prepare/templates/login.html.erb +0 -26
  87. data/lib/generators/flexi/prepare/templates/logo.png +0 -0
  88. data/lib/generators/flexi/prepare/templates/menu.png +0 -0
  89. data/lib/generators/flexi/prepare/templates/messages/Thumbs.db +0 -0
  90. data/lib/generators/flexi/prepare/templates/messages/error.png +0 -0
  91. data/lib/generators/flexi/prepare/templates/messages/info.png +0 -0
  92. data/lib/generators/flexi/prepare/templates/messages/success.png +0 -0
  93. data/lib/generators/flexi/prepare/templates/messages/tip.png +0 -0
  94. data/lib/generators/flexi/prepare/templates/messages/warning.png +0 -0
  95. data/lib/generators/flexi/prepare/templates/pt-BR.yml +0 -206
  96. data/lib/generators/flexi/prepare/templates/routes.rb +0 -3
  97. data/lib/generators/flexi/prepare/templates/show.png +0 -0
  98. data/lib/generators/flexi/prepare/templates/site.css +0 -72
  99. data/lib/generators/flexi/prepare/templates/site.html.erb +0 -20
  100. data/lib/generators/flexi/prepare/templates/site_controller.rb +0 -9
  101. data/lib/generators/flexi/prepare/templates/site_helper.rb +0 -2
  102. data/lib/generators/flexi/prepare/templates/site_index.html.erb +0 -27
  103. data/lib/generators/flexi/prepare/templates/users.png +0 -0
  104. data/lib/generators/flexi/scaffold/USAGE +0 -5
  105. data/lib/generators/flexi/scaffold/templates/controller.rb +0 -43
  106. data/lib/generators/flexi/scaffold/templates/fixtures.yml +0 -9
  107. data/lib/generators/flexi/scaffold/templates/helper.rb +0 -2
  108. data/lib/generators/flexi/scaffold/templates/migration.rb +0 -14
  109. data/lib/generators/flexi/scaffold/templates/model.rb +0 -3
  110. data/lib/generators/flexi/scaffold/templates/tests/controller.rb +0 -50
  111. data/lib/generators/flexi/scaffold/templates/tests/helper.rb +0 -4
  112. data/lib/generators/flexi/scaffold/templates/tests/model.rb +0 -8
  113. data/lib/generators/flexi/scaffold/templates/views/erb/_error_messages.html.erb +0 -11
  114. data/lib/generators/flexi/scaffold/templates/views/erb/_form.html.erb +0 -13
  115. data/lib/generators/flexi/scaffold/templates/views/erb/edit.html.erb +0 -3
  116. data/lib/generators/flexi/scaffold/templates/views/erb/index.html.erb +0 -29
  117. data/lib/generators/flexi/scaffold/templates/views/erb/new.html.erb +0 -3
  118. data/lib/generators/flexi/scaffold/templates/views/erb/show.html.erb +0 -15
  119. data/template.rb +0 -15
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in flexi_generators.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Leandro de Oliveira
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Flexi Generators
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'flexi_generators'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install flexi_generators
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,16 +1,2 @@
1
- require 'rake'
2
-
3
- begin
4
- require 'jeweler'
5
- Jeweler::Tasks.new do |gemspec|
6
- gemspec.name = "flexi_generators"
7
- gemspec.summary = "My useful Rails generator scripts."
8
- gemspec.description = "Generates authentication and custom scaffold templates."
9
- gemspec.email = "ol.leandro@gmail.com"
10
- gemspec.homepage = "http://github.com/leandroo/flexi_generators"
11
- gemspec.authors = ["Leandro de Oliveira"]
12
- end
13
- Jeweler::GemcutterTasks.new
14
- rescue LoadError
15
- puts "Jeweler not available. Install it with: gem install jeweler"
16
- end
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -1,114 +1,17 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{flexi_generators}
8
- s.version = "0.2.10"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Leandro de Oliveira"]
12
- s.date = %q{2011-04-21}
13
- s.description = %q{Generates authentication and custom scaffold templates.}
14
- s.email = %q{ol.leandro@gmail.com}
15
- s.extra_rdoc_files = [
16
- "README.textile"
17
- ]
18
- s.files = [
19
- "README.textile",
20
- "Rakefile",
21
- "VERSION",
22
- "flexi_generators.gemspec",
23
- "lib/generators/flexi.rb",
24
- "lib/generators/flexi/auth/USAGE",
25
- "lib/generators/flexi/auth/auth_generator.rb",
26
- "lib/generators/flexi/auth/templates/authentication.rb",
27
- "lib/generators/flexi/auth/templates/authlogic_session.rb",
28
- "lib/generators/flexi/auth/templates/fixtures.yml",
29
- "lib/generators/flexi/auth/templates/migration.rb",
30
- "lib/generators/flexi/auth/templates/sessions_controller.rb",
31
- "lib/generators/flexi/auth/templates/sessions_helper.rb",
32
- "lib/generators/flexi/auth/templates/tests/testunit/sessions_controller.rb",
33
- "lib/generators/flexi/auth/templates/tests/testunit/user.rb",
34
- "lib/generators/flexi/auth/templates/tests/testunit/users_controller.rb",
35
- "lib/generators/flexi/auth/templates/user.rb",
36
- "lib/generators/flexi/auth/templates/users_controller.rb",
37
- "lib/generators/flexi/auth/templates/users_helper.rb",
38
- "lib/generators/flexi/auth/templates/views/erb/_error_messages.html.erb",
39
- "lib/generators/flexi/auth/templates/views/erb/_menu.html.erb",
40
- "lib/generators/flexi/auth/templates/views/erb/application.html.erb",
41
- "lib/generators/flexi/auth/templates/views/erb/edit.html.erb",
42
- "lib/generators/flexi/auth/templates/views/erb/index.html.erb",
43
- "lib/generators/flexi/auth/templates/views/erb/login.html.erb",
44
- "lib/generators/flexi/auth/templates/views/erb/new.html.erb",
45
- "lib/generators/flexi/auth/templates/views/erb/show.html.erb",
46
- "lib/generators/flexi/prepare/USAGE",
47
- "lib/generators/flexi/prepare/prepare_generator.rb",
48
- "lib/generators/flexi/prepare/templates/add.png",
49
- "lib/generators/flexi/prepare/templates/admin_home_controller.rb",
50
- "lib/generators/flexi/prepare/templates/admin_home_index.html.erb",
51
- "lib/generators/flexi/prepare/templates/application.css",
52
- "lib/generators/flexi/prepare/templates/application_helper.rb",
53
- "lib/generators/flexi/prepare/templates/back.png",
54
- "lib/generators/flexi/prepare/templates/bg.png",
55
- "lib/generators/flexi/prepare/templates/bg2.png",
56
- "lib/generators/flexi/prepare/templates/boxheader.gif",
57
- "lib/generators/flexi/prepare/templates/btn-bg-hover.png",
58
- "lib/generators/flexi/prepare/templates/btn-bg.png",
59
- "lib/generators/flexi/prepare/templates/custom_field_error.rb",
60
- "lib/generators/flexi/prepare/templates/delete.png",
61
- "lib/generators/flexi/prepare/templates/edit.png",
62
- "lib/generators/flexi/prepare/templates/inflector_portuguese.rb",
63
- "lib/generators/flexi/prepare/templates/login.css",
64
- "lib/generators/flexi/prepare/templates/login.html.erb",
65
- "lib/generators/flexi/prepare/templates/logo.png",
66
- "lib/generators/flexi/prepare/templates/menu.png",
67
- "lib/generators/flexi/prepare/templates/messages/Thumbs.db",
68
- "lib/generators/flexi/prepare/templates/messages/error.png",
69
- "lib/generators/flexi/prepare/templates/messages/info.png",
70
- "lib/generators/flexi/prepare/templates/messages/success.png",
71
- "lib/generators/flexi/prepare/templates/messages/tip.png",
72
- "lib/generators/flexi/prepare/templates/messages/warning.png",
73
- "lib/generators/flexi/prepare/templates/pt-BR.yml",
74
- "lib/generators/flexi/prepare/templates/routes.rb",
75
- "lib/generators/flexi/prepare/templates/show.png",
76
- "lib/generators/flexi/prepare/templates/site.css",
77
- "lib/generators/flexi/prepare/templates/site.html.erb",
78
- "lib/generators/flexi/prepare/templates/site_controller.rb",
79
- "lib/generators/flexi/prepare/templates/site_helper.rb",
80
- "lib/generators/flexi/prepare/templates/site_index.html.erb",
81
- "lib/generators/flexi/prepare/templates/users.png",
82
- "lib/generators/flexi/scaffold/USAGE",
83
- "lib/generators/flexi/scaffold/scaffold_generator.rb",
84
- "lib/generators/flexi/scaffold/templates/controller.rb",
85
- "lib/generators/flexi/scaffold/templates/fixtures.yml",
86
- "lib/generators/flexi/scaffold/templates/helper.rb",
87
- "lib/generators/flexi/scaffold/templates/migration.rb",
88
- "lib/generators/flexi/scaffold/templates/model.rb",
89
- "lib/generators/flexi/scaffold/templates/tests/controller.rb",
90
- "lib/generators/flexi/scaffold/templates/tests/helper.rb",
91
- "lib/generators/flexi/scaffold/templates/tests/model.rb",
92
- "lib/generators/flexi/scaffold/templates/views/erb/_error_messages.html.erb",
93
- "lib/generators/flexi/scaffold/templates/views/erb/_form.html.erb",
94
- "lib/generators/flexi/scaffold/templates/views/erb/edit.html.erb",
95
- "lib/generators/flexi/scaffold/templates/views/erb/index.html.erb",
96
- "lib/generators/flexi/scaffold/templates/views/erb/new.html.erb",
97
- "lib/generators/flexi/scaffold/templates/views/erb/show.html.erb",
98
- "template.rb"
99
- ]
100
- s.homepage = %q{http://github.com/leandroo/flexi_generators}
101
- s.require_paths = ["lib"]
102
- s.rubygems_version = %q{1.7.2}
103
- s.summary = %q{My useful Rails generator scripts.}
104
-
105
- if s.respond_to? :specification_version then
106
- s.specification_version = 3
107
-
108
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
109
- else
110
- end
111
- else
112
- end
113
- end
114
-
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Leandro de Oliveira"]
6
+ gem.email = ["ol.leandro@gmail.com"]
7
+ gem.description = "Rails generators scripts for scaffolding and layout files containing Twitter’s Bootstrap CSS"
8
+ gem.summary = ""
9
+ gem.homepage = "https://github.com/leandroo/flexi_generators"
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ gem.name = "flexi_generators"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = FlexiGenerators::VERSION
17
+ end
@@ -0,0 +1,11 @@
1
+ require "version"
2
+
3
+ module FlexiGenerators
4
+ module Rails
5
+ if ::Rails.version < "3.1"
6
+ require "twitter-bootstrap/railtie"
7
+ else
8
+ require "twitter-bootstrap/engine"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,25 @@
1
+ require 'rails/generators'
2
+
3
+ module Flexi
4
+ module Generators
5
+ class ConfigGenerator < ::Rails::Generators::Base
6
+ desc "This generator sets to my default settings"
7
+ source_root File.expand_path("../templates", __FILE__)
8
+
9
+ def config_app
10
+ remove_file "public/index.html"
11
+
12
+ copy_file "pt-BR.yml", "config/locales/pt-BR.yml"
13
+ copy_file "inflector_portuguese.rb", "config/initializers/inflector_portuguese.rb"
14
+ copy_file "field_error.rb", "config/initializers/field_error.rb"
15
+ copy_file "will_paginate.rb", "config/initializers/will_paginate.rb"
16
+
17
+ inject_into_class "config/application.rb", "Application","\tconfig.i18n.default_locale = 'pt-BR'\n"
18
+ inject_into_class "config/application.rb", "Application","\tconfig.time_zone = 'Brasilia'\n"
19
+
20
+ gem 'will_paginate', '~> 3.0'
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
2
+ if html_tag =~ /<(input|textarea|select)/
3
+ %|<div class="control-group error">#{html_tag} <span class="help-inline">#{[instance.error_message].join(', ')}</span></div>|.html_safe
4
+ elsif html_tag =~ /<label/
5
+ %|<div class="control-group error">#{html_tag}|.html_safe
6
+ else
7
+ html_tag
8
+ end
9
+ end
@@ -0,0 +1,62 @@
1
+ #encoding: utf-8
2
+ # Infelizmente não é possível colocar todas as regras...
3
+ #
4
+ # http://pt.wikipedia.org/wiki/Plural e
5
+ # http://pt.wikipedia.org/wiki/Singular
6
+ module Inflector
7
+ ActiveSupport::Inflector.inflections do |inflect|
8
+ inflect.clear
9
+
10
+ inflect.plural(/$/, 's')
11
+ inflect.plural(/(s)$/i, '\1')
12
+ inflect.plural(/^(paí)s$/i, '\1ses')
13
+ inflect.plural(/(z|r)$/i, '\1es')
14
+ inflect.plural(/al$/i, 'ais')
15
+ inflect.plural(/el$/i, 'eis')
16
+ inflect.plural(/ol$/i, 'ois')
17
+ inflect.plural(/ul$/i, 'uis')
18
+ inflect.plural(/([^aeou])il$/i, '\1is')
19
+ inflect.plural(/m$/i, 'ns')
20
+ inflect.plural(/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i, '\1eses')
21
+ inflect.plural(/^(|g)ás$/i, '\1ases')
22
+ inflect.plural(/ão$/i, 'ões')
23
+ inflect.plural(/^(irm|m)ão$/i, '\1ãos')
24
+ inflect.plural(/^(alem|c|p)ão$/i, '\1ães')
25
+
26
+ # Sem acentos...
27
+ inflect.plural(/ao$/i, 'oes')
28
+ inflect.plural(/^(irm|m)ao$/i, '\1aos')
29
+ inflect.plural(/^(alem|c|p)ao$/i, '\1aes')
30
+
31
+ inflect.singular(/([^ê])s$/i, '\1')
32
+ inflect.singular(/^(á|gá|paí)s$/i, '\1s')
33
+ inflect.singular(/(r|z)es$/i, '\1')
34
+ inflect.singular(/([^p])ais$/i, '\1al')
35
+ inflect.singular(/eis$/i, 'el')
36
+ inflect.singular(/ois$/i, 'ol')
37
+ inflect.singular(/uis$/i, 'ul')
38
+ inflect.singular(/(r|t|f|v)is$/i, '\1il')
39
+ inflect.singular(/ns$/i, 'm')
40
+ inflect.singular(/sses$/i, 'sse')
41
+ inflect.singular(/^(.*[^s]s)es$/i, '\1')
42
+ inflect.singular(/ães$/i, 'ão')
43
+ inflect.singular(/aes$/i, 'ao')
44
+ inflect.singular(/ãos$/i, 'ão')
45
+ inflect.singular(/aos$/i, 'ao')
46
+ inflect.singular(/ões$/i, 'ão')
47
+ inflect.singular(/oes$/i, 'ao')
48
+ inflect.singular(/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i, '\1ês')
49
+ inflect.singular(/^(g|)ases$/i, '\1ás')
50
+
51
+ # #irregulares
52
+ # irregulares = {'país' => 'paises'}
53
+ #
54
+ #
55
+ # irregulares.each do |key, value|
56
+ # inflect.plural(/^#{key.to_s}$/, value)
57
+ # inflect.singular(/^#{value}$/, key.to_s)
58
+ # end
59
+
60
+ inflect.uncountable %w( tórax tênis ônibus lápis fênix )
61
+ end
62
+ end
@@ -0,0 +1,224 @@
1
+ pt-BR:
2
+ date:
3
+ abbr_day_names:
4
+ - Dom
5
+ - Seg
6
+ - Ter
7
+ - Qua
8
+ - Qui
9
+ - Sex
10
+ - Sáb
11
+ abbr_month_names:
12
+ -
13
+ - Jan
14
+ - Fev
15
+ - Mar
16
+ - Abr
17
+ - Mai
18
+ - Jun
19
+ - Jul
20
+ - Ago
21
+ - Set
22
+ - Out
23
+ - Nov
24
+ - Dez
25
+ day_names:
26
+ - Domingo
27
+ - Segunda
28
+ - Terça
29
+ - Quarta
30
+ - Quinta
31
+ - Sexta
32
+ - Sábado
33
+ formats:
34
+ default: ! '%d/%m/%Y'
35
+ long: ! '%d de %B de %Y'
36
+ short: ! '%d de %B'
37
+ month_names:
38
+ -
39
+ - Janeiro
40
+ - Fevereiro
41
+ - Março
42
+ - Abril
43
+ - Maio
44
+ - Junho
45
+ - Julho
46
+ - Agosto
47
+ - Setembro
48
+ - Outubro
49
+ - Novembro
50
+ - Dezembro
51
+ order:
52
+ - :day
53
+ - :month
54
+ - :year
55
+ datetime:
56
+ distance_in_words:
57
+ about_x_hours:
58
+ one: aproximadamente 1 hora
59
+ other: aproximadamente %{count} horas
60
+ about_x_months:
61
+ one: aproximadamente 1 mês
62
+ other: aproximadamente %{count} meses
63
+ about_x_years:
64
+ one: aproximadamente 1 ano
65
+ other: aproximadamente %{count} anos
66
+ almost_x_years:
67
+ one: quase 1 ano
68
+ other: quase %{count} anos
69
+ half_a_minute: meio minuto
70
+ less_than_x_minutes:
71
+ one: menos de um minuto
72
+ other: menos de %{count} minutos
73
+ less_than_x_seconds:
74
+ one: menos de 1 segundo
75
+ other: menos de %{count} segundos
76
+ over_x_years:
77
+ one: mais de 1 ano
78
+ other: mais de %{count} anos
79
+ x_days:
80
+ one: 1 dia
81
+ other: ! '%{count} dias'
82
+ x_minutes:
83
+ one: 1 minuto
84
+ other: ! '%{count} minutos'
85
+ x_months:
86
+ one: 1 mês
87
+ other: ! '%{count} meses'
88
+ x_seconds:
89
+ one: 1 segundo
90
+ other: ! '%{count} segundos'
91
+ prompts:
92
+ day: Dia
93
+ hour: Hora
94
+ minute: Minuto
95
+ month: Mês
96
+ second: Segundo
97
+ year: Ano
98
+ errors: &errors
99
+ format: ! '%{attribute} %{message}'
100
+ messages:
101
+ accepted: deve ser aceito
102
+ blank: não pode ficar em branco
103
+ confirmation: não está de acordo com a confirmação
104
+ empty: não pode ficar vazio
105
+ equal_to: deve ser igual a %{count}
106
+ even: deve ser par
107
+ exclusion: não está disponível
108
+ greater_than: deve ser maior que %{count}
109
+ greater_than_or_equal_to: deve ser maior ou igual a %{count}
110
+ inclusion: não está incluído na lista
111
+ invalid: não é válido
112
+ less_than: deve ser menor que %{count}
113
+ less_than_or_equal_to: deve ser menor ou igual a %{count}
114
+ not_a_number: não é um número
115
+ not_an_integer: não é um número inteiro
116
+ odd: deve ser ímpar
117
+ record_invalid: ! 'A validação falhou: %{errors}'
118
+ taken: já está em uso
119
+ too_long: ! 'é muito longo (máximo: %{count} caracteres)'
120
+ too_short: ! 'é muito curto (mínimo: %{count} caracteres)'
121
+ wrong_length: não possui o tamanho esperado (%{count} caracteres)
122
+ template:
123
+ body: ! 'Por favor, verifique o(s) seguinte(s) campo(s):'
124
+ header:
125
+ one: ! 'Não foi possível gravar %{model}: 1 erro'
126
+ other: ! 'Não foi possível gravar %{model}: %{count} erros.'
127
+ helpers:
128
+ select:
129
+ prompt: Por favor selecione
130
+ submit:
131
+ create: Criar %{model}
132
+ submit: Salvar %{model}
133
+ update: Atualizar %{model}
134
+ number:
135
+ currency:
136
+ format:
137
+ delimiter: .
138
+ format: ! '%u %n'
139
+ precision: 2
140
+ separator: ! ','
141
+ significant: false
142
+ strip_insignificant_zeros: false
143
+ unit: R$
144
+ format:
145
+ delimiter: .
146
+ precision: 3
147
+ separator: ! ','
148
+ significant: false
149
+ strip_insignificant_zeros: false
150
+ human:
151
+ decimal_units:
152
+ format: ! '%n %u'
153
+ units:
154
+ billion:
155
+ one: bilhão
156
+ other: bilhões
157
+ million:
158
+ one: milhão
159
+ other: milhões
160
+ quadrillion:
161
+ one: quatrilhão
162
+ other: quatrilhões
163
+ thousand: mil
164
+ trillion:
165
+ one: trilhão
166
+ other: trilhões
167
+ unit: ''
168
+ format:
169
+ delimiter: .
170
+ precision: 2
171
+ significant: true
172
+ strip_insignificant_zeros: true
173
+ storage_units:
174
+ format: ! '%n %u'
175
+ units:
176
+ byte:
177
+ one: Byte
178
+ other: Bytes
179
+ gb: GB
180
+ kb: KB
181
+ mb: MB
182
+ tb: TB
183
+ percentage:
184
+ format:
185
+ delimiter: .
186
+ precision:
187
+ format:
188
+ delimiter: .
189
+ support:
190
+ array:
191
+ last_word_connector: ! ' e '
192
+ two_words_connector: ! ' e '
193
+ words_connector: ! ', '
194
+ time:
195
+ am: ''
196
+ formats:
197
+ default: ! '%A, %d de %B de %Y, %H:%M h'
198
+ long: ! '%A, %d de %B de %Y, %H:%M h'
199
+ short: ! '%d/%m, %H:%M h'
200
+ pm: ''
201
+
202
+ will_paginate:
203
+ next_label: Próximos &#8594;
204
+ page_entries_info:
205
+ multi_page: Exibindo %{model} %{from} - %{to} de %{count} no total
206
+ multi_page_html: Exibindo %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> de <b>%{count}</b>
207
+ no total
208
+ single_page:
209
+ one: Exibindo 1 %{model}
210
+ other: Exibindo todos os %{count} %{model}
211
+ zero: Nenhum %{model} encontrado
212
+ single_page_html:
213
+ one: Exibindo <b>1</b> %{model}
214
+ other: Exibindo <b>todos os&nbsp;%{count}</b> %{model}
215
+ zero: Nenhum %{model} encontrado
216
+ page_gap: ! '&hellip;'
217
+ previous_label: ! '&#8592; Anteriores'
218
+ # remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
219
+ activemodel:
220
+ errors:
221
+ <<: *errors
222
+ activerecord:
223
+ errors:
224
+ <<: *errors