Class: Sawsge::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/resource.rb

Overview

Any generic file in the website directory

Direct Known Subclasses

Page

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Resource

Returns a new instance of Resource.



8
9
10
11
# File 'lib/resource.rb', line 8

def initialize(path)
  # Path is relative to SRC_DIR, does not include it
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/resource.rb', line 6

def path
  @path
end

Instance Method Details

#buildObject



13
14
15
16
# File 'lib/resource.rb', line 13

def build
  FileUtils.mkpath File.join(OUT_DIRNAME, File.dirname(@path))
  FileUtils.cp @path, File.join(OUT_DIRNAME, @path)
end