Class: Pwl::Commands::Export
Constant Summary collapse
- DEFAULT_EXPORT_TEMPLATE =
File.join(File.dirname(__FILE__), *%w[.. .. templates export.html.erb])
Instance Method Summary collapse
Methods inherited from Base
default_locker_file, exit_codes_help
Instance Method Details
#call(args, options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pwl/commands/export.rb', line 6 def call(args, ) .default :format => 'html' # TODO See Stats for slightly changed approach using a method presenter = {:html => Presenter::Html, :json => Presenter::Json, :yaml => Presenter::Yaml}[.format.to_sym] exit_with(:unknown_export_format, .verbose, :format => .format) if presenter.nil? begin locker = open_locker() puts presenter.new(locker).to_s rescue Dialog::Cancelled exit_with(:aborted, .verbose) end end |