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



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

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



30
31
32
33
# File 'lib/rad/configurators/web.rb', line 30

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

#load_paths(*relative_paths) ⇒ Object



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

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



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

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