Class: Kia::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/kia/cli.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



27
28
29
30
31
32
33
# File 'lib/kia/cli.rb', line 27

def build
  if File.exist?("config.ru")
    Kia::Commands::Build.start
  else
    puts "Hold on mate, you'll need to initialize a Kia project (kia init NAME) to be able to make posts."
  end
end

#create(name) ⇒ Object



12
13
14
15
# File 'lib/kia/cli.rb', line 12

def create(name)
  Kia::Commands::Create.start([name])
  puts "The project, #{name}, was created successfully"
end

#post(name) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/kia/cli.rb', line 18

def post(name)
  if File.exist?("config.ru")
    Kia::Commands::Post.start([name])
  else
    puts "Hold on mate, you'll need to initialize a Kia project (kia init NAME) to be able to make posts."
  end
end

#serverObject



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

def server
  if File.exist?("config.ru")
    Kia::Commands::Serve.start
  else
    puts "Hold on mate, you'll need to initialize a Kia project (kia init NAME) to be able to make posts."
  end
end