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



35
36
37
38
39
40
41
42
# File 'lib/ditty/cli.rb', line 35

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

  # Run the migrations
  Rake::Task['ditty:migrate:up'].invoke
  puts 'Ditty Migrations Executed'
end

#serverObject



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

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