Class: Stratus::Generator::Scanner
- Inherits:
-
Object
- Object
- Stratus::Generator::Scanner
- Includes:
- Logging
- Defined in:
- lib/stratus/generator/scanner.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#content_path ⇒ Object
readonly
Returns the value of attribute content_path.
Instance Method Summary collapse
-
#initialize(base_path) ⇒ Scanner
constructor
A new instance of Scanner.
- #sweep(clear_db = true) ⇒ Object
Methods included from Logging
#error, #fatal, #growl, #growler, #info, #notify
Constructor Details
#initialize(base_path) ⇒ Scanner
Returns a new instance of Scanner.
10 11 12 13 14 |
# File 'lib/stratus/generator/scanner.rb', line 10 def initialize(base_path) @base = File.(base_path) raise StandardError.new("Base path must be a directory.") unless File.directory?(base) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
8 9 10 |
# File 'lib/stratus/generator/scanner.rb', line 8 def base @base end |
#content_path ⇒ Object (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 |