Class: Ditty::CLI
Instance Method Summary collapse
Instance Method Details
#console ⇒ Object
80 81 82 |
# File 'lib/ditty/cli.rb', line 80 def console Rake::Task['ditty:console'].invoke end |
#migrate ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/ditty/cli.rb', line 62 def migrate # Prep Ditty Rake::Task['ditty:prep:migrations'].invoke # Run the migrations Rake::Task['ditty:migrate:up'].invoke puts 'Ditty Migrations Executed' Rake::Task['ditty:dump_schema'].invoke puts 'Ditty DB Schema Dumped' end |
#seed ⇒ Object
75 76 77 |
# File 'lib/ditty/cli.rb', line 75 def seed Rake::Task['ditty:seed'].invoke end |
#server ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ditty/cli.rb', line 35 def server # Ensure the token files are present Rake::Task['ditty:generate_tokens'].invoke # Prep Ditty Rake::Task['ditty:prep:folders'].invoke Rake::Task['ditty:prep:migrations'].invoke # Check the migrations Rake::Task['ditty:migrate:check'].invoke # Seed Ditty DB puts 'Seeding the Ditty DB' Rake::Task['ditty:seed'].invoke # RackUP! rack_opts = { environment: ENV['APP_ENV'] || 'development', Port: ENV['APP_PORT'] || 9292, Host: ENV['APP_HOST'] || '0.0.0.0', config: "config.ru" } puts 'Starting the Ditty Server' Rack::Server.start(rack_opts) end |