Project

punchcard

0.0
No commit activity in last 3 years
No release in over 3 years
Simple sinatra/activerecord based app for tracking time when people have been in the office
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0.5.6
= 2.10.3

Runtime

~> 3.0.0
~> 3.1.0
~> 3.0.24
~> 1.5.0
>= 3.0.0
~> 1.1.0
 Project Readme

Punchcard¶ ↑

A simple Sinatra app that lets you track who is and has been in the office at what times.

Bootstrap¶ ↑

Create a directory to hold your app, then create a Gemfile:

source :rubygems
gem 'pg'
# gem 'sqlite3' # if you want to run using sqlite or test locally
gem 'punchcard'

Create a Rakefile:

require 'bundler'
require 'rake'
Bundler.require

require 'punchcard/tasks'

Create a config.ru for rack:

require 'bundler'
Bundler.require

# You'll surely want to secure your punch card from general web access. The simplest way to do so is by
# using the rack auth middleware, defining it somewhere in your config.ru:
Punchcard::App.use Rack::Auth::Basic do |username, password|
  [username, password] == ['someuser', 'secret']
end

run Punchcard::App

To run locally, make sure you have a proper ENV configured or the sqlite3 gem installed with your bundle. Then:

$ bundle install
$ rake db:migrate
$ rackup

Open localhost:9292

Supported Ruby versions¶ ↑

Punchcard is tested against MRI 1.8.7, 1.9.1, 1.9.2 and Ruby Enterprise Edition.

Hosting on Heroku¶ ↑

Starting from the initial bootstrap above, make sure you have the pg gem in your bundle and did run bundle install to create the Gemfile.lock, then do the following in the terminal:

$ git init && git add .
$ git commit -m "Initial commit"
$ heroku create [APPNAME] --stack bamboo-mri-1.9.2
$ git push heroku master
$ heroku rake db:migrate

Now head over to your app’s url! You’ll still need to add users, see below.

Adding people¶ ↑

Currently, you’ll have to add users directly from the console. After creating your app on heroku, you can do so by running

$ heroku console
> Person.create!(:name => 'Forrest Gump', :email => 'forrest@shrimpco.org')

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Christoph Olszowka. See LICENSE for details.