Class: Stratus::Generator::Scanner

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/stratus/generator/scanner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#error, #fatal, #growl, #growler, #info, #notify

Constructor Details

#initialize(base_path) ⇒ Scanner

Returns a new instance of Scanner.

Raises:

  • (StandardError)


10
11
12
13
14
# File 'lib/stratus/generator/scanner.rb', line 10

def initialize(base_path)
  @base = File.expand_path(base_path)
  raise StandardError.new("Base path must be a directory.") unless File.directory?(base)
  
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



8
9
10
# File 'lib/stratus/generator/scanner.rb', line 8

def base
  @base
end

#content_pathObject (readonly)

Returns the value of attribute content_path.



8
9
10
# File 'lib/stratus/generator/scanner.rb', line 8

def content_path
  @content_path
end

Instance Method Details

#sweep(clear_db = true) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/stratus/generator/scanner.rb', line 16

def sweep(clear_db=true)
  @content_path = File.join(base, 'content')
  resources.clear if clear_db
  sweep_content
  sweep_layouts
  sweep_templates
end