Class: Awestruct::Config
- Inherits:
-
Object
- Object
- Awestruct::Config
- Defined in:
- lib/awestruct/config.rb
Instance Attribute Summary collapse
-
#config_dir ⇒ Object
Returns the value of attribute config_dir.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#extension_dir ⇒ Object
Returns the value of attribute extension_dir.
-
#ignore ⇒ Object
Returns the value of attribute ignore.
-
#images_dir ⇒ Object
Returns the value of attribute images_dir.
-
#input_dir ⇒ Object
Returns the value of attribute input_dir.
-
#layouts_dir ⇒ Object
Returns the value of attribute layouts_dir.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#skin_dir ⇒ Object
Returns the value of attribute skin_dir.
-
#stylesheets_dir ⇒ Object
Returns the value of attribute stylesheets_dir.
-
#tmp_dir ⇒ Object
Returns the value of attribute tmp_dir.
-
#track_dependencies ⇒ Object
Returns the value of attribute track_dependencies.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(dir = Dir.pwd) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(dir = Dir.pwd) ⇒ Config
Returns a new instance of Config.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/awestruct/config.rb', line 22 def initialize(dir = Dir.pwd) @dir = Pathname.new( dir ) @layouts_dir = Pathname.new( File.join(dir, '_layouts') ) @config_dir = Pathname.new( File.join(dir, '_config') ) @input_dir = Pathname.new( File.join(dir, '') ) @output_dir = Pathname.new( File.join(dir, '_site') ) @extension_dir = Pathname.new( File.join(dir, '_ext') ) @skin_dir = Pathname.new( File.join(dir, '_skin') ) @tmp_dir = Pathname.new( File.join(dir, '_tmp') ) @images_dir = Pathname.new( File.join(dir, 'images') ) @stylesheets_dir = Pathname.new( File.join(dir, 'stylesheets') ) # Dir[] doesn't like empty list ignore_file = File.join(dir, ".awestruct_ignore") if File.exists?(ignore_file) ignore_stmts = IO.read(ignore_file).each_line.map(&:strip) end @ignore = (!ignore_stmts.nil? and ignore_stmts.size > 0) ? Dir[*ignore_stmts] : [] @track_dependencies = false end |
Instance Attribute Details
#config_dir ⇒ Object
Returns the value of attribute config_dir.
8 9 10 |
# File 'lib/awestruct/config.rb', line 8 def config_dir @config_dir end |
#dir ⇒ Object
Returns the value of attribute dir.
6 7 8 |
# File 'lib/awestruct/config.rb', line 6 def dir @dir end |
#extension_dir ⇒ Object
Returns the value of attribute extension_dir.
9 10 11 |
# File 'lib/awestruct/config.rb', line 9 def extension_dir @extension_dir end |
#ignore ⇒ Object
Returns the value of attribute ignore.
14 15 16 |
# File 'lib/awestruct/config.rb', line 14 def ignore @ignore end |
#images_dir ⇒ Object
Returns the value of attribute images_dir.
17 18 19 |
# File 'lib/awestruct/config.rb', line 17 def images_dir @images_dir end |
#input_dir ⇒ Object
Returns the value of attribute input_dir.
10 11 12 |
# File 'lib/awestruct/config.rb', line 10 def input_dir @input_dir end |
#layouts_dir ⇒ Object
Returns the value of attribute layouts_dir.
7 8 9 |
# File 'lib/awestruct/config.rb', line 7 def layouts_dir @layouts_dir end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
11 12 13 |
# File 'lib/awestruct/config.rb', line 11 def output_dir @output_dir end |
#skin_dir ⇒ Object
Returns the value of attribute skin_dir.
12 13 14 |
# File 'lib/awestruct/config.rb', line 12 def skin_dir @skin_dir end |
#stylesheets_dir ⇒ Object
Returns the value of attribute stylesheets_dir.
18 19 20 |
# File 'lib/awestruct/config.rb', line 18 def stylesheets_dir @stylesheets_dir end |
#tmp_dir ⇒ Object
Returns the value of attribute tmp_dir.
13 14 15 |
# File 'lib/awestruct/config.rb', line 13 def tmp_dir @tmp_dir end |
#track_dependencies ⇒ Object
Returns the value of attribute track_dependencies.
15 16 17 |
# File 'lib/awestruct/config.rb', line 15 def track_dependencies @track_dependencies end |
#verbose ⇒ Object
Returns the value of attribute verbose.
20 21 22 |
# File 'lib/awestruct/config.rb', line 20 def verbose @verbose end |