module Minder
Constants
- ASSETS_LOCATION
- CONFIG_LOCATION
- DEFAULT_BREAK_PERIOD
- DEFAULT_WORK_PERIOD
- DOING_FILE
- DONE_FILE
- LOG_LOCATION
- MIGRATIONS_PATH
- VERSION
Public Class Methods
config()
click to toggle source
# File lib/minder.rb, line 18 def self.config @config ||= begin config = Minder::Config.new(CONFIG_LOCATION) config.load config end end
database_location()
click to toggle source
# File lib/minder.rb, line 26 def self.database_location "#{ENV['HOME']}/.minder/#{config.database_name}.sqlite3" end
formatted_time(seconds)
click to toggle source
# File lib/minder.rb, line 30 def self.formatted_time(seconds) minutes = (seconds / 60).to_i seconds = (seconds % 60).round "#{'%02d' % minutes}:#{'%02d' % seconds}" end
is_linux?()
click to toggle source
# File lib/minder.rb, line 43 def self.is_linux? RUBY_PLATFORM =~ /linux/ end
play_sound(name)
click to toggle source
# File lib/minder.rb, line 36 def self.play_sound(name) command = is_linux? ? 'aplay' : 'afplay' spawn("#{command} #{ASSETS_LOCATION}/#{name}", out: '/dev/null', err: '/dev/null') end
pry_open(b)
click to toggle source
# File lib/minder.rb, line 47 def self.pry_open(b) Curses.close_screen require 'pry' b.pry end