lib/cli/server_task.rb in factor-0.1.01 vs lib/cli/server_task.rb in factor-0.1.02

- old
+ new

@@ -5,45 +5,46 @@ module CLI class ServerTask < Command desc "start", "start the server" method_option :tags, :alias=>"-t", :type=>:hash, :desc=>"Optional tags to identify from workflow" method_option :channels, :type=>:array, :desc=>"Optional channel ruby file list for development" + method_option :verbose, :type=>:boolean, :desc=>"Display everything" def start engine = Factor::Runtime::Engine.new(get_config[:email],get_config[:token]) options.tags.each {|tag,value| engine.tag(tag,value)} if options.tags? # load channels from server - say "loading channels from server" + say "loading channels from server" if options.verbose? engine = @client.load_channels(engine) do |message| - say " #{message}" + say " #{message}" if options.verbose? end # load channels from files if options.channels? options.channels.each do |file| full_file=File.expand_path(file) - say " loading '#{full_file}'" + say " loading '#{full_file}'" if options.verbose? engine.load_channel(full_file) - say " loaded '#{full_file}'" + say " loaded '#{full_file}'" if options.verbose? end end - say "loading channels complete" + say "loading channels complete" if options.verbose? # load workflows from server - say "loading workflows from server" + say "loading workflows from server" if options.verbose? engine = @client.load_workflows(engine) do |message| - say " #{message}" + say " #{message}" if options.verbose? end - say "loading workflows complete" + say "loading workflows complete" if options.verbose? - say "loading credentials from server" + say "loading credentials from server" if options.verbose? engine = @client.load_credentials(engine) do |message| - say " #{message}" + say " #{message}" if options.verbose? end - say "loading credentials complete" + say "loading credentials complete" if options.verbose? say "starting the server...", :green message = engine.start if message.is_a?(Exception) say "[Unknown exception]", :red \ No newline at end of file