Permalink
Browse files

remove erubis generator

  • Loading branch information...
1 parent 0cdc57d commit 73cd9af0942aa3b2deee9c1f211ed834dca616d4 @negonicrac negonicrac committed Sep 11, 2012
View
@@ -6,6 +6,7 @@
* optimize
* MongoMapper generators removed. MongoMapper (https://github.com/jnunemaker/mongomapper) has its own generators.
* SimpleForm generators removed. SimpleForm (https://github.com/plataformatec/simple_form) has its own generators.
+ * Erubis generator removed.
== 0.17.5
* optimize
View
@@ -22,12 +22,6 @@ The MongoMapper generators moved to {the mongo_mapper gem}[https://github.com/jn
The SimpleForm generators moved to {the simple_form gem}[https://github.com/plataformatec/simple_form].
-To avoid overriding the rails built-in Erb template generators this project uses the namespace Erubis for *.erb templates
-
- config.generators do |g|
- g.template_engine :erubis
- end
-
== Note on Patches/Pull Requests
* Fork the project.
View
@@ -1,9 +0,0 @@
-module Erubis
- module Generators
- module TemplatePath
- def source_root
- @_haml_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'erubis', generator_name, 'templates'))
- end
- end
- end
-end
@@ -1,10 +0,0 @@
-require 'generators/erubis'
-require 'rails/generators/erb/controller/controller_generator'
-
-module Erubis
- module Generators
- class ControllerGenerator < Erb::Generators::ControllerGenerator
- extend TemplatePath
- end
- end
-end
@@ -1,2 +0,0 @@
-<h1><%= class_name %>#<%= @action %></h1>
-<p>Find me in <%= @path %></p>
@@ -1,25 +0,0 @@
-require 'generators/erubis'
-require 'rails/generators/erb/scaffold/scaffold_generator'
-
-module Erubis
- module Generators
- class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
- extend TemplatePath
-
- hook_for :form_builder, :as => :scaffold
-
- def copy_form_file
- if options[:form_builder].nil?
- filename = filename_with_extensions("_form")
- template filename, File.join("app/views", controller_file_path, filename)
- end
- end
-
- protected
-
- def available_views
- %w(index edit show new)
- end
- end
- end
-end
@@ -1,23 +0,0 @@
-<%%= form_for(@<%= singular_name %>) do |f| %>
- <%% if @<%= singular_name %>.errors.any? %>
- <div id="error_explanation">
- <h2><%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:</h2>
-
- <ul>
- <%% @<%= singular_name %>.errors.full_messages.each do |msg| %>
- <li><%%= msg %></li>
- <%% end %>
- </ul>
- </div>
- <%% end %>
-
-<% for attribute in attributes -%>
- <div class="field">
- <%%= f.label :<%= attribute.name %> %><br />
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
- </div>
-<% end -%>
- <div class="actions">
- <%%= f.submit %>
- </div>
-<%% end %>
@@ -1,6 +0,0 @@
-<h1>Editing <%= singular_name %></h1>
-
-<%%= render 'form' %>
-
-<%%= link_to 'Show', @<%= singular_name %> %> |
-<%%= link_to 'Back', <%= plural_name %>_path %>
@@ -1,27 +0,0 @@
-<h1>Listing <%= plural_name %></h1>
-
-<table>
- <tr>
-<% for attribute in attributes -%>
- <th><%= attribute.human_name %></th>
-<% end -%>
- <th></th>
- <th></th>
- <th></th>
- </tr>
-
-<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
- <tr>
-<% for attribute in attributes -%>
- <td><%%= <%= singular_name %>.<%= attribute.name %> %></td>
-<% end -%>
- <td><%%= link_to 'Show', <%= singular_name %> %></td>
- <td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
- <td><%%= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
- </tr>
-<%% end %>
-</table>
-
-<br />
-
-<%%= link_to 'New <%= human_name %>', new_<%= singular_name %>_path %>
@@ -1,5 +0,0 @@
-<h1>New <%= singular_name %></h1>
-
-<%%= render 'form' %>
-
-<%%= link_to 'Back', <%= plural_name %>_path %>
@@ -1,12 +0,0 @@
-<p id="notice"><%%= notice %></p>
-
-<% for attribute in attributes -%>
-<p>
- <b><%= attribute.human_name %>:</b>
- <%%= @<%= singular_name %>.<%= attribute.name %> %>
-</p>
-
-<% end -%>
-
-<%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
-<%%= link_to 'Back', <%= plural_name %>_path %>
View
@@ -38,7 +38,7 @@ module Rails3Generators
]
end
-%w(erb erubis haml mustache).each do |template|
+%w(erb haml mustache).each do |template|
Rails::Generators.hidden_namespaces <<
[
"#{template}:controller",
@@ -1,16 +0,0 @@
-require 'test_helper'
-
-class Erubis::Generators::ControllerGeneratorTest < Rails::Generators::TestCase
- destination File.join(Rails.root)
- tests Rails::Generators::ControllerGenerator
- arguments %w(Account foo bar --template-engine erubis)
-
- setup :prepare_destination
- setup :copy_routes
-
- test "should invoke template engine" do
- run_generator
- assert_file "app/views/account/foo.html.erb", %r(app/views/account/foo\.html\.erb)
- assert_file "app/views/account/bar.html.erb", %r(app/views/account/bar\.html\.erb)
- end
-end
@@ -1,30 +0,0 @@
-require 'test_helper'
-
-class Erubis::Generators::ScaffoldGeneratorTest < Rails::Generators::TestCase
- destination File.join(Rails.root)
- tests Rails::Generators::ScaffoldGenerator
- arguments %w(product_line title:string price:integer --template-engine erubis)
-
- setup :prepare_destination
- setup :copy_routes
-
- test "should invoke template engine" do
- run_generator
-
- %w(index edit new show _form).each { |view| assert_file "app/views/product_lines/#{view}.html.erb" }
- assert_no_file "app/views/layouts/product_lines.html.erb"
- end
-
- test "should revoke template engine" do
- run_generator
- run_generator ["product_line"], :behavior => :revoke
-
- assert_no_file "app/views/product_lines"
- assert_no_file "app/views/layouts/product_lines.html.erb"
- end
-
- test "should invoke form builder" do
- run_generator %w(product_line title:string price:integer --template-engine erubis --form-builder some-form-builder)
- assert_no_file "app/views/product_lines/_form.html.erb"
- end
-end
@@ -11,9 +11,4 @@ class Formtastic::Generators::FormBuilderGeneratorTest < Rails::Generators::Test
run_generator %w(product_line title:string price:integer --template-engine haml --form-builder formtastic)
assert_file "app/views/product_lines/_form.html.haml"
end
-
- test "should invoke form builder and output erubis form" do
- run_generator %w(product_line title:string price:integer --template-engine erubis --form-builder formtastic)
- assert_file "app/views/product_lines/_form.html.erb"
- end
end
View
@@ -48,7 +48,6 @@ def assert_class(klass, content)
def generator_list
{
:rails => ['scaffold', 'controller'],
- :erubis => ['scaffold'],
:formtastic => ['scaffold'],
:authlogic => ['session'],
:koala => ['install'],

0 comments on commit 73cd9af

Please sign in to comment.