nifty-generators 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/CHANGELOG +9 -0
  2. data/LICENSE +1 -1
  3. data/README.rdoc +16 -24
  4. data/Rakefile +0 -13
  5. data/test/test_helper.rb +4 -2
  6. data/test/test_nifty_authentication_generator.rb +39 -1
  7. metadata +18 -114
  8. data/Manifest +0 -100
  9. data/TODO +0 -7
  10. data/nifty-generators.gemspec +0 -169
  11. data/rails_generators/nifty_authentication/USAGE +0 -50
  12. data/rails_generators/nifty_authentication/lib/insert_commands.rb +0 -74
  13. data/rails_generators/nifty_authentication/nifty_authentication_generator.rb +0 -128
  14. data/rails_generators/nifty_authentication/templates/authentication.rb +0 -61
  15. data/rails_generators/nifty_authentication/templates/authlogic_session.rb +0 -2
  16. data/rails_generators/nifty_authentication/templates/fixtures.yml +0 -24
  17. data/rails_generators/nifty_authentication/templates/migration.rb +0 -20
  18. data/rails_generators/nifty_authentication/templates/sessions_controller.rb +0 -45
  19. data/rails_generators/nifty_authentication/templates/sessions_helper.rb +0 -2
  20. data/rails_generators/nifty_authentication/templates/tests/rspec/sessions_controller.rb +0 -39
  21. data/rails_generators/nifty_authentication/templates/tests/rspec/user.rb +0 -83
  22. data/rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb +0 -26
  23. data/rails_generators/nifty_authentication/templates/tests/shoulda/sessions_controller.rb +0 -40
  24. data/rails_generators/nifty_authentication/templates/tests/shoulda/user.rb +0 -85
  25. data/rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb +0 -27
  26. data/rails_generators/nifty_authentication/templates/tests/testunit/sessions_controller.rb +0 -36
  27. data/rails_generators/nifty_authentication/templates/tests/testunit/user.rb +0 -88
  28. data/rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb +0 -23
  29. data/rails_generators/nifty_authentication/templates/user.rb +0 -42
  30. data/rails_generators/nifty_authentication/templates/users_controller.rb +0 -18
  31. data/rails_generators/nifty_authentication/templates/users_helper.rb +0 -2
  32. data/rails_generators/nifty_authentication/templates/views/erb/login.html.erb +0 -30
  33. data/rails_generators/nifty_authentication/templates/views/erb/signup.html.erb +0 -24
  34. data/rails_generators/nifty_authentication/templates/views/haml/login.html.haml +0 -30
  35. data/rails_generators/nifty_authentication/templates/views/haml/signup.html.haml +0 -24
  36. data/rails_generators/nifty_config/USAGE +0 -23
  37. data/rails_generators/nifty_config/nifty_config_generator.rb +0 -32
  38. data/rails_generators/nifty_config/templates/config.yml +0 -8
  39. data/rails_generators/nifty_config/templates/load_config.rb +0 -2
  40. data/rails_generators/nifty_layout/USAGE +0 -25
  41. data/rails_generators/nifty_layout/nifty_layout_generator.rb +0 -44
  42. data/rails_generators/nifty_layout/templates/helper.rb +0 -22
  43. data/rails_generators/nifty_layout/templates/layout.html.erb +0 -22
  44. data/rails_generators/nifty_layout/templates/layout.html.haml +0 -19
  45. data/rails_generators/nifty_layout/templates/stylesheet.css +0 -81
  46. data/rails_generators/nifty_layout/templates/stylesheet.sass +0 -67
  47. data/rails_generators/nifty_scaffold/USAGE +0 -51
  48. data/rails_generators/nifty_scaffold/nifty_scaffold_generator.rb +0 -232
  49. data/rails_generators/nifty_scaffold/templates/actions/create.rb +0 -9
  50. data/rails_generators/nifty_scaffold/templates/actions/destroy.rb +0 -6
  51. data/rails_generators/nifty_scaffold/templates/actions/edit.rb +0 -3
  52. data/rails_generators/nifty_scaffold/templates/actions/index.rb +0 -3
  53. data/rails_generators/nifty_scaffold/templates/actions/new.rb +0 -3
  54. data/rails_generators/nifty_scaffold/templates/actions/show.rb +0 -3
  55. data/rails_generators/nifty_scaffold/templates/actions/update.rb +0 -9
  56. data/rails_generators/nifty_scaffold/templates/controller.rb +0 -3
  57. data/rails_generators/nifty_scaffold/templates/fixtures.yml +0 -9
  58. data/rails_generators/nifty_scaffold/templates/helper.rb +0 -2
  59. data/rails_generators/nifty_scaffold/templates/migration.rb +0 -16
  60. data/rails_generators/nifty_scaffold/templates/model.rb +0 -3
  61. data/rails_generators/nifty_scaffold/templates/tests/rspec/actions/create.rb +0 -11
  62. data/rails_generators/nifty_scaffold/templates/tests/rspec/actions/destroy.rb +0 -6
  63. data/rails_generators/nifty_scaffold/templates/tests/rspec/actions/edit.rb +0 -4
  64. data/rails_generators/nifty_scaffold/templates/tests/rspec/actions/index.rb +0 -4
  65. data/rails_generators/nifty_scaffold/templates/tests/rspec/actions/new.rb +0 -4
  66. data/rails_generators/nifty_scaffold/templates/tests/rspec/actions/show.rb +0 -4
  67. data/rails_generators/nifty_scaffold/templates/tests/rspec/actions/update.rb +0 -11
  68. data/rails_generators/nifty_scaffold/templates/tests/rspec/controller.rb +0 -8
  69. data/rails_generators/nifty_scaffold/templates/tests/rspec/model.rb +0 -7
  70. data/rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb +0 -13
  71. data/rails_generators/nifty_scaffold/templates/tests/shoulda/actions/destroy.rb +0 -8
  72. data/rails_generators/nifty_scaffold/templates/tests/shoulda/actions/edit.rb +0 -6
  73. data/rails_generators/nifty_scaffold/templates/tests/shoulda/actions/index.rb +0 -6
  74. data/rails_generators/nifty_scaffold/templates/tests/shoulda/actions/new.rb +0 -6
  75. data/rails_generators/nifty_scaffold/templates/tests/shoulda/actions/show.rb +0 -6
  76. data/rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb +0 -13
  77. data/rails_generators/nifty_scaffold/templates/tests/shoulda/controller.rb +0 -5
  78. data/rails_generators/nifty_scaffold/templates/tests/shoulda/model.rb +0 -7
  79. data/rails_generators/nifty_scaffold/templates/tests/testunit/actions/create.rb +0 -11
  80. data/rails_generators/nifty_scaffold/templates/tests/testunit/actions/destroy.rb +0 -6
  81. data/rails_generators/nifty_scaffold/templates/tests/testunit/actions/edit.rb +0 -4
  82. data/rails_generators/nifty_scaffold/templates/tests/testunit/actions/index.rb +0 -4
  83. data/rails_generators/nifty_scaffold/templates/tests/testunit/actions/new.rb +0 -4
  84. data/rails_generators/nifty_scaffold/templates/tests/testunit/actions/show.rb +0 -4
  85. data/rails_generators/nifty_scaffold/templates/tests/testunit/actions/update.rb +0 -11
  86. data/rails_generators/nifty_scaffold/templates/tests/testunit/controller.rb +0 -5
  87. data/rails_generators/nifty_scaffold/templates/tests/testunit/model.rb +0 -7
  88. data/rails_generators/nifty_scaffold/templates/views/erb/_form.html.erb +0 -10
  89. data/rails_generators/nifty_scaffold/templates/views/erb/edit.html.erb +0 -14
  90. data/rails_generators/nifty_scaffold/templates/views/erb/index.html.erb +0 -29
  91. data/rails_generators/nifty_scaffold/templates/views/erb/new.html.erb +0 -7
  92. data/rails_generators/nifty_scaffold/templates/views/erb/show.html.erb +0 -20
  93. data/rails_generators/nifty_scaffold/templates/views/haml/_form.html.haml +0 -10
  94. data/rails_generators/nifty_scaffold/templates/views/haml/edit.html.haml +0 -14
  95. data/rails_generators/nifty_scaffold/templates/views/haml/index.html.haml +0 -25
  96. data/rails_generators/nifty_scaffold/templates/views/haml/new.html.haml +0 -7
  97. data/rails_generators/nifty_scaffold/templates/views/haml/show.html.haml +0 -20
  98. data/tasks/deployment.rake +0 -2
