This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RSpec matcher to spec delegations. | |
# | |
# Usage: | |
# | |
# describe Post do | |
# it { should delegate(:title).to(:name) } # post.title => post.name | |
# it { should delegate(:month).to(:created_at) } # post.month => post.created_at | |
# it { should delegate(:author_name).to(:author, :name) } # post.author_name => post.author.name | |
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'csv' | |
require 'date' | |
CSV::Reader.parse(File.open(ARGV[0])) do |row| | |
date = row[0].match(/^\d{4}-\d{2}-\d{2}/) ? Date.strptime(row[0], "%Y-%m-%d") : row[0] | |
hours = row[2] | |
memo = "#{row[3]} #{row[4]}" | |
puts "#{date} | #{hours} | #{memo}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update_current_git_vars |