Class: BarchartData::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- BarchartData::Generators::InstallGenerator
- Defined in:
- lib/generators/barchart_data/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_classes ⇒ Object
36 37 38 39 40 41 |
# File 'lib/generators/barchart_data/install/install_generator.rb', line 36 def copy_classes copy_file "../../../../barchart_scripts/barchart_connection.rb", "lib/barchart_scripts/barchart_connection.rb" copy_file "../../../../barchart_scripts/scraper.rb", 'lib/barchart_scripts/scraper.rb' copy_file "../../../../barchart_scripts/scrape_new_highs_new_lows.rb", 'lib/barchart_scripts/scrape_new_highs_new_lows.rb' copy_file "../../../../../bin/barchart_data", 'bin/barchart' end |
#copy_migrations ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/generators/barchart_data/install/install_generator.rb', line 11 def copy_migrations time = Time.now.strftime("%Y%m%d%H%M%S") template "alltimehigh_migration.rb", "db/migrate/#{time}_create_all_time_highs.rb" sleep 2 time = Time.now.strftime("%Y%m%d%H%M%S") template 'newhigh_migration.rb', "db/migrate/#{time}_create_new_highs.rb" sleep 1 time = Time.now.strftime("%Y%m%d%H%M%S") template 'newlow_migration.rb', "db/migrate/#{time}_create_new_lows.rb" sleep 2 time = Time.now.strftime("%Y%m%d%H%M%S") template 'alltimelow_migration.rb', "db/migrate/#{time}_create_all_time_lows.rb" sleep 1 time = Time.now.strftime("%Y%m%d%H%M%S") template 'highlow_migration.rb', "db/migrate/#{time}_create_high_lows.rb" end |
#copy_models ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/generators/barchart_data/install/install_generator.rb', line 28 def copy_models template 'models/all_time_high.rb', 'app/models/all_time_high.rb' template 'models/all_time_low.rb', 'app/models/all_time_low.rb' template 'models/new_high.rb', 'app/models/new_high.rb' template 'models/new_low.rb', 'app/models/new_low.rb' template 'models/high_low.rb', 'app/models/high_low.rb' end |