forked from indirect/rails-footnotes
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[+] rails_footnotes install generator
- Loading branch information
1 parent
3002f02
commit 3174e14
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
if defined?(Footnotes) && Rails.env.development? | |||
Footnotes.run! # first of all | |||
|
|||
# ... other init code | |||
end |