lib/nanoc/cli/commands/deploy.rb in nanoc-4.4.7 vs lib/nanoc/cli/commands/deploy.rb in nanoc-4.5.0

- old
+ new

@@ -25,12 +25,12 @@ end private def list_deployers - deployers = Nanoc::Int::PluginRegistry.instance.find_all(Nanoc::Deploying::Deployer) - deployer_names = deployers.keys.sort_by(&:to_s) + deployers = Nanoc::Deploying::Deployer.all + deployer_names = deployers.map(&:identifier).sort puts 'Available deployers:' deployer_names.each do |name| puts " #{name}" end end @@ -103,17 +103,17 @@ def deploy_configs site.config.fetch(:deploy, {}) end def deployer_class_for_config(config) - names = Nanoc::Deploying::Deployer.all.keys name = config.fetch(:kind) do $stderr.puts 'Warning: The specified deploy target does not have a kind attribute. Assuming rsync.' 'rsync' end - deployer_class = Nanoc::Deploying::Deployer.named(name) + deployer_class = Nanoc::Deploying::Deployer.named(name.to_sym) if deployer_class.nil? + names = Nanoc::Deploying::Deployer.all.map(&:identifier) raise Nanoc::Int::Errors::GenericTrivial, "The specified deploy target has an unrecognised kind “#{name}” (expected one of #{names.join(', ')})." end deployer_class end end