Class: Razor::GenerableFile

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

Direct Known Subclasses

RegularFile, ViewFile

Instance Attribute Summary

Attributes inherited from Generable

#parent, #src_name

Instance Method Summary collapse

Methods inherited from Generable

#dest, #http, #initialize, #src, #url

Constructor Details

This class inherits a constructor from Razor::Generable

Instance Method Details

#contentsObject



39
40
41
# File 'lib/razor/generable.rb', line 39

def contents
	File.read(src, :mode=>'rb')
end

#dest_extObject



51
52
53
# File 'lib/razor/generable.rb', line 51

def dest_ext
	File.extname(dest_name)
end

#generateObject



43
44
45
# File 'lib/razor/generable.rb', line 43

def generate
	File.open(dest, 'wb') { |f| f << contents }
end

#requestObject



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

def request
	self
end