Class: Awestruct::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir = Dir.pwd) ⇒ Config

Returns a new instance of Config.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/awestruct/config.rb', line 16

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') ) 
  @ignore         = File.exists?(ignore_file = File.join(dir, ".awestruct_ignore")) ? Dir[*IO.read(ignore_file).each_line.map(&:strip)] : []
end

Instance Attribute Details

#config_dirObject

Returns the value of attribute config_dir.



8
9
10
# File 'lib/awestruct/config.rb', line 8

def config_dir
  @config_dir
end

#dirObject

Returns the value of attribute dir.



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

def dir
  @dir
end

#extension_dirObject

Returns the value of attribute extension_dir.



9
10
11
# File 'lib/awestruct/config.rb', line 9

def extension_dir
  @extension_dir
end

#ignoreObject

Returns the value of attribute ignore.



14
15
16
# File 'lib/awestruct/config.rb', line 14

def ignore
  @ignore
end

#input_dirObject

Returns the value of attribute input_dir.



10
11
12
# File 'lib/awestruct/config.rb', line 10

def input_dir
  @input_dir
end

#layouts_dirObject

Returns the value of attribute layouts_dir.



7
8
9
# File 'lib/awestruct/config.rb', line 7

def layouts_dir
  @layouts_dir
end

#output_dirObject

Returns the value of attribute output_dir.



11
12
13
# File 'lib/awestruct/config.rb', line 11

def output_dir
  @output_dir
end

#skin_dirObject

Returns the value of attribute skin_dir.



12
13
14
# File 'lib/awestruct/config.rb', line 12

def skin_dir
  @skin_dir
end

#tmp_dirObject

Returns the value of attribute tmp_dir.



13
14
15
# File 'lib/awestruct/config.rb', line 13

def tmp_dir
  @tmp_dir
end