Class: Ditty::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ditty/cli.rb

Instance Method Summary collapse

Instance Method Details

#migrateObject



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/ditty/cli.rb', line 36

def migrate
  # Prep Ditty
  Rake::Task['ditty:prep'].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

#serverObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ditty/cli.rb', line 16

def server
  # Ensure the token files are present
  Rake::Task['ditty:generate_tokens'].invoke

  # Prep Ditty
  Rake::Task['ditty:prep'].invoke

  # Check the migrations
  Rake::Task['ditty:migrate:check'].invoke

  # Seed Ditty DB
  puts 'Seeding the Ditty DB'
  Rake::Task['ditty:seed'].invoke

  # RackUP!
  puts 'Starting the Ditty Server'
  Rack::Server.start(config: 'config.ru')
end