Class: Sawsge::Resource
- Inherits:
-
Object
- Object
- Sawsge::Resource
- Defined in:
- lib/resource.rb
Overview
Any generic file in the website directory
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(path) ⇒ Resource
constructor
A new instance of Resource.
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
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/resource.rb', line 6 def path @path end |
Instance Method Details
#build ⇒ Object
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 |