Class: Razor::Site

Inherits:
Directory show all
Defined in:
lib/razor/generable.rb

Instance Attribute Summary collapse

Attributes inherited from Directory

#files

Attributes inherited from Generable

#parent, #src_name

Instance Method Summary collapse

Methods inherited from Directory

#generate, #http, #request

Methods inherited from Generable

#http

Constructor Details

#initialize(src, dest, url_base = '/') ⇒ Site

Returns a new instance of Site.



97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/razor/generable.rb', line 97

def initialize(src, dest, url_base='/')
	View.reset_instances!
	@src, @dest, @url = src, dest, url_base
	View.layouts_path = File.join(src, '_layouts/')
	View.url_base = url
	 Razor.load '_init.rb' rescue nil
rescue LoadError
	$!.message =~ /^no such file to load -- (.+)$/
	puts "Can't load #{$1} file"
ensure
	super(nil, nil)
end

Instance Attribute Details

#destObject (readonly)

Returns the value of attribute dest.



96
97
98
# File 'lib/razor/generable.rb', line 96

def dest
  @dest
end

#srcObject (readonly)

Returns the value of attribute src.



96
97
98
# File 'lib/razor/generable.rb', line 96

def src
  @src
end

#urlObject (readonly)

Returns the value of attribute url.



96
97
98
# File 'lib/razor/generable.rb', line 96

def url
  @url
end