Class: GitCommander::Command::Loaders::FileLoader Abstract
- Defined in:
- lib/git_commander/command/loaders/file_loader.rb
Overview
This class is abstract.
Handles loading commands from file
Defined Under Namespace
Classes: FileLoadError, FileNotFoundError
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Attributes inherited from Loader
Instance Method Summary collapse
Methods inherited from Loader
Constructor Details
This class inherits a constructor from GitCommander::Loader
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
13 14 15 |
# File 'lib/git_commander/command/loaders/file_loader.rb', line 13 def filename @filename end |
Instance Method Details
#load(filename) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/git_commander/command/loaders/file_loader.rb', line 15 def load(filename) raw_loader = Raw.new(registry) @result = raw_loader.load(File.read(filename)) rescue Errno::ENOENT => e handle_error FileNotFoundError, e rescue StandardError => e handle_error FileLoadError, e end |