Class: ClassicCMS::Cli

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

Class Method Summary collapse

Class Method Details

.command(arguments) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/classiccms/cli.rb', line 5

def self.command(arguments)
  case arguments[0]
  when 'new'
    if arguments[1] == nil
      puts 'hmm you are using the command wrong: classicCMS new [app name]'
    elsif File::directory? arguments[1]
      puts 'hmm I think that app already exists!'
    else
      app_name = arguments[1]
      FileUtils.cp_r File.dirname(__FILE__) + '/scaffold',  Dir.pwd + "/#{app_name}"

      puts "#{app_name} created!"
    end
  when 'server'
    puts 'going to start server...'
  else
    puts "you are so smart! I don't know what you mean!"
  end
end