Class: Confy::Backend::Base
- Inherits:
-
Object
- Object
- Confy::Backend::Base
- Defined in:
- lib/confy/backend/base.rb
Class Method Summary collapse
Class Method Details
.extensions ⇒ Object
13 14 15 |
# File 'lib/confy/backend/base.rb', line 13 def self.extensions @extensions ||= Set.new end |
.which(path) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/confy/backend/base.rb', line 4 def self.which(path) extension = extensions.dup.detect{|e,klass| e.to_s == File.extname(path)[1..-1] } if extension Backend.const_get(extension.pop) else raise Confy::UnsupportedFileExtensionError, "No backend available for #{path}." end end |