Class: Gitrob::CLI::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/gitrob/cli/command.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Command

rubocop:disable Lint/UnusedMethodArgument



10
11
# File 'lib/gitrob/cli/command.rb', line 10

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/gitrob/cli/command.rb', line 4

def options
  @options
end

Class Method Details

.start(*args) ⇒ Object



6
7
8
# File 'lib/gitrob/cli/command.rb', line 6

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

Instance Method Details

#debug(*args) ⇒ Object



33
34
35
# File 'lib/gitrob/cli/command.rb', line 33

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

#debugging_enabled?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/gitrob/cli/command.rb', line 37

def debugging_enabled?
  Gitrob::CLI.debugging_enabled?
end

#error(*args) ⇒ Object



25
26
27
# File 'lib/gitrob/cli/command.rb', line 25

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

#fatal(*args) ⇒ Object



29
30
31
# File 'lib/gitrob/cli/command.rb', line 29

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

#info(*args) ⇒ Object



13
14
15
# File 'lib/gitrob/cli/command.rb', line 13

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

#output(*args) ⇒ Object



41
42
43
# File 'lib/gitrob/cli/command.rb', line 41

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

#progress_bar(message, options) {|progress_bar| ... } ⇒ Object

Yields:



51
52
53
54
55
# File 'lib/gitrob/cli/command.rb', line 51

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

#task(message, fatal_error = false, &block) ⇒ Object



17
18
19
# File 'lib/gitrob/cli/command.rb', line 17

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

#thread_pool {|pool| ... } ⇒ Object

Yields:

  • (pool)


45
46
47
48
49
# File 'lib/gitrob/cli/command.rb', line 45

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

#warn(*args) ⇒ Object



21
22
23
# File 'lib/gitrob/cli/command.rb', line 21

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