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.
-
#options ⇒ Object
Returns the value of attribute options.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
-
#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(opts = Awestruct::CLI::Options.new) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(opts = Awestruct::CLI::Options.new) ⇒ Config
Returns a new instance of Config.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/awestruct/config.rb', line 25 def initialize(opts = Awestruct::CLI::Options.new) @dir = Pathname.new( opts.source_dir ) @layouts_dir = Pathname.new( File.join(@dir, '_layouts') ) @config_dir = Pathname.new( File.join(@dir, '_config') ) @input_dir = @dir @output_dir = Pathname.new( opts.output_dir ) @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') ) @options = opts # 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.
9 10 11 |
# File 'lib/awestruct/config.rb', line 9 def config_dir @config_dir end |
#dir ⇒ Object
Returns the value of attribute dir.
7 8 9 |
# File 'lib/awestruct/config.rb', line 7 def dir @dir end |
#extension_dir ⇒ Object
Returns the value of attribute extension_dir.
10 11 12 |
# File 'lib/awestruct/config.rb', line 10 def extension_dir @extension_dir end |
#ignore ⇒ Object
Returns the value of attribute ignore.
15 16 17 |
# File 'lib/awestruct/config.rb', line 15 def ignore @ignore end |
#images_dir ⇒ Object
Returns the value of attribute images_dir.
18 19 20 |
# File 'lib/awestruct/config.rb', line 18 def images_dir @images_dir end |
#input_dir ⇒ Object
Returns the value of attribute input_dir.
11 12 13 |
# File 'lib/awestruct/config.rb', line 11 def input_dir @input_dir end |
#layouts_dir ⇒ Object
Returns the value of attribute layouts_dir.
8 9 10 |
# File 'lib/awestruct/config.rb', line 8 def layouts_dir @layouts_dir end |
#options ⇒ Object
Returns the value of attribute options.
23 24 25 |
# File 'lib/awestruct/config.rb', line 23 def @options end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
12 13 14 |
# File 'lib/awestruct/config.rb', line 12 def output_dir @output_dir end |
#quiet ⇒ Object
Returns the value of attribute quiet.
22 23 24 |
# File 'lib/awestruct/config.rb', line 22 def quiet @quiet end |
#skin_dir ⇒ Object
Returns the value of attribute skin_dir.
13 14 15 |
# File 'lib/awestruct/config.rb', line 13 def skin_dir @skin_dir end |
#stylesheets_dir ⇒ Object
Returns the value of attribute stylesheets_dir.
19 20 21 |
# File 'lib/awestruct/config.rb', line 19 def stylesheets_dir @stylesheets_dir end |
#tmp_dir ⇒ Object
Returns the value of attribute tmp_dir.
14 15 16 |
# File 'lib/awestruct/config.rb', line 14 def tmp_dir @tmp_dir end |
#track_dependencies ⇒ Object
Returns the value of attribute track_dependencies.
16 17 18 |
# File 'lib/awestruct/config.rb', line 16 def track_dependencies @track_dependencies end |
#verbose ⇒ Object
Returns the value of attribute verbose.
21 22 23 |
# File 'lib/awestruct/config.rb', line 21 def verbose @verbose end |