Class: GeektoolKit::Cal

Inherits:
Object
  • Object
show all
Defined in:
lib/geektool_kit/cal.rb

Class Method Summary collapse

Class Method Details

.displayObject



13
14
15
16
17
18
# 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_dataObject



5
6
7
# File 'lib/geektool_kit/cal.rb', line 5

def self.get_data
  `cal`
end

.get_dayObject



9
10
11
# File 'lib/geektool_kit/cal.rb', line 9

def self.get_day
  Time.now.day.to_s
end