Class: Web

Inherits:
Abstract show all
Defined in:
lib/rad/configurators/web.rb

Instance Method Summary collapse

Methods inherited from Abstract

#initialize, #locales, #routes

Constructor Details

This class inherits a constructor from Abstract

Instance Method Details

#asset_paths(*relative_paths) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/rad/configurators/web.rb', line 2

def asset_paths *relative_paths
  relative_paths = relative_paths.first if relative_paths.first.is_a? Array
  relative_paths.each do |relative_path|
    path = "#{dir}/#{relative_path}"
    rad.assets.paths << path unless rad.assets.paths.include? path
  end
end

#autoload_paths(*relative_paths) ⇒ Object



28
29
30
31
# File 'lib/rad/configurators/web.rb', line 28

def autoload_paths *relative_paths
  relative_paths = relative_paths.first if relative_paths.first.is_a? Array        
  relative_paths.each{|d| autoload_dir "#{dir}/#{d}", true}
end

#load_paths(*relative_paths) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/rad/configurators/web.rb', line 10

def load_paths *relative_paths
  relative_paths = relative_paths.first if relative_paths.first.is_a? Array
  relative_paths.each do |relative_path|
    path = "#{dir}/#{relative_path}"
    $LOAD_PATH << path unless $LOAD_PATH.include? path
  end
end

#template_paths(*relative_paths) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/rad/configurators/web.rb', line 18

def template_paths *relative_paths
  rad.template
  
  relative_paths = relative_paths.first if relative_paths.first.is_a? Array
  relative_paths.each do |relative_path|
    path = "#{dir}/#{relative_path}"
    rad.template.paths << path unless rad.template.paths.include? path
  end
end