Class: Kraken::App
- Inherits:
-
Object
- Object
- Kraken::App
- Defined in:
- lib/kraken/core/app.rb
Overview
This class are used for load and create kraken applications!
Class Method Summary collapse
- .create_app(name) ⇒ Object
- .load_app ⇒ Object
- .print_help ⇒ Object
- .print_version ⇒ Object
- .start_console ⇒ Object
- .start_server ⇒ Object
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_app ⇒ Object
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 |
.print_help ⇒ Object
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 |
.print_version ⇒ Object
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_console ⇒ Object
37 38 39 40 |
# File 'lib/kraken/core/app.rb', line 37 def self.start_console IRB.start(__FILE__) exit 0 end |