Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove the huge block of comments in the generated routes file

  • Loading branch information...
commit 0c7a3a6de5d52cdd062c5b0fd810efb627296574 1 parent 5471511
@mjankowski mjankowski authored
View
4 lib/suspenders/app_builder.rb
@@ -179,6 +179,10 @@ def setup_root_route
route "root :to => 'Clearance::Sessions#new'"
end
+ def remove_routes_comment_lines
+ replace_in_file 'config/routes.rb', /Application\.routes\.draw do.*end/m, "Application.routes.draw do\nend"
+ end
+
def set_attr_accessibles_on_user
inject_into_file 'app/models/user.rb',
' attr_accessible :email, :password\n',
View
5 lib/suspenders/generators/app_generator.rb
@@ -33,6 +33,7 @@ def suspenders_customization
invoke :setup_stylesheets
invoke :copy_miscellaneous_files
invoke :customize_error_pages
+ invoke :remove_routes_comment_lines
invoke :setup_root_route
invoke :setup_git
invoke :create_heroku_apps
@@ -153,6 +154,10 @@ def customize_error_pages
build :customize_error_pages
end
+ def remove_routes_comment_lines
+ build :remove_routes_comment_lines
+ end
+
def setup_root_route
if options[:clearance]
say 'Setting up a root route'
Please sign in to comment.
Something went wrong with that request. Please try again.