Last Updated: February 25, 2016
·
775
· davidstump

Use Your Git History to Manage Freshbooks

A gem that uses your git commits to manage a Freshbooks timesheet

As an extension to my git-based timesheet I wrote about at the beginning of the year, I went ahead and setup a self contained gem with some additional features. The gem, mytime, can be found at: rubygems.org/gems/mytime as well as github.com/davidstump/mytime for your browsing pleasure.

The mytime gem uses your git commit history, in the same manner as the timesheet alias did, to pull a log of your daily activities. Once you have this daily history, you can tell mytime to 'push' all of your commits as a timesheet log to Freshbooks using their API. Additionally, you can 'submit' custom timesheet entries to Freshbooks as needed.

MyTime Documentation

Use your git commit history to track your time. Uses Freshbooks API.

Installation

Add this line to your application's Gemfile:

gem 'mytime'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mytime

Usage

To link to your Freshbooks account (you will need your Freshbooks username and API token):

$ mytime setup

To initialize mytime in a project directory:

$ mytime init

To see project details:

$ mytime project

To list log:

$ mytime status

To submit custom time entry:

$ mytime commit [hrs] [custom_message]
$ mytime commit  1.5 "Add an additional note if desired"

To push your git logs from today for a given project:

$ mytime push [hrs]
$ mytime push 4.5

I would love some feedback and/or pull requests to extend this little gem to include other timesheets, features, etc. I made this to help myself keep track of my daily commits per project, but hopefully it helps out a few others along the way. Thanks for reading!

Cheers!

David