rieles 0.0.5 → 0.0.6

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 34edfe533aa91b4af012b620a36052a5fcc2c474
4
+ data.tar.gz: 45ca3daf371191708cd438ae9d8a7c879653a7bc
5
+ SHA512:
6
+ metadata.gz: 15107b9c09f3305011f915cd5b049daa1497332c0ff2bc7b8e2152ce04a2014a4ba389f9b4083b6b24d764414b84f0119be930cf65fb0351310fa3151dd87194
7
+ data.tar.gz: 5498d5b31a3c97aacbc1b11417178a0edbe2577c643b763baf1f94bfb10f8590b34173db02279ef88aaccf8550f57b1c77094823cecec61edb29e076d6a14405
data/.gitignore CHANGED
@@ -17,3 +17,5 @@ test/version_tmp
17
17
  tmp
18
18
  *.swp
19
19
  .rvmrc
20
+ .ruby-version
21
+ .ruby-gemset
@@ -28,8 +28,12 @@ Modifica el archivo config/application.rb para indicar que se trabajará en Espa
28
28
 
29
29
  y obteniendo el plural o singular de alguna palabra en Español, por ejemplo:
30
30
 
31
+
31
32
  'riel'.pluralize
33
+ # => "rieles"
34
+
32
35
  'rieles'.singularize
36
+ # => "riel"
33
37
 
34
38
  Igualmente, los mensajes de error de active record y las vistas generadas por el scaffold se mostrarán ya traducidas.
35
39
 
@@ -1,3 +1,3 @@
1
1
  module Rieles
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -1,6 +1,5 @@
1
1
  <%%= form_for(@<%= singular_table_name %>) do |f| %>
2
- <%- object = "@#{singular_table_name}" -%>
3
- <%%= render 'error_messages', <%= key_value :target, object %> %>
2
+ <%%= render 'error_messages', target: <%= "@#{singular_table_name}" %> %>
4
3
 
5
4
  <%- attributes.each do |attribute| -%>
6
5
  <div class="field">
@@ -4,7 +4,7 @@
4
4
  <table>
5
5
  <thead>
6
6
  <tr>
7
- <%- attributes.each do |attribute| -%>
7
+ <%- attributes.reject(&:password_digest?).each do |attribute| -%>
8
8
  <th><%= attribute.human_name %></th>
9
9
  <%- end -%>
10
10
  <th></th>
@@ -16,7 +16,7 @@
16
16
  <tbody>
17
17
  <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
18
18
  <tr>
19
- <%- attributes.each do |attribute| -%>
19
+ <%- attributes.reject(&:password_digest?).each do |attribute| -%>
20
20
  <%- if attribute.type == :integer or attribute.type == :decimal -%>
21
21
  <td><%%= number_with_delimiter <%= singular_table_name %>.<%= attribute.name %> %></td>
22
22
  <%- else -%>
@@ -25,7 +25,7 @@
25
25
  <%- end -%>
26
26
  <td><%%= link_to 'Mostrar', <%= singular_table_name %> %></td>
27
27
  <td><%%= link_to 'Editar', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
28
- <td><%%= link_to 'Eliminar', <%= singular_table_name %>, <%= key_value :method, ":delete" %>, <%= key_value :data, "{ #{key_value :confirm, "'¿Estás seguro?'"} }" %> %></td>
28
+ <td><%%= link_to 'Eliminar', <%= singular_table_name %>, method: :delete, data: { confirm: '¿Estás seguro?' } %></td>
29
29
  </tr>
30
30
  <%% end %>
31
31
  </tbody>
@@ -38,4 +38,4 @@
38
38
 
39
39
  <br />
40
40
  <%- nuevo_str = (singular_table_name.split('_').first =~ /[ad]$/) ? 'Nueva' : 'Nuevo' -%>
