Sha256: 12dd1f229f0ce6948de14b4eda3afc79e1c4a3de15237d752a3ae592ac31979e

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

module Gitrob
  class CLI
    class Command
      attr_reader :options

      def self.start(*args)
        new(*args)
      end

      def initialize(*args) # rubocop:disable Lint/UnusedMethodArgument
      end

      def info(*args)
        Gitrob::CLI.info(*args)
      end

      def task(message, fatal_error=false, &block)
        Gitrob::CLI.task(message, fatal_error, &block)
      end

      def warn(*args)
        Gitrob::CLI.warn(*args)
      end

      def error(*args)
        Gitrob::CLI.error(*args)
      end

      def fatal(*args)
        Gitrob::CLI.fatal(*args)
      end

      def debug(*args)
        Gitrob::CLI.debug(*args)
      end

      def debugging_enabled?
        Gitrob::CLI.debugging_enabled?
      end

      def output(*args)
        Gitrob::CLI.output(*args)
      end

      def thread_pool
        pool = Thread::Pool.new(options[:threads] || 5)
        yield pool
        pool.shutdown
      end

      def progress_bar(message, options)
        progress_bar = Gitrob::CLI::ProgressBar.new(message, options)
        yield progress_bar
        progress_bar.finish
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gitrob-1.1.2 lib/gitrob/cli/command.rb
gitrob-1.1.1 lib/gitrob/cli/command.rb
gitrob-1.1.0 lib/gitrob/cli/command.rb
gitrob-1.0.1 lib/gitrob/cli/command.rb
gitrob-1.0.0 lib/gitrob/cli/command.rb