class SlackPomodoroTimer::CLI

Public Instance Methods

config() click to toggle source

Configure the timer URL and channel

# File lib/slack_pomodoro_timer/cli.rb, line 51
def config
  Config.load

  if options[:url]
    if HTTP.valid_url?(options[:url])
      Config.add(url: options[:url])
    else
      puts "You have not input a valid slack url."
    end
  end

  if options[:channel]
    Config.add(channel: options[:channel])
  end

  Config.save

  puts "Config updated:" if options[:url] || options[:channel]
  Config.display
end
start(pomodoros=1) click to toggle source

Start a timer with a number of pomodoros and optional time limit in minutes

# File lib/slack_pomodoro_timer/cli.rb, line 122
def start(pomodoros=1)
  if Config.configured?
    interval_in_seconds = options[:minutes] * 60
    Pomodorobot.start_timer(pomodoros, interval_in_seconds)
  else
    puts "Not Configured."
    puts "Run 'slack_pomodoro_timer help config'"
  end
end
version() click to toggle source

Output the current version

# File lib/slack_pomodoro_timer/cli.rb, line 136
def version
  puts SlackPomodoroTimer::VERSION
end