Module: Totem
- Defined in:
- lib/totem.rb,
lib/totem/shell.rb,
lib/totem/version.rb,
lib/totem/shell_cmds/new.rb,
lib/totem/shell_cmds/base.rb,
lib/totem/shell_cmds/console.rb
Defined Under Namespace
Modules: ShellCmds
Classes: Shell
Constant Summary
collapse
- VERSION =
'0.0.5'
Class Method Summary
collapse
Class Method Details
.component ⇒ Object
36
37
38
|
# File 'lib/totem.rb', line 36
def self.component
return @component ||= ENV['TOTEM_COMPONENT']
end
|
.env ⇒ Object
28
29
30
|
# File 'lib/totem.rb', line 28
def self.env
return (@env ||= (ENV['TOTEM_ENV'] || 'development'))
end
|
.initialize(root) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/totem.rb', line 10
def self.initialize(root)
raise 'Already initialized.' if @setup
@setup = true
@root = root
Bundler.require(Totem.env.to_sym)
run_callbacks(:before_load_app)
$LOAD_PATH.unshift(root + '/app')
load_app
run_callbacks(:after_load_app)
return true
end
|
.instance ⇒ Object
40
41
42
|
# File 'lib/totem.rb', line 40
def self.instance
return @instance || ENV['TOTEM_INSTANCE']
end
|
.load_app ⇒ Object
32
33
34
|
# File 'lib/totem.rb', line 32
def self.load_app
require "#{Totem.root}/app/loader.rb"
end
|
.logger ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/totem.rb', line 48
def self.logger
return @logger if @logger
log_to_file
return @logger
end
|
.logger=(val) ⇒ Object
44
45
46
|
# File 'lib/totem.rb', line 44
def self.logger=(val)
return @logger = val
end
|
.register_callback(type, callback = nil, &block) ⇒ Object
56
57
58
59
60
61
|
# File 'lib/totem.rb', line 56
def self.register_callback(type, callback=nil, &block)
@callbacks ||= {}
(@callbacks[type] ||= []) << (callback || block)
return true
end
|
.root ⇒ Object
24
25
26
|
# File 'lib/totem.rb', line 24
def self.root
return @root
end
|