Sha256: 7be50d56f97da25b6f7d2775e356387936c63d5b5b1d4118047b5a0c4e236610

Contents?: true

Size: 526 Bytes

Versions: 12

Compression:

Stored size: 526 Bytes

Contents

module HammerCLIForemanTasks

  module Async

    def self.included(base)
      base.send(:include, HammerCLIForemanTasks::Helper)
      base.send(:option, '--async', :flag, 'Do not wait for the task')
    end

    def execute
      if option_async?
        super
      else
        success = task_progress(send_request)
        success ? HammerCLI::EX_OK : HammerCLI::EX_SOFTWARE
      end
    end

  end

  class AsyncCommand < HammerCLIForeman::Command
    include HammerCLIForemanTasks::Async

    build_options
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hammer_cli_foreman_tasks-0.0.22 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.21 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.20 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.19 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.18 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.17 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.16 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.15 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.14 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.13 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.12 lib/hammer_cli_foreman_tasks/async_command.rb
hammer_cli_foreman_tasks-0.0.11 lib/hammer_cli_foreman_tasks/async_command.rb