Class: Summoner::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Summoner::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/summoner/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #copy_migrations ⇒ Object
- #create_features_yml ⇒ Object
- #create_initializer ⇒ Object
- #show_readme ⇒ Object
Class Method Details
.next_migration_number(dirname) ⇒ Object
48 49 50 |
# File 'lib/generators/summoner/install/install_generator.rb', line 48 def self.next_migration_number(dirname) Time.now.utc.strftime('%Y%m%d%H%M%S') end |
Instance Method Details
#copy_migrations ⇒ Object
23 24 25 26 |
# File 'lib/generators/summoner/install/install_generator.rb', line 23 def copy_migrations say 'Creating migration...', :green migration_template 'create_summoner_tables.rb.erb', 'db/migrate/create_summoner_tables.rb' end |
#create_features_yml ⇒ Object
18 19 20 21 |
# File 'lib/generators/summoner/install/install_generator.rb', line 18 def create_features_yml say 'Creating features.yml template...', :green copy_file 'features.yml', 'config/features.yml' end |
#create_initializer ⇒ Object
13 14 15 16 |
# File 'lib/generators/summoner/install/install_generator.rb', line 13 def create_initializer say 'Creating initializer...', :green copy_file 'summoner.rb', 'config/initializers/summoner.rb' end |
#show_readme ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/generators/summoner/install/install_generator.rb', line 28 def show_readme readme_text = <<~README ============================================================================== Welcome to... ██████ ▄▄ ▄▄ ▄▄▄▄▄ ▄█████ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄ ██ ██▄██ ██▄▄ ▀▀▀▄▄▄ ██ ██ ██▀▄▀██ ██▀▄▀██ ██▀██ ███▄██ ██ ███▄██ ██ ▄▄ ██ ██ ██ ██▄▄▄ █████▀ ▀███▀ ██ ██ ██ ██ ▀███▀ ██ ▀██ ██ ██ ▀██ ▀███▀ Next steps: 1. Run `rails db:migrate` to create the tables. 2. Edit your new `config/features.yml` file as desired. 3. Run `rails summoner:sync` to save the features to the database! ============================================================================== README puts readme_text end |