jedcn/rake-to-web — pull request #1 by jedcn (2013-03-23 20:57:21+00:00)
Title: Shaping things up

## Overview

I haven't worked with Sinatra before, so up until now I've been just fooling around and trying to figure out if I could get this to work.

The commits in this pull request are an attempt to firm things up and provide a layer of testing.

## Changes

Some of the things achieved are:

### App Decoupled from Rake

Previously, the Sinatra Application that displayed stuff was tightly coupled together with knowledge of how to run Rake tests. There is now a level of indirection between a "Sinatra Application That Knows How To Run General Tasks" (embedded in TaskToWebBuilder's app method) and a "Class That Knows How to Run Rake Tasks."

This indirection makes this project more general: the tasks that run don't have to be Rake tasks. Perhaps Capistrano as well? Or a blend of both? Or neither. We're headed toward a small little app that lets provides a simple, task oriented interface.

### Tests

This indirection also makes testing easier: we now have support (via rack-test) for spinning up a rack app and simulating a GET / and a GET /task_name and a POST /task_name and verifying that things work as they should. See ```spec/lib/task_to_web_builder_spec.rb``` for details.

## Note of Interest

You can still start things up by typing "rake to-web"

However, one of the tasks, "spec" now does something: it runs the spec.

Try navigating to:

http://localhost:4567/spec

And then pressing the execute button. Hah!