Skip to content

Commit

Permalink
[+] rails_footnotes install generator
Browse files Browse the repository at this point in the history
  • Loading branch information
nordringrayhide committed Sep 10, 2011
1 parent 3002f02 commit 3174e14
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 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
5 changes: 5 additions & 0 deletions 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

0 comments on commit 3174e14

Please sign in to comment.