41
- <%%= link_to "<%= nuevo_str %> <%= human_name %>", new_<%= singular_table_name %>_path %>
41
+ <%%= link_to <%= %{"#{nuevo_str} #{human_name}", new_#{singular_table_name}_path} %> %>
@@ -1,6 +1,5 @@
1
1
  = form_for(@<%= singular_table_name %>) do |f|
2
- <%- object = "@#{singular_table_name}" -%>
3
- = render 'error_messages', <%= key_value :target, object %>
2
+ = render 'error_messages', target:<%= "@#{singular_table_name}" %> %>
4
3
 
5
4
  <%- attributes.each do |attribute| -%>
6
5
  .field
@@ -4,7 +4,7 @@
4
4
  %table
5
5
  %thead
6
6
  %tr
7
- <%- attributes.each do |attribute| -%>
7
+ <%- attributes.reject(&:password_digest?).each do |attribute| -%>
8
8
  %th <%= attribute.human_name %>
9
9
  <%- end -%>
10
10
  %th
@@ -14,7 +14,7 @@
14
14
  %tbody
15
15
  - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
16
16
  %tr
17
- <%- attributes.each do |attribute| -%>
17
+ <%- attributes.reject(&:password_digest?).each do |attribute| -%>
18
18
  <%- if attribute.type == :integer or attribute.type == :decimal -%>
19
19
  %td= number_with_delimiter <%= singular_table_name %>.<%= attribute.name %>
20
20
  <%- else -%>
@@ -23,11 +23,11 @@
23
23
  <%- end -%>
24
24
  %td= link_to 'Mostrar', <%= singular_table_name %>
25
25
  %td= link_to 'Editar', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
26
- %td= link_to 'Eliminar', <%= singular_table_name %>, <%= key_value :method, ":delete" %>, <%= key_value :data, "{ #{key_value :confirm, "'¿Estás seguro?'"} }" %>
26
+ %td= link_to 'Eliminar', <%= singular_table_name %>, method: :delete, data: { confirm: '¿Estás seguro?' }
27
27
  - else
28
28
  %div
29
29
  %h3 No se encontraron <%= plural_table_name.humanize %>
30
30
 
31
31
  %br
32
32
  <%- nuevo_str = (singular_table_name.split('_').first =~ /[ad]$/) ? 'Nueva' : 'Nuevo' %>
33
- = link_to "<%= nuevo_str %> <%= human_name %>", new_<%= singular_table_name %>_path
33
+ = link_to <%= %{"#{nuevo_str} #{human_name}", new_#{singular_table_name}_path} %>
@@ -17,4 +17,5 @@ Gem::Specification.new do |gem|
17
17
  gem.version = Rieles::VERSION
18
18
 
19
19
  gem.add_development_dependency 'generator_spec'
20
+ gem.add_development_dependency 'rspec'
20
21
  end
@@ -8,13 +8,13 @@ describe Rieles::InstallGenerator do
8
8
  destination File.expand_path("../../tmp", __FILE__)
9
9
 
10
10
  context 'when creating erb views' do
11
- before(:all) do
11
+ before(:each) do
12
12
  prepare_destination
13
13
  ::Rieles::InstallGenerator.any_instance.stub(:engine).and_return('erb')
14
14
  run_generator
15
15
  end
16
16
 
17
- it "crea los archivos de inflections, el locale en español, y los templates del scaffold" do
17
+ it 'creates inflection files, spanish locale and erb scaffold templates' do
18
18
  assert_file "config/initializers/inflections.rb", File.read('lib/config/initializer/inflections.rb')
19
19
  assert_file "config/locales/es.yml", File.read('lib/config/locales/es.yml')
20
20
  assert_file "lib/templates/erb/scaffold/new.html.erb", File.read('lib/templates/erb/scaffold/new.html.erb')
@@ -27,13 +27,13 @@ describe Rieles::InstallGenerator do
27
27
  end
28
28
 
29
29
  context 'when creating haml views' do
30
- before(:all) do
30
+ before(:each) do
31
31
  prepare_destination
32
32
  ::Rieles::InstallGenerator.any_instance.stub(:engine).and_return('haml')
33
33
  run_generator
34
34
  end
35
35
 
36
- it "crea los archivos de inflections, el locale en español, y los templates del scaffold" do
36
+ it 'creates inflection files, spanish locale and haml scaffold templates' do
37
37
  assert_file "config/initializers/inflections.rb", File.read('lib/config/initializer/inflections.rb')
38
38
  assert_file "config/locales/es.yml", File.read('lib/config/locales/es.yml')
39
39
  assert_file "lib/templates/haml/scaffold/new.html.haml", File.read('lib/templates/haml/scaffold/new.html.haml')
metadata CHANGED
@@ -1,30 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rieles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Azarel Doroteo Pacheco
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-09-09 00:00:00.000000000 Z
11
+ date: 2013-05-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: generator_spec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
28
39
  - !ruby/object:Gem::Version
29
40
  version: '0'
30
41
  description: Instala el archivo de inflections para pluralizar y singularizar según
@@ -63,33 +74,26 @@ files:
63
74
  - spec/lib/generators/rieles/install_generator_spec.rb
64
75
  homepage: ''
65
76
  licenses: []
77
+ metadata: {}
66
78
  post_install_message:
67
79
  rdoc_options: []
68
80
  require_paths:
69
81
  - lib
70
82
  required_ruby_version: !ruby/object:Gem::Requirement
71
- none: false
72
83
  requirements:
73
- - - ! '>='
84
+ - - '>='
74
85
  - !ruby/object:Gem::Version
75
86
  version: '0'
76
- segments:
77
- - 0
78
- hash: 4198026442525368537
79
87
  required_rubygems_version: !ruby/object:Gem::Requirement
80
- none: false
81
88
  requirements:
82
- - - ! '>='
89
+ - - '>='
83
90
  - !ruby/object:Gem::Version
84
91
  version: '0'
85
- segments:
86
- - 0
87
- hash: 4198026442525368537
88
92
  requirements: []
89
93
  rubyforge_project:
90
- rubygems_version: 1.8.24
94
+ rubygems_version: 2.0.0
91
95
  signing_key:
92
- specification_version: 3
96
+ specification_version: 4
93
97
  summary: Instala inflections, locales y templates de scaffold para trabajar en Español.
94
98
  test_files:
95
99
  - spec/inflections_spec.rb