Permalink
Browse files

[+] rails_footnotes install generator

  • Loading branch information...
1 parent 3002f02 commit 3174e14d3ceff8468b40c790e5f76a445ae6af4f @romanvbabenko romanvbabenko committed Sep 10, 2011
Showing with 22 additions and 0 deletions.
  1. +17 −0 lib/generators/rails_footnotes/install_generator.rb
  2. +5 −0 lib/generators/templates/rails_footnotes.rb
@@ -0,0 +1,17 @@
+module RailsFootnotes
+ module Generators
+ class InstallGenerator < Rails::Generators::Base
+ source_root File.expand_path("../../templates", __FILE__)
+
+ desc "Creates and copy RailsFootnotes default files to your application."
+
+ def copy_initializer
+ template "rails_footnotes.rb", "config/initializers/rails_footnotes.rb"
+ end
+
+ def copy_dotfile
+ template ".rails_footnotes", ".rails_footnotes"
+ end
+ end
+ end
+end
@@ -0,0 +1,5 @@
+if defined?(Footnotes) && Rails.env.development?
+ Footnotes.run! # first of all
+
+ # ... other init code
+end

0 comments on commit 3174e14

Please sign in to comment.