Class: Kraken::App

Inherits:
Object
  • Object
show all
Defined in:
lib/kraken/core/app.rb

Overview

This class are used for load and create kraken applications!

Class Method Summary collapse

Class Method Details

.create_app(name) ⇒ Object



15
16
17
18
# File 'lib/kraken/core/app.rb', line 15

def self.create_app(name)
  { name.to_s => PROJECT_TREE }.create_project
  exit 0
end

.load_appObject



9
10
11
12
13
# File 'lib/kraken/core/app.rb', line 9

def self.load_app
  require_all 'app/validators' if File.exist? 'app/validators'
  require_all 'app' if File.exist? 'app'
  require_all 'config' if File.exist? 'config'
end


26
27
28
29
30
31
32
33
34
35
# File 'lib/kraken/core/app.rb', line 26

def self.print_help
  print_version
  puts 'kraken -n app_name: Create a new kraken app'
  puts 'kraken -s: start the created app'
  puts 'kraken -v: show the version'
  puts 'kraken -d: start a console'
  puts ''

  puts 'rake db:* for migrations operations. See more about ActiveRecord'
end


20
21
22
23
24
# File 'lib/kraken/core/app.rb', line 20

def self.print_version
  puts 'KrakenLab'
  puts "-v #{Kraken::VERSION}"
  exit 0
end

.start_consoleObject



37
38
39
40
# File 'lib/kraken/core/app.rb', line 37

def self.start_console
  IRB.start(__FILE__)
  exit 0
end

.start_serverObject



42
43
44
# File 'lib/kraken/core/app.rb', line 42

def self.start_server
  Kraken::Listener.new.join
end