Class: GeektoolKit::Cal
- Inherits:
-
Object
- Object
- GeektoolKit::Cal
- Defined in:
- lib/geektool_kit/cal.rb
Class Method Summary collapse
Class Method Details
.display ⇒ Object
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_data ⇒ Object
5 6 7 |
# File 'lib/geektool_kit/cal.rb', line 5 def self.get_data `cal` end |
.get_day ⇒ Object
9 10 11 |
# File 'lib/geektool_kit/cal.rb', line 9 def self.get_day Time.now.day.to_s end |