lib/rock_config/scanner.rb in rock_config-0.0.0 vs lib/rock_config/scanner.rb in rock_config-0.0.1
- old
+ new
@@ -3,24 +3,17 @@
def initialize(configuration)
@configuration = configuration
end
def find(file_name)
- full_file_name = resolve_full_file_name(file_name)
-
@configuration.scanned_directories.each do |directory|
- file = File.join(directory, full_file_name)
- if File.exists? file
- return File.read file
+ @configuration.config_loaders.each do |loader|
+ if config = loader.find_at(directory, file_name)
+ return config
+ end
end
end
- nil
- end
-
- private
-
- def resolve_full_file_name(file_name)
- "#{file_name}.yml"
+ raise ConfigNotFound, "Config not found"
end
end
end