Module: Rad::CliHelper

Defined in:
lib/rad_ext/utils/cli_helper.rb

Constant Summary collapse

RUNTIME_DIR =
'runtime'

Class Method Summary collapse

Class Method Details

.run_consoleObject



7
8
9
10
11
12
# File 'lib/rad_ext/utils/cli_helper.rb', line 7

def run_console
  prepare_running_environment

  require 'irb'
  IRB.start        
end

.run_serverObject



14
15
16
17
18
# File 'lib/rad_ext/utils/cli_helper.rb', line 14

def run_server
  app = prepare_running_environment
  
  rad.http.run app, rad.http.host, rad.http.port
end

.use_runtime_path!Object



20
21
22
23
# File 'lib/rad_ext/utils/cli_helper.rb', line 20

def use_runtime_path!
  runtime_path = "./#{RUNTIME_DIR}"
  Dir.chdir runtime_path if Dir.exist? runtime_path
end