class Nanoc::CLI::Commands::Prune
Public Instance Methods
run()
click to toggle source
# File lib/nanoc/cli/commands/prune.rb, line 17 def run load_site # FIXME: ugly to preprocess here site.compiler.action_provider.preprocess(site) site.compiler.build_reps if options.key?(:yes) Nanoc::Extra::Pruner.new(site, exclude: prune_config_exclude).run elsif options.key?(:'dry-run') Nanoc::Extra::Pruner.new(site, exclude: prune_config_exclude, dry_run: true).run else $stderr.puts 'WARNING: Since the prune command is a destructive command, it requires an additional --yes flag in order to work.' $stderr.puts $stderr.puts 'Please ensure that the output directory does not contain any files (such as images or stylesheets) that are necessary but are not managed by Nanoc. If you want to get a list of all files that would be removed, pass --dry-run.' exit 1 end end
Protected Instance Methods
prune_config()
click to toggle source
# File lib/nanoc/cli/commands/prune.rb, line 37 def prune_config site.config[:prune] || {} end
prune_config_exclude()
click to toggle source
# File lib/nanoc/cli/commands/prune.rb, line 41 def prune_config_exclude prune_config[:exclude] || {} end