flexi_generators 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/VERSION +1 -1
- data/flexi_generators.gemspec +3 -2
- data/lib/generators/flexi_auth/flexi_auth_generator.rb +2 -1
- data/lib/generators/flexi_auth/templates/views/erb/application.html.erb +57 -0
- data/lib/generators/flexi_prepare/templates/inflector_portuguese.rb +60 -60
- metadata +5 -4
data/.gitignore
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
rdoc
|
1
|
+
rdoc
|
2
2
|
pkg
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/flexi_generators.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
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.5"
|
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-30}
|
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 = [
|
@@ -38,6 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
"lib/generators/flexi_auth/templates/users_controller.rb",
|
39
39
|
"lib/generators/flexi_auth/templates/users_helper.rb",
|
40
40
|
"lib/generators/flexi_auth/templates/views/erb/_error_messages.html.erb",
|
41
|
+
"lib/generators/flexi_auth/templates/views/erb/application.html.erb",
|
41
42
|
"lib/generators/flexi_auth/templates/views/erb/edit.html.erb",
|
42
43
|
"lib/generators/flexi_auth/templates/views/erb/index.html.erb",
|
43
44
|
"lib/generators/flexi_auth/templates/views/erb/login.html.erb",
|
@@ -34,6 +34,7 @@ class FlexiAuthGenerator < Rails::Generators::Base
|
|
34
34
|
template "views/erb/new.html.erb", "app/views/admin/#{user_plural_name}/new.html.erb"
|
35
35
|
template "views/erb/_error_messages.html.erb", "app/views/shared/_error_messages.html.erb"
|
36
36
|
template "views/erb/edit.html.erb", "app/views/admin/#{user_plural_name}/edit.html.erb"
|
37
|
+
template "views/erb/application.html.erb", "app/views/layouts/application.html.erb"
|
37
38
|
end
|
38
39
|
|
39
40
|
def create_lib_files
|
@@ -41,7 +42,7 @@ class FlexiAuthGenerator < Rails::Generators::Base
|
|
41
42
|
end
|
42
43
|
|
43
44
|
def create_routes
|
44
|
-
route "match 'admin' => '
|
45
|
+
route "match 'admin' => '#{session_plural_name}#new'"
|
45
46
|
route "resources #{session_plural_name.to_sym.inspect}"
|
46
47
|
route "match 'login' => '#{session_plural_name}#new', :as => :login"
|
47
48
|
route "match 'logout' => '#{session_plural_name}#destroy', :as => :logout"
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
5
|
+
<title><%%= "Área administrativa - #{ yield(:title) }" %></title>
|
6
|
+
<%%= stylesheet_link_tag 'application' %>
|
7
|
+
<%%= javascript_include_tag :defaults %>
|
8
|
+
<%%= yield(:head) %>
|
9
|
+
<%%= csrf_meta_tag %>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<div class="top_nav">
|
13
|
+
<%% if logged_in? %>
|
14
|
+
<%%= current_<%= user_singular_name %>.username %> | <%%= current_<%= user_singular_name %>.email %> | <%%= link_to "» Sair", logout_path, :class => 'logout' %>
|
15
|
+
<%% else %>
|
16
|
+
<%%= link_to "» Entrar", login_path, :class => 'login' %>
|
17
|
+
<%% end %>
|
18
|
+
</div>
|
19
|
+
<div id="header">
|
20
|
+
<%%= link_to image_tag("logo.png"), admin_home_url %>
|
21
|
+
</div>
|
22
|
+
<div id="container">
|
23
|
+
<div id="sidenav">
|
24
|
+
<div class="menu">
|
25
|
+
<%%= menu do |m| %>
|
26
|
+
<%%= m.<%= user_plural_name %> admin_<%= user_plural_name %>_path do %>
|
27
|
+
<%%= image_tag 'users.png' %> <%= user_plural_class_name %>
|
28
|
+
<%% end %>
|
29
|
+
<%%= m.menu1 "#menu" do %>
|
30
|
+
<%%= image_tag 'menu.png' %> Menu 1
|
31
|
+
<%% end %>
|
32
|
+
<%%= m.menu2 "#menu" do %>
|
33
|
+
<%%= image_tag 'menu.png' %> Menu 2
|
34
|
+
<%% end %>
|
35
|
+
<%%= m.menu3 "#menu" do %>
|
36
|
+
<%%= image_tag 'menu.png' %> Menu 3
|
37
|
+
<%% end %>
|
38
|
+
<%%= m.menu4 "#menu" do %>
|
39
|
+
<%%= image_tag 'menu.png' %> Menu 4
|
40
|
+
<%% end %>
|
41
|
+
<%% end %>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<div id="main">
|
45
|
+
<div class="box-header">
|
46
|
+
<%% if show_title? %>
|
47
|
+
<h2><%%= yield(:title) %></h2>
|
48
|
+
<%% end %>
|
49
|
+
</div>
|
50
|
+
<div class="box">
|
51
|
+
<%%= raw flash_messages %>
|
52
|
+
<%%= yield %>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
</body>
|
57
|
+
</html>
|
@@ -1,60 +1,60 @@
|
|
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
|
-
|
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
|
+
|
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: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 5
|
10
|
+
version: 0.2.5
|
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-30 00:00:00 -02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/generators/flexi_auth/templates/users_controller.rb
|
51
51
|
- lib/generators/flexi_auth/templates/users_helper.rb
|
52
52
|
- lib/generators/flexi_auth/templates/views/erb/_error_messages.html.erb
|
53
|
+
- lib/generators/flexi_auth/templates/views/erb/application.html.erb
|
53
54
|
- lib/generators/flexi_auth/templates/views/erb/edit.html.erb
|
54
55
|
- lib/generators/flexi_auth/templates/views/erb/index.html.erb
|
55
56
|
- lib/generators/flexi_auth/templates/views/erb/login.html.erb
|