lib/nanoc3/cli/commands/debug.rb in nanoc3-3.2.0a4 vs lib/nanoc3/cli/commands/debug.rb in nanoc3-3.2.0b1
- old
+ new
@@ -1,49 +1,35 @@
# encoding: utf-8
-module Nanoc3::CLI::Commands
+usage 'debug'
+summary 'show debug information for this site'
+description <<-EOS
+Show information about all items, item representations and layouts in the
+current site.
+EOS
- class Debug < Cri::Command
+run do |opts, args, cmd|
+ Nanoc3::CLI::Commands::Debug.call(opts, args, cmd)
+end
- def name
- 'debug'
- end
+module Nanoc3::CLI::Commands
- def aliases
- []
- end
+ class Debug < ::Nanoc3::CLI::Command
- def short_desc
- 'show debug information for this site'
- end
-
- def long_desc
- 'Show information about all items, item representations and layouts ' \
- 'in the current site.'
- end
-
- def usage
- "nanoc3 debug"
- end
-
- def option_definitions
- []
- end
-
- def run(options, arguments)
+ def run
# Make sure we are in a nanoc site directory
print "Loading site data... "
- @base.require_site
+ self.require_site
puts "done"
puts
# Get data
- items = @base.site.items
+ items = self.site.items
reps = items.map { |i| i.reps }.flatten
- layouts = @base.site.layouts
+ layouts = self.site.layouts
# Get dependency tracker
- compiler = @base.site.compiler
+ compiler = self.site.compiler
compiler.load
dependency_tracker = compiler.dependency_tracker
# Print item dependencies
puts '=== Item dependencies ======================================================='