Class: Embargo

Inherits:
Object show all
Defined in:
lib/embargo.rb

Class Method Summary collapse

Class Method Details

.action(&block) ⇒ Object


43
44
45
46
# File 'lib/embargo.rb', line 43

def self.action(&block)
  @@actions ||= Array.new
  @@actions.push(block)
end

.actionsObject


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

def self.actions
  $actions ||= @@actions
end

.app_directoryObject


20
21
22
# File 'lib/embargo.rb', line 20

def self.app_directory
	@@magis_working_directory ||= Dir.pwd
end

.applicationObject


17
18
19
# File 'lib/embargo.rb', line 17

def self.application
	Pages
end

.directoryObject


24
25
26
# File 'lib/embargo.rb', line 24

def self.directory
	@@magis_directory ||= __FILE__
end

.first_load?Boolean

Returns:

  • (Boolean)

50
51
52
# File 'lib/embargo.rb', line 50

def self.first_load?
  !$actions
end

.require_file(file_name) ⇒ Object


28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/embargo.rb', line 28

def self.require_file(file_name)
	project_file_name = Embargo.app_directory + "/" + file_name
	project_file_exists = File.exist?(project_file_name)

   if project_file_exists
     require project_file_name
   else
 		embargo_file_name = Embargo.directory + "/" + file_name
 		embargo_file_exists = File.exist?(embargo_file_name)
     if embargo_file_exists
       require embargo_file_name
     end
   end
end