You are not logged in.

#1 2010-10-14 05:06:28

Sara
Member
From: USA
Registered: 2009-07-09
Posts: 219
Website

[Request] Timetrap

Timetrap was described by K.Mandla here. The description from  the official website:

Timetrap is a simple command line time tracker written in ruby. It provides an easy to use command line interface for tracking what you spend your time on.

It began as a ruby port of Trevor Caira's Timebook, a small python utility. It contains several enhancement over Timebook, notably the ability to parse natural language times (e.g. "30 minutes ago"), additional commands such as archive and configure, and support for rounding.

Timetrap is also able to export entries to several formats (e.g. ical, csv) and is designed to be easily extended to support additional export formats, by creating a new formatter class (in ruby.)

I've made my own ad-hoc PKGBUILD for it, but it's really messy, as I didn't know how to properly install all of its ruby dependencies. Timebook, its predecessor, is available in the AUR, but in personal usage I found it too inflexible to be really useful (for instance, if you wish to delete an entry, you'll have to delete the whole timesheet it was in, as well). I hope someone can clean this up for me and provide it for others. Thanks smile.

pkgname=timetrap
pkgver=1.4.0
pkgrel=1
pkgdesc="Track what you spend time on."
arch=('i686' 'x86_64')
url="http://github.com/samg/timetrap"
license=('MIT')
depends=('ruby-sqlite3')
makedepends=('ruby') #for rubygems in particular
conflicts=('timebook-hg')
source=(http://rubygems.org/downloads/$pkgname-$pkgver.gem)
md5sums=('fcbd3f6e810c93df0d11b803bb3d8f23')

build() {
  cd $srcdir
  # _gemdir is defined inside build() because if ruby[gems] is not
  # installed on the system makepkg will barf when sourcing the PKGBUILD
  local _gemdir="$(ruby --enable-gems -e'puts Gem.default_dir')"

  local target="${pkgdir}${_gemdir}"
  local bintarget="$pkgdir/usr/bin"
  install -d "${bintarget}"

  gem install  -i "${target}" ${pkgname}-${pkgver}.gem \
    -n "${bintarget}" --ignore-dependencies
  gem install -i "${target}" sequel \
    -n "${bintarget}" --ignore-dependencies
  gem install -i "${target}" json_pure \
    -n "${bintarget}" --ignore-dependencies
  gem install -i "${target}" chronic \
    -n "${bintarget}" --ignore-dependencies
  gem install -i "${target}" getopt-declare \
    -n "${bintarget}" --ignore-dependencies
  gem install -i "${target}" icalendar \
    -n "${bintarget}" --ignore-dependencies
  gem install -i "${target}" mime-types \
    -n "${bintarget}" --ignore-dependencies
  gem install -i "${target}" diff-lcs \
    -n "${bintarget}" --ignore-dependencies
}

Last edited by Sara (2011-01-19 07:43:48)


Registed Linux User 483618

Offline

#2 2010-10-14 14:38:21

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: [Request] Timetrap

Hi Sara,

Ruby's built-in library management system (Gems) will install the dependencies for you:

gem install timetrap

... and you're good-to-go.

Looking at the list of dependencies (gem dep -r timetrap) the only other requirement is that you have sqlite3 installed.

Offline

#3 2010-10-15 08:12:53

Sara
Member
From: USA
Registered: 2009-07-09
Posts: 219
Website

Re: [Request] Timetrap

Thanks. If we can use Ruby to install the dependencies, why are ruby-sqlite3 and some other basic Ruby packages in the AUR? Hope you don't mind my asking.

Last edited by Sara (2010-10-15 08:13:17)


Registed Linux User 483618

Offline

#4 2010-10-15 11:55:39

Awebb
Member
Registered: 2010-05-06
Posts: 6,309

Re: [Request] Timetrap

Some people might dislike the fact that something besides pacman is fiddling with packages. Others might only need the besaid package, but not the rest.

Offline

#5 2010-10-15 12:18:21

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: [Request] Timetrap

Ιnstalling packages in the system using other package managers (like gem or cabal), isn't proposed. They all must be converted into PKGBUILDs and arch packages.

Offline

Board footer

Powered by FluxBB