flexi_generators 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/VERSION +1 -1
- data/flexi_generators.gemspec +4 -3
- data/lib/generators/flexi_auth/templates/authentication.rb +1 -0
- data/lib/generators/flexi_auth/templates/sessions_controller.rb +1 -0
- data/lib/generators/flexi_auth/templates/users_controller.rb +1 -0
- data/lib/generators/flexi_prepare/templates/application_helper.rb +3 -1
- data/lib/generators/flexi_prepare/templates/inflector_portuguese.rb +60 -59
- data/lib/generators/flexi_scaffold/templates/controller.rb +1 -0
- data/lib/generators/flexi_scaffold/templates/views/erb/index.html.erb +1 -1
- metadata +5 -4
data/.gitignore
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/flexi_generators.gemspec
CHANGED
@@ -5,18 +5,19 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{flexi_generators}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Leandro de Oliveira"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-26}
|
13
13
|
s.description = %q{Generates authentication and custom scaffold templates.}
|
14
14
|
s.email = %q{ol.leandro@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"README.textile"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
|
-
"
|
19
|
+
".gitignore",
|
20
|
+
"README.textile",
|
20
21
|
"Rakefile",
|
21
22
|
"VERSION",
|
22
23
|
"flexi_generators.gemspec",
|
@@ -17,9 +17,11 @@ module ApplicationHelper
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def flash_messages
|
20
|
+
content = ""
|
20
21
|
flash.collect do |key, value|
|
21
|
-
content_tag(:div, value, :class=>"flash_messages #{key}")
|
22
|
+
content << content_tag(:div, value, :class=>"flash_messages #{key}")
|
22
23
|
end
|
24
|
+
content
|
23
25
|
end
|
24
26
|
|
25
27
|
def analytics(site_id)
|
@@ -1,59 +1,60 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
# http://pt.wikipedia.org/wiki/
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
inflect.
|
9
|
-
inflect.plural(
|
10
|
-
inflect.plural(
|
11
|
-
|
12
|
-
inflect.plural(/
|
13
|
-
inflect.plural(/
|
14
|
-
inflect.plural(/
|
15
|
-
inflect.plural(/
|
16
|
-
inflect.plural(/
|
17
|
-
inflect.plural(/
|
18
|
-
inflect.plural(
|
19
|
-
inflect.plural(/^(|
|
20
|
-
inflect.plural(
|
21
|
-
inflect.plural(
|
22
|
-
inflect.plural(/^(
|
23
|
-
inflect.plural(
|
24
|
-
|
25
|
-
|
26
|
-
inflect.plural(
|
27
|
-
inflect.plural(/^(
|
28
|
-
|
29
|
-
|
30
|
-
inflect.singular(/
|
31
|
-
inflect.singular(
|
32
|
-
inflect.singular(
|
33
|
-
inflect.singular(/(
|
34
|
-
inflect.singular(/
|
35
|
-
inflect.singular(/
|
36
|
-
inflect.singular(/
|
37
|
-
inflect.singular(/
|
38
|
-
inflect.singular(/
|
39
|
-
inflect.singular(/
|
40
|
-
inflect.singular(
|
41
|
-
inflect.singular(
|
42
|
-
inflect.singular(
|
43
|
-
inflect.singular(
|
44
|
-
inflect.singular(
|
45
|
-
inflect.singular(
|
46
|
-
inflect.singular(
|
47
|
-
inflect.singular(/
|
48
|
-
inflect.singular(
|
49
|
-
|
50
|
-
#irregulares
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
# inflect.
|
56
|
-
#
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
+
|
7
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
8
|
+
inflect.clear
|
9
|
+
inflect.plural(/$/, 's')
|
10
|
+
inflect.plural(/(s)$/i, '\1')
|
11
|
+
inflect.plural(/^(paí)s$/i, '\1ses')
|
12
|
+
#inflect.plural(/(z|r)$/i, '\1es')
|
13
|
+
inflect.plural(/al$/i, 'ais')
|
14
|
+
inflect.plural(/el$/i, 'eis')
|
15
|
+
inflect.plural(/ol$/i, 'ois')
|
16
|
+
inflect.plural(/ul$/i, 'uis')
|
17
|
+
inflect.plural(/([^aeou])il$/i, '\1is')
|
18
|
+
inflect.plural(/m$/i, 'ns')
|
19
|
+
inflect.plural(/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i, '\1eses')
|
20
|
+
inflect.plural(/^(|g)ás$/i, '\1ases')
|
21
|
+
inflect.plural(/ão$/i, 'ões')
|
22
|
+
inflect.plural(/^(irm|m)ão$/i, '\1ãos')
|
23
|
+
inflect.plural(/^(alem|c|p)ão$/i, '\1ães')
|
24
|
+
inflect.plural(/or$/i, 'ores')
|
25
|
+
# Sem acentos...
|
26
|
+
inflect.plural(/ao$/i, 'oes')
|
27
|
+
inflect.plural(/^(irm|m)ao$/i, '\1aos')
|
28
|
+
inflect.plural(/^(alem|c|p)ao$/i, '\1aes')
|
29
|
+
|
30
|
+
inflect.singular(/ores$/i, 'or')
|
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
|
+
#irregulares
|
51
|
+
#irregulares = {'país' => 'paises'}
|
52
|
+
#
|
53
|
+
#
|
54
|
+
#irregulares.each do |key, value|
|
55
|
+
# inflect.plural(/^#{key.to_s}$/, value)
|
56
|
+
# inflect.singular(/^#{value}$/, key.to_s)
|
57
|
+
#end
|
58
|
+
inflect.uncountable %w( tórax tênis ônibus lápis fênix )
|
59
|
+
end
|
60
|
+
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
|
15
15
|
<tr>
|
16
16
|
<%- for attribute in model_attributes -%>
|
17
|
-
<td><%%=
|
17
|
+
<td><%%= <%= singular_name %>.<%= attribute.name %> %></td>
|
18
18
|
<%- end -%>
|
19
19
|
<td width="11%">
|
20
20
|
<ul class="actions">
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexi_generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Leandro de Oliveira
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-26 00:00:00 -02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -28,6 +28,7 @@ extensions: []
|
|
28
28
|
extra_rdoc_files:
|
29
29
|
- README.textile
|
30
30
|
files:
|
31
|
+
- .gitignore
|
31
32
|
- README.textile
|
32
33
|
- Rakefile
|
33
34
|
- VERSION
|