def data_sources
load_code_snippets
@data_sources ||= begin
@config[:data_sources].map do |data_source_hash|
data_source_class = Nanoc::DataSource.named(data_source_hash[:type])
raise Nanoc::Errors::UnknownDataSource.new(data_source_hash[:type]) if data_source_class.nil?
case data_source_hash[:type]
when 'filesystem'
warn "Warning: the 'filesystem' data source has been renamed to 'filesystem_verbose'. Using 'filesystem' will work in nanoc 3.1.x, but it will likely not work anymore in a future release of nanoc. Please update your data source configuration and replace 'filesystem' with 'filesystem_verbose'."
when 'filesystem_combined', 'filesystem_compact'
warn "Warning: the 'filesystem_combined' and 'filesystem_compact' data source has been merged into the new 'filesystem_unified' data source. Using 'filesystem_combined' and 'filesystem_compact' will work in nanoc 3.1.x, but it will likely not work anymore in a future release of nanoc. Please update your data source configuration and replace 'filesystem_combined' and 'filesystem_compact with 'filesystem_unified'."
end
data_source_class.new(
self,
data_source_hash[:items_root],
data_source_hash[:layouts_root],
data_source_hash.merge(data_source_hash[:config] || {})
)
end
end
end