Module: Nova

Defined in:
lib/cocoanova/task.rb,
lib/cocoanova.rb,
lib/cocoanova/engine.rb,
lib/cocoanova/helper.rb,
lib/cocoanova/loader.rb,
lib/cocoanova/version.rb

Overview

Task System

Defined Under Namespace

Modules: Helper Classes: Engine, Loader, Task

Constant Summary collapse

Plugins =
[]
VERSION =
"1.0.0"
@@local_root =
nil
@@src_root =
nil
@@data =
{}

Class Method Summary collapse

Class Method Details

.dataObject

Global data



23
24
25
# File 'lib/cocoanova.rb', line 23

def self.data
    @@data
end

.data=(value) ⇒ Object



27
28
29
# File 'lib/cocoanova.rb', line 27

def self.data=(value)
    @@data = value
end

.local_rootObject

Get local nova root



47
48
49
# File 'lib/cocoanova.rb', line 47

def self.local_root
    @@local_root
end

.local_root=(value) ⇒ Object

Set local nova root



52
53
54
# File 'lib/cocoanova.rb', line 52

def self.local_root=(value)
    @@local_root = value
end

.preset_pathObject

Get preset_path, i.e. lib/cocoanova



32
33
34
# File 'lib/cocoanova.rb', line 32

def self.preset_path
    File.expand_path('../cocoanova', __FILE__)
end

.register_plugin(path) ⇒ Object

Register Plugin



18
19
20
# File 'lib/cocoanova.rb', line 18

def self.register_plugin(path)
    Plugins << path
end

.require_folder(folder) ⇒ Object

Require a folder in both preset path and local path



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/cocoanova.rb', line 57

def self.require_folder(folder)
    # Require folder from preset path, i.e. lib/cocoanova/
    Dir["#{self.preset_path}/#{folder}/**/*.rb"].each do |file|
        require file
    end
    # Load Plugins
    Plugins.each do |path|
        Dir["#{path}/#{folder}/**/*.rb"].each do |file|
            require file
        end
    end
    # Require folder from local nova path, i.e. ./nova/
    if self.local_root
        Dir["#{self.local_root}/#{folder}/**/*.rb"].each do |file|
            require file
        end
    end
end

.src_rootObject

Get project root



37
38
39
# File 'lib/cocoanova.rb', line 37

def self.src_root
    @@src_root
end

.src_root=(value) ⇒ Object

Set project root



42
43
44
# File 'lib/cocoanova.rb', line 42

def self.src_root=(value)
    @@src_root= value
end