Class: AbtionScripts::TodayI

Inherits:
Base
  • Object
show all
Defined in:
lib/abtion_scripts/todayi.rb

Constant Summary

Constants included from Colorize

Colorize::COLOR_CODES

Instance Attribute Summary

Attributes inherited from Base

#argv

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#app_names, #app_root, #bundler?, #ci?, #heroku, #heroku_app_name, inherited, #initialize, load_scripts_deferred, name, #rails?, run, #run_script, script_classes, script_names, scripts, #step, #system!, #yarn?

Methods included from Colorize

#colorize, included

Constructor Details

This class inherits a constructor from AbtionScripts::Base

Class Method Details

.descriptionObject



10
11
12
# File 'lib/abtion_scripts/todayi.rb', line 10

def self.description
  "Prints a list of commit msgs from today"
end

.helpObject



2
3
4
5
6
7
8
# File 'lib/abtion_scripts/todayi.rb', line 2

def self.help
  "abtion today-i\n\nPrints out a list of commit message names that you worked on today.\n"
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/abtion_scripts/todayi.rb', line 14

def run
  date_string = Time.now.to_s.split(' ')[0]

  lines = %x{
    git log \
      --date=local \
      --oneline \
      --after="#{date_string} 00:00" \
      --before="#{date_string} 23:59"
  }

  lines.each_line do |line|
    puts line.split(" ", 2)[1]
  end
end