Class: Pomodoro

Inherits:
Thor
  • Object
show all
Includes:
Mixin::Audio, Mixin::Config, Mixin::Logger, Mixin::Network, Thor::Actions
Defined in:
lib/fox/interface/thor/pomodoro.rb

Instance Method Summary collapse

Methods included from Mixin::Audio

#initialize, #play_local, #play_remote

Methods included from Mixin::Network

#download, #initialize, #online?

Methods included from Mixin::Config

#initialize

Methods included from Mixin::Logger

#initialize

Instance Method Details

#defaultObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fox/interface/thor/pomodoro.rb', line 30

def default

  @logger.message :debug, 'Running sanity check for Pomodoro task'
  sanity_check

  if( options[:stream] ) 
    @logger.message :info, 'Streaming from Remote via github.com raw (use CTRL+C to abort)'
    @logger.message :warning, 'Please do not hammer github.com, download if possible instead'

    play_remote( @urls.pomodoro.send( @config.pomodoro.default ) )
  else
    @logger.message :info, 'Playing local file (use CTRL+C to abort)'

    play_local( @assets.pomodoro.send( @config.pomodoro.default ) )
  end

end

#shortObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/fox/interface/thor/pomodoro.rb', line 51

def short

  @logger.message :debug, 'Running sanity check for Pomodoro task'
  sanity_check

  if( options[:stream] ) 
    @logger.message :info, 'Streaming from Remote via github.com raw (use CTRL+C to abort)'
    @logger.message :warning, 'Please do not hammer github.com, download if possible instead'

    play_remote( @urls.pomodoro.short )
  else
    @logger.message :info, 'Playing local file (use CTRL+C to abort)'

    play_local( @assets.pomodoro.short )
  end

end