Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[+] rails_footnotes install generator

  • Loading branch information...
commit 3174e14d3ceff8468b40c790e5f76a445ae6af4f 1 parent 3002f02
@romanvbabenko romanvbabenko authored
View
17 lib/generators/rails_footnotes/install_generator.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
View
5 lib/generators/templates/rails_footnotes.rb
@@ -0,0 +1,5 @@
+if defined?(Footnotes) && Rails.env.development?
+ Footnotes.run! # first of all
+
+ # ... other init code
+end
Please sign in to comment.
Something went wrong with that request. Please try again.