Skip to content

Instantly share code, notes, and snippets.

@TMorgan99
TMorgan99 / build-agility.sh
Created March 24, 2009 19:56
Build Agility, as per the tutorial
#!/bin/sh
## ========================================================
## Build Agility, as per the tutorial
## ========================================================
## run this script from a fresh directory.
## It will unload the heplers here, and build the app in the agility
## It is meant to be run in stages, where it runs into an 'exit'
## just comment over, and start again for the next step
#!/usr/bin/env ruby
## Shows model relationships on the given RoR app.
## add --help
## ?? add --belongs to filter out only given macros
## put message 'nothing relates' if models but no associations found.
puts ARGV
Dir.chdir( ARGV.shift || '.' ) do
#!/usr/bin/env ruby
## Shows model relationships on the given RoR app.
puts ARGV
Dir.chdir( ARGV.shift || '.' ) do
require 'config/environment'
finder = 'find app/models -type f -name \*.rb -print0 |xargs -0 -- grep ActiveRecord::Base |sort'
@TMorgan99
TMorgan99 / build-agility-from-patch-list
Created June 2, 2009 20:13
build agility (generate with patches)
#!/bin/sh
# Pointer to the patch files, downloaded from github
SRC=~/Clones/hobocookbook/public/patches/agility/
# The following code is interspersed with the headings from
# the tutorial. Where there is a generator to run, I simply
# run the generator. Otherwise, I run the patch you give.
# This will allow for the generators to generate, and the patches to
# add the code, as needed.
@TMorgan99
TMorgan99 / model.feature
Created June 12, 2009 18:31
model feature
Feature: The Models
As a practicing Hobo,
I want to lay out the models
So I can achieve these stated goals:
* Track multiple projects
* Each having a collection of stories
* Stories are just a brief chunk of text
* A story can be assigned a current status and a set of outstanding tasks
* Tasks can be assigned to users
Feature: Removing Actions
As a practising Hobo,
I want to disable unwanted routes
We only really want to see tasks listed against stories and users.
We want to add stories within projects, and tasks within stories.
Scenario Outline: User experience
Given I am logged in as <User>
And the following Project records exist:
Feature: Permissions
As a practical Hobo,
I want to specify permissions
* Only administrators can create, edit and delete Projects
* Stories and Tasks ( and TaskAssignments) are open to change by all signed up users.
* Guests are only able to view
* prevent Stories being moved from its original Project
#!/bin/sh
# ---
# location of patches
P=../patches/agility/
rm -fr agility
hobo agility
cd agility
#!/bin/sh
## Build Agility
rm -fr agility
hobo agility
cd agility
# add db:seeds rake task
cat <<__PATCH |patch -p1
patch rails for db:seeds
# Initialize hobo
$ rm -fr agility
$ hobo agility
$ cd agility
{: .bash}
### add db:seeds rake task
{: .bash}
::: ./lib/tasks/database.rake
new file mode 100644
@@ -0,0 +1,15 @@