CmdParse::Command
The CLI command for creating a webgen website.
Create a webgen website in the directory args[0].
# File lib/webgen/cli/create_command.rb, line 46 def execute(args) if args.length == 0 raise OptionParser::MissingArgument.new('DIR') else wm = Webgen::WebsiteManager.new(args[0]) paths = wm.create_website begin if @bundles @bundles = ['default', 'simple'] if @bundles.empty? @bundles.each {|name| paths += wm.apply_bundle(Utils.match_bundle_name(wm, name)) } end rescue require 'fileutils' FileUtils.rm_rf(args[0]) raise end if commandparser.verbosity == :verbose puts "The following files were created in the directory #{args[0]}:" puts paths.sort.join("\n") end end end
Generated with the Darkfish Rdoc Generator 2.