flexi_generators 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ rdoc
2
+ pkg
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -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.3"
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-21}
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
- "README.textile",
19
+ ".gitignore",
20
+ "README.textile",
20
21
  "Rakefile",
21
22
  "VERSION",
22
23
  "flexi_generators.gemspec",
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  # This module is included in your application controller which makes
2
3
  # several methods available to all controllers and views. Here's a
3
4
  # common example you might add to your application layout file.
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  class <%= session_plural_class_name %>Controller < ApplicationController
2
3
  skip_before_filter :login_required
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  class Admin::<%= user_plural_class_name %>Controller < ApplicationController
2
3
  menu_item :<%= user_plural_name %>
3
4
  respond_to :html
@@ -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
- # Infelizmente não é possível colocar todas as regras...
2
- #
3
- # http://pt.wikipedia.org/wiki/Plural e
4
- # http://pt.wikipedia.org/wiki/Singular
5
-
6
- ActiveSupport::Inflector.inflections do |inflect|
7
- inflect.clear
8
- inflect.plural(/$/, 's')
9
- inflect.plural(/(s)$/i, '\1')
10
- inflect.plural(/^(paí)s$/i, '\1ses')
11
- #inflect.plural(/(z|r)$/i, '\1es')
12
- inflect.plural(/al$/i, 'ais')
13
- inflect.plural(/el$/i, 'eis')
14
- inflect.plural(/ol$/i, 'ois')
15
- inflect.plural(/ul$/i, 'uis')
16
- inflect.plural(/([^aeou])il$/i, '\1is')
17
- inflect.plural(/m$/i, 'ns')
18
- inflect.plural(/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i, '\1eses')
19
- inflect.plural(/^(|g)ás$/i, '\1ases')
20
- inflect.plural(/ão$/i, 'ões')
21
- inflect.plural(/^(irm|m)ão$/i, '\1ãos')
22
- inflect.plural(/^(alem|c|p)ão$/i, '\1ães')
23
- inflect.plural(/or$/i, 'ores')
24
- # Sem acentos...
25
- inflect.plural(/ao$/i, 'oes')
26
- inflect.plural(/^(irm|m)ao$/i, '\1aos')
27
- inflect.plural(/^(alem|c|p)ao$/i, '\1aes')
28
-
29
- inflect.singular(/ores$/i, 'or')
30
- inflect.singular(/([^ê])s$/i, '\1')
31
- inflect.singular(/^(á|gá|paí)s$/i, '\1s')
32
- inflect.singular(/(r|z)es$/i, '\1')
33
- inflect.singular(/([^p])ais$/i, '\1al')
34
- inflect.singular(/eis$/i, 'el')
35
- inflect.singular(/ois$/i, 'ol')
36
- inflect.singular(/uis$/i, 'ul')
37
- inflect.singular(/(r|t|f|v)is$/i, '\1il')
38
- inflect.singular(/ns$/i, 'm')
39
- inflect.singular(/sses$/i, 'sse')
40
- inflect.singular(/^(.*[^s]s)es$/i, '\1')
41
- inflect.singular(es$/i, 'ão')
42
- inflect.singular(/aes$/i, 'ao')
43
- inflect.singular(/ãos$/i, 'ão')
44
- inflect.singular(/aos$/i, 'ao')
45
- inflect.singular(/ões$/i, 'ão')
46
- inflect.singular(/oes$/i, 'ao')
47
- inflect.singular(/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i, '\1ês')
48
- inflect.singular(/^(g|)ases$/i, '\1ás')
49
- #irregulares
50
- #irregulares = {'país' => 'paises'}
51
- #
52
- #
53
- #irregulares.each do |key, value|
54
- # inflect.plural(/^#{key.to_s}$/, value)
55
- # inflect.singular(/^#{value}$/, key.to_s)
56
- #end
57
- inflect.uncountable %w( tórax tênis ônibus lápis fênix )
58
- end
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
+
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  class Admin::<%= plural_class_name %>Controller < ApplicationController
2
3
  menu_item :<%= plural_name %>
3
4
  respond_to :html
@@ -14,7 +14,7 @@
14
14
  <%% @<%= plural_name %>.each do |<%= singular_name %>| %>
15
15
  <tr>
16
16
  <%- for attribute in model_attributes -%>
17
- <td><%%=h <%= singular_name %>.<%= attribute.name %> %></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: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
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-21 00:00:00 -02:00
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