class GeektoolKit::Cal

Public Class Methods

display() click to toggle source
# File lib/geektool_kit/cal.rb, line 13
def self.display
  cal = get_data
  output = ""
  cal.gsub(/(?<leading>\s)(?<date>#{get_day})(?<trailing>\s)/) {|match| output = cal.gsub(match, "#{$~[:leading]}#{Colors.GREEN}#{$~[:date]}#{Colors.RESET}#{$~[:trailing]}")}
  output
end
get_data() click to toggle source
# File lib/geektool_kit/cal.rb, line 5
def self.get_data
  `cal`
end
get_day() click to toggle source
# File lib/geektool_kit/cal.rb, line 9
def self.get_day
  Time.now.day.to_s
end