Parent

Methods

Class/Module Index [+]

Quicksearch

Webgen::CLI::ApplyCommand

The CLI command for applying a bundle to a webgen website.

Public Instance Methods

execute(args) click to toggle source

Apply the style specified in args[0] to the webgen website.

# File lib/webgen/cli/apply_command.rb, line 44
def execute(args)
  wm = Webgen::WebsiteManager.new(commandparser.directory)
  if !File.directory?(wm.website.directory)
    raise "You need to specify a valid webgen website directory!"
  elsif args.length == 0
    raise OptionParser::MissingArgument.new('STYLE')
  else
    name = Utils.match_bundle_name(wm, args[0])
    puts "The following files in the website directory will be created or overwritten:"
    puts wm.bundles[name].paths.sort.join("\n")
    continue = @force
    if !continue
      print "Procede? (yes/no): "
      continue = ($stdin.readline =~ /y(es)?/)
    end
    wm.apply_bundle(name) if continue
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.