Class: TriumphGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- TriumphGenerator
- Defined in:
- lib/rails/generators/triumph/triumph_generator.rb
Instance Method Summary collapse
-
#copy_initializer_file ⇒ Object
Every method that is declared below will be automatically executed when the generator is run.
- #generate ⇒ Object
Instance Method Details
#copy_initializer_file ⇒ Object
Every method that is declared below will be automatically executed when the generator is run
14 15 16 |
# File 'lib/rails/generators/triumph/triumph_generator.rb', line 14 def copy_initializer_file copy_file 'initializer.rb', 'config/initializers/triumph.rb' end |
#generate ⇒ Object
7 8 9 10 11 |
# File 'lib/rails/generators/triumph/triumph_generator.rb', line 7 def generate copy_file "20110711040135_create_achievements.rb", "db/migrate/#{Time.now.utc.strftime("%Y%m%d%H%M%S")}_create_achievements.rb" copy_file "20110712025245_create_completed_achievements.rb", "db/migrate/#{(Time.now + 5.seconds).utc.strftime("%Y%m%d%H%M%S")}_create_completed_achievements.rb" copy_file "20110712033351_create_achievement_conditions.rb", "db/migrate/#{(Time.now + 10.seconds).utc.strftime("%Y%m%d%H%M%S")}_create_achievement_conditions.rb" end |