Exception: FilePipeline::Errors::SourceFileError
- Inherits:
-
StandardError
- Object
- StandardError
- FilePipeline::Errors::SourceFileError
- Defined in:
- lib/file_pipeline/errors/source_file_error.rb
Overview
Error class for exceptions that are raised when a specified source directory does not exist (or is not a directory).
Instance Attribute Summary collapse
-
#directories ⇒ Object
readonly
The directories for source files that were registered with FilePipeline and searched at the time the error was raises.
-
#file ⇒ Object
readonly
The source file that could not be located.
Instance Method Summary collapse
-
#initialize(msg = nil, file: nil, directories: nil) ⇒ SourceFileError
constructor
A new instance of SourceFileError.
Constructor Details
#initialize(msg = nil, file: nil, directories: nil) ⇒ SourceFileError
Returns a new instance of SourceFileError.
15 16 17 18 19 20 21 22 23 |
# File 'lib/file_pipeline/errors/source_file_error.rb', line 15 def initialize(msg = nil, file: nil, directories: nil) @file = file @directories = directories default_msg = "The source file #{@file} was not found. Searched in:\n" msg ||= @directories.inject(default_msg) do |str, dir| str + "\t- #{dir}\n" end super msg end |
Instance Attribute Details
#directories ⇒ Object (readonly)
The directories for source files that were registered with FilePipeline and searched at the time the error was raises.
13 14 15 |
# File 'lib/file_pipeline/errors/source_file_error.rb', line 13 def directories @directories end |
#file ⇒ Object (readonly)
The source file that could not be located.
9 10 11 |
# File 'lib/file_pipeline/errors/source_file_error.rb', line 9 def file @file end |