Module: Nezu::CLI

Defined in:
lib/nezu/cli.rb

Class Method Summary collapse

Class Method Details

.console(params = {}) ⇒ Object



30
31
32
33
34
# File 'lib/nezu/cli.rb', line 30

def self.console(params={})
  puts %Q(Starting console...)
  Nezu::Runtime.load_config
  IRB.start()
end

.new(params = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/nezu/cli.rb', line 5

def self.new(params={})
  puts %Q(Creating application dir in "#{params[:app]}")
  require 'nezu/generators'
  app = Nezu::Generators::Application::AppGenerator.new(params[:app])
  app.generate!
  puts %Q(Successfully created App.)
  exit(0)
end

.run(params = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/nezu/cli.rb', line 14

def self.run(params={})
  puts %Q(Starting app...)
  require 'nezu/runner'
  Nezu::Runtime.load_config
  if params[:daemon]
    $stdout=File.open(Nezu.root.join('log', 'nezu.stdout'), File::CREAT|File::WRONLY)
    $stderr=File.open(Nezu.root.join('log', 'nezu.stderr'), File::CREAT|File::WRONLY)
    fork do
      Nezu::Runner.start
    end
  else
    Nezu::Runner.start
  end
  exit(0)
end