@@ -1,6 +0,0 @@
1
- it "destroy action should destroy model and redirect to index action" do
2
- <%= singular_name %> = <%= class_name %>.first
3
- delete :destroy, :id => <%= singular_name %>
4
- response.should redirect_to(<%= items_path('url') %>)
5
- <%= class_name %>.exists?(<%= singular_name %>.id).should be_false
6
- end
@@ -1,4 +0,0 @@
1
- it "edit action should render edit template" do
2
- get :edit, :id => <%= class_name %>.first
3
- response.should render_template(:edit)
4
- end
@@ -1,4 +0,0 @@
1
- it "index action should render index template" do
2
- get :index
3
- response.should render_template(:index)
4
- end
@@ -1,4 +0,0 @@
1
- it "new action should render new template" do
2
- get :new
3
- response.should render_template(:new)
4
- end
@@ -1,4 +0,0 @@
1
- it "show action should render show template" do
2
- get :show, :id => <%= class_name %>.first
3
- response.should render_template(:show)
4
- end
@@ -1,11 +0,0 @@
1
- it "update action should render edit template when model is invalid" do
2
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
3
- put :update, :id => <%= class_name %>.first
4
- response.should render_template(:edit)
5
- end
6
-
7
- it "update action should redirect when model is valid" do
8
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
9
- put :update, :id => <%= class_name %>.first
10
- response.should redirect_to(<%= item_path_for_spec('url') %>)
11
- end
@@ -1,8 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe <%= plural_class_name %>Controller do
4
- fixtures :all
5
- integrate_views
6
-
7
- <%= controller_methods 'tests/rspec/actions' %>
8
- end
@@ -1,7 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe <%= class_name %> do
4
- it "should be valid" do
5
- <%= class_name %>.new.should be_valid
6
- end
7
- end
@@ -1,13 +0,0 @@
1
- context "create action" do
2
- should "render new template when model is invalid" do
3
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
4
- post :create
5
- assert_template 'new'
6
- end
7
-
8
- should "redirect when model is valid" do
9
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
10
- post :create
11
- assert_redirected_to <%= item_path_for_test('url') %>
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- context "destroy action" do
2
- should "destroy model and redirect to index action" do
3
- <%= singular_name %> = <%= class_name %>.first
4
- delete :destroy, :id => <%= singular_name %>
5
- assert_redirected_to <%= items_path('url') %>
6
- assert !<%= class_name %>.exists?(<%= singular_name %>.id)
7
- end
8
- end
@@ -1,6 +0,0 @@
1
- context "edit action" do
2
- should "render edit template" do
3
- get :edit, :id => <%= class_name %>.first
4
- assert_template 'edit'
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- context "index action" do
2
- should "render index template" do
3
- get :index
4
- assert_template 'index'
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- context "new action" do
2
- should "render new template" do
3
- get :new
4
- assert_template 'new'
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- context "show action" do
2
- should "render show template" do
3
- get :show, :id => <%= class_name %>.first
4
- assert_template 'show'
5
- end
6
- end
@@ -1,13 +0,0 @@
1
- context "update action" do
2
- should "render edit template when model is invalid" do
3
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
4
- put :update, :id => <%= class_name %>.first
5
- assert_template 'edit'
6
- end
7
-
8
- should "redirect when model is valid" do
9
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
10
- put :update, :id => <%= class_name %>.first
11
- assert_redirected_to <%= item_path_for_test('url') %>
12
- end
13
- end
@@ -1,5 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= plural_class_name %>ControllerTest < ActionController::TestCase
4
- <%= controller_methods 'tests/shoulda/actions' %>
5
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= class_name %>Test < ActiveSupport::TestCase
4
- should "be valid" do
5
- assert <%= class_name %>.new.valid?
6
- end
7
- end
@@ -1,11 +0,0 @@
1
- def test_create_invalid
2
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
3
- post :create
4
- assert_template 'new'
5
- end
6
-
7
- def test_create_valid
8
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
9
- post :create
10
- assert_redirected_to <%= item_path_for_test('url') %>
11
- end
@@ -1,6 +0,0 @@
1
- def test_destroy
2
- <%= singular_name %> = <%= class_name %>.first
3
- delete :destroy, :id => <%= singular_name %>
4
- assert_redirected_to <%= items_path('url') %>
5
- assert !<%= class_name %>.exists?(<%= singular_name %>.id)
6
- end
@@ -1,4 +0,0 @@
1
- def test_edit
2
- get :edit, :id => <%= class_name %>.first
3
- assert_template 'edit'
4
- end
@@ -1,4 +0,0 @@
1
- def test_index
2
- get :index
3
- assert_template 'index'
4
- end
@@ -1,4 +0,0 @@
1
- def test_new
2
- get :new
3
- assert_template 'new'
4
- end
@@ -1,4 +0,0 @@
1
- def test_show
2
- get :show, :id => <%= class_name %>.first
3
- assert_template 'show'
4
- end
@@ -1,11 +0,0 @@
1
- def test_update_invalid
2
- <%= class_name %>.any_instance.stubs(:valid?).returns(false)
3
- put :update, :id => <%= class_name %>.first
4
- assert_template 'edit'
5
- end
6
-
7
- def test_update_valid
8
- <%= class_name %>.any_instance.stubs(:valid?).returns(true)
9
- put :update, :id => <%= class_name %>.first
10
- assert_redirected_to <%= item_path_for_test('url') %>
11
- end
@@ -1,5 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= plural_class_name %>ControllerTest < ActionController::TestCase
4
- <%= controller_methods 'tests/testunit/actions' %>
5
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class <%= class_name %>Test < ActiveSupport::TestCase
4
- def test_should_be_valid
5
- assert <%= class_name %>.new.valid?
6
- end
7
- end
@@ -1,10 +0,0 @@
1
- <%% form_for @<%= singular_name %> do |f| %>
2
- <%%= f.error_messages %>
3
- <%- for attribute in attributes -%>
4
- <p>
5
- <%%= f.label :<%= attribute.name %> %><br />
6
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
7
- </p>
8
- <%- end -%>
9
- <p><%%= f.submit "Submit" %></p>
10
- <%% end %>
@@ -1,14 +0,0 @@
1
- <%% title "Edit <%= singular_name.titleize %>" %>
2
-
3
- <%= render_form %>
4
-
5
- <%- if actions? :show, :index -%>
6
- <p>
7
- <%- if action? :show -%>
8
- <%%= link_to "Show", @<%= singular_name %> %> |
9
- <%- end -%>
10
- <%- if action? :index -%>
11
- <%%= link_to "View All", <%= plural_name %>_path %>
12
- <%- end -%>
13
- </p>
14
- <%- end -%>
@@ -1,29 +0,0 @@
1
- <%% title "<%= plural_name.titleize %>" %>
2
-
3
- <table>
4
- <tr>
5
- <%- for attribute in attributes -%>
6
- <th><%= attribute.column.human_name.titleize %></th>
7
- <%- end -%>
8
- </tr>
9
- <%% for <%= singular_name %> in @<%= plural_name %> %>
10
- <tr>
11
- <%- for attribute in attributes -%>
12
- <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
13
- <%- end -%>
14
- <%- if action? :show -%>
15
- <td><%%= link_to "Show", <%= singular_name %> %></td>
16
- <%- end -%>
17
- <%- if action? :edit -%>
18
- <td><%%= link_to "Edit", edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
19
- <%- end -%>
20
- <%- if action? :destroy -%>
21
- <td><%%= link_to "Destroy", <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
22
- <%- end -%>
23
- </tr>
24
- <%% end %>
25
- </table>
26
-
27
- <%- if action? :new -%>
28
- <p><%%= link_to "New <%= singular_name.titleize %>", new_<%= singular_name %>_path %></p>
29
- <%- end -%>
@@ -1,7 +0,0 @@
1
- <%% title "New <%= singular_name.titleize %>" %>
2
-
3
- <%= render_form %>
4
-
5
- <%- if action? :index -%>
6
- <p><%%= link_to "Back to List", <%= plural_name %>_path %></p>
7
- <%- end -%>
@@ -1,20 +0,0 @@
1
- <%% title "<%= singular_name.titleize %>" %>
2
-
3
- <%- for attribute in attributes -%>
4
- <p>
5
- <strong><%= attribute.column.human_name.titleize %>:</strong>
6
- <%%=h @<%= singular_name %>.<%= attribute.name %> %>
7
- </p>
8
- <%- end -%>
9
-
10
- <p>
11
- <%- if action? :edit -%>
12
- <%%= link_to "Edit", edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
13
- <%- end -%>
14
- <%- if action? :destroy -%>
15
- <%%= link_to "Destroy", @<%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %> |
16
- <%- end -%>
17
- <%- if action? :index -%>
18
- <%%= link_to "View All", <%= plural_name %>_path %>
19
- <%- end -%>
20
- </p>
@@ -1,10 +0,0 @@
1
- - form_for @<%= singular_name %> do |f|
2
- = f.error_messages
3
- <%- for attribute in attributes -%>
4
- %p
5
- = f.label :<%= attribute.name %>
6
- %br
7
- = f.<%= attribute.field_type %> :<%= attribute.name %>
8
- <%- end -%>
9
- %p
10
- = f.submit "Submit"
@@ -1,14 +0,0 @@
1
- - title "Edit <%= singular_name.titleize %>"
2
-
3
- <%= render_form %>
4
-
5
- <%- if actions? :show, :index -%>
6
- %p
7
- <%- if action? :show -%>
8
- = link_to "Show", <%= singular_name %>_path(@<%= singular_name %>)
9
- |
10
- <%- end -%>
11
- <%- if action? :index -%>
12
- = link_to "View All", <%= plural_name %>_path
13
- <%- end -%>
14
- <%- end -%>
@@ -1,25 +0,0 @@
1
- - title "<%= plural_name.titleize %>"
2
-
3
- %table
4
- %tr
5
- <%- for attribute in attributes -%>
6
- %th <%= attribute.column.human_name %>
7
- <%- end -%>
8
- - for <%= singular_name %> in @<%= plural_name %>
9
- %tr
10
- <%- for attribute in attributes -%>
11
- %td= h <%= singular_name %>.<%= attribute.name %>
12
- <%- end -%>
13
- <%- if action? :show -%>
14
- %td= link_to 'Show', <%= singular_name %>
15
- <%- end -%>
16
- <%- if action? :edit -%>
17
- %td= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>)
18
- <%- end -%>
19
- <%- if action? :destroy -%>
20
- %td= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete
21
- <%- end -%>
22
-
23
- <%- if actions? :new -%>
24
- %p= link_to "New <%= singular_name.titleize %>", new_<%= singular_name %>_path
25
- <%- end -%>
@@ -1,7 +0,0 @@
1
- - title "New <%= singular_name.titleize %>"
2
-
3
- <%= render_form %>
4
-
5
- <%- if action? :index -%>
6
- %p= link_to "Back to List", <%= plural_name %>_path
7
- <%- end -%>
@@ -1,20 +0,0 @@
1
- - title "<%= singular_name.titleize %>"
2
-
3
- <%- for attribute in attributes -%>
4
- %p
5
- %strong <%= attribute.column.human_name.titleize %>:
6
- =h @<%= singular_name %>.<%= attribute.name %>
7
- <%- end -%>
8
-
9
- %p
10
- <%- if action? :edit -%>
11
- = link_to "Edit", edit_<%= singular_name %>_path(@<%= singular_name %>)
12
- |
13
- <%- end -%>
14
- <%- if action? :destroy -%>
15
- = link_to "Destroy", @<%= singular_name %>, :confirm => 'Are you sure?', :method => :delete
16
- |
17
- <%- end -%>
18
- <%- if action? :index -%>
19
- = link_to "View All", <%= plural_name %>_path
20
- <%- end -%>
@@ -1,2 +0,0 @@
1
- desc "Build the manifest and gemspec files."
2
- task :build => [:build_manifest, :build_gemspec]