Class: QQQ::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/qqq/cli.rb

Instance Method Summary collapse

Instance Method Details

#echo(*messages) ⇒ Object



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

def echo(*messages)
  QQQ.publish("#{messages.join(" ")}")
end

#mark(repeat_interval) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/qqq/cli.rb', line 15

def mark(repeat_interval)
  repeat_interval = repeat_interval.to_i rescue 0
  loop do
    qqq.mark

    if repeat_interval > 0
      sleep repeat_interval
    else
      break
    end
  end
end

#tailObject



8
9
10
11
12
# File 'lib/qqq/cli.rb', line 8

def tail
  qqq.subscribe do |event|
    puts event.for_humans
  end
end

#versionObject



34
35
36
37
# File 'lib/qqq/cli.rb', line 34

def version
  puts "QQQ version: #{QQQ::VERSION}"
  QQQ.publish(QQQ::VERSION)
end