• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    HTML
  • License
    Other
  • Created over 15 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

homework assignments for teaching ruby

This repo contains all the source code that generates the http://testfirst.org web site and courses.

Courses comprise sets of labs; each course has its own github repo, which students clone (or fork and clone) and do their work inside the clone.

If you want to teach a class, or edit the exercises, then this project is for you. If you want to learn ruby, go check out http://github.com/alexch/learn_ruby instead.

Quick Start

git clone [this repo]
cd test-first-teaching
bundle install  # if "bundle install" fails, try "bundle update"
rake            # runs all tests, including exercises with solutions

Definitions

curriculum - a top-level category, usually specified by language or framework. E.g. learn_ruby or learn_java or learn_rails.

lab - a group of related test-first exercises inside a curriculum. E.g. array or calculator or threads. Labs can contain tests, descriptions, sample data, and solutions.

course - a list, in order, of a chosen group of labs that will be built into a repo that students can clone. Each course is defined by a course file which is in YAML format.

course repo - a git repository (probably on github) containing a built-out of a course's labs, but with some automatic processing. For instance, the repo does not contain solutions. Students should git clone this repo when taking a class. On the local file system, the repo must be located as a sibling of the test-first-teaching directory.

How to teach a class

(todo: more detail)

  1. choose or create a course file for your class inside the courses dir (e.g. ruby-for-artists.yaml)
  2. create an appropriately named github repo and put its git url in the course file (e.g. :repo: [email protected]:alexch/ruby-for-artists.git)
  3. run rake build course=ruby-for-artists and inspect the resulting repo (e.g. ../ruby-for-artists/)
  4. run rake push course=ruby-for-artists and watch for the course repo code to appear on github

See courses/learn_ruby.yaml for an example.

How to write labs

Create or edit the spec files inside the lab directory and the solution files inside its solution subdirectory. Run rake and all labs will be tested; the solution dir will be added to the load path so you can easily separate exercises and data from solutions. If you want to run rake on just the lab you're in, like the students will, then cd into the lab dir and say rake.

TODO: easier way to to run only the foo lab's tests from the top level, e.g. rake lab=foo

To look at the generated course, run rake build course=my_course and then look inside ../my_course.

All files in the lab directory will be transferred into the built-out course's lab dir. Files ending with .md will be processed using Markdown and turned into .html files. Students will look for an index.html file with lab-specific hints and instructions.

There's a magic "lab" directory called "ubiquitous". Its contents will be copied into all the labs -- this is where we put the universal Rakefile so every lab gets its own Rakefile that's the same as all the others, so students can just run rake and get the fail-fast formatter.

TODO: allow subdirectories inside labs

How to edit and publish the web site

All the web-only content is inside the web directory. We use Erector to generate HTML, so to make a change, edit the .rb file. To see what the site will look like when deployed, run rake run which launches a local Sinatra app on http://localhost:9292.

http://testfirst.org is run on Heroku, and this repo is the Heroku app itself, so run rake then git push heroku to deploy.

Here's the first few lines from heroku info:

=== testfirst
Web URL:        http://testfirst.heroku.com/
Domain name:    http://testfirst.org/
Git Repo:       [email protected]:testfirst.git

If you want access to the Heroku app, ask [email protected].

License

This material is all open-source. We understand that people may want to use these materials to teach classes, and may want to get paid for their work, so commercial use is permitted. All we ask is that you provide credit to this project and the original authors if you reproduce or promote your work.

All contents (included generated courseware) are Copyright (c) 2001-2011 by Alex Chaffee and the Test-First Teaching project, licensed under Creative Commons Attribution (CC BY 3.0) http://creativecommons.org/licenses/by/3.0/

More Repositories

1

firebase-functions-typescript

Cloud Functions for Firebase: getting started with TypeScript
TypeScript
31
star
2

hocr-javascript

JS for overlaying OCR on image using HOCR formatted HTML
JavaScript
23
star
3

ghostscript-cloud-function

example Google Cloud Function using ghostscript
HTML
12
star
4

rust-clib

example of writing a library that can be called from C or Rust
Rust
9
star
5

FirebasePlayground

swift playground for experimenting with firebase
Swift
9
star
6

pie

a game DSL, or at least maybe it will be someday
Ruby
8
star
7

suggestorama

cucumber test-first teaching for workshop curriculum
Ruby
6
star
8

nvd3-simpleline

Totally simple chart with nvd3 library
5
star
9

sails-new

steps to match the sails video with newer sails release
JavaScript
4
star
10

sails-tutorial-activity-overlord

based on video series by @irlnathan, https://github.com/irlnathan/activityoverlord
JavaScript
4
star
11

full-text-search-appengine

AppEngine with Lucene
Ruby
3
star
12

sails-passport

simple example using SailsJS and Passport
JavaScript
3
star
13

rhosync_source_adapters

a number of sample rhosync source adapters
Ruby
3
star
14

dusty-attic

interactive fiction app creating using Sinatra for teaching beginning programming
Ruby
3
star
15

ruby_version_check

understanding how to require Ruby 1.9
Ruby
3
star
16

rhodes_image_sync

Ruby
3
star
17

rhodes_mystuff_app

test scrolling list of images with links to media
JavaScript
3
star
18

test-framework-comparison

Ruby
3
star
19

ParsePlayground

iOS playground for experimenting with Parse.com data in Swift 2.0
Swift
3
star
20

rhohub_tutorial

Perl
3
star
21

example_nestedmodels

example code for new Rails 2.3 feature, nested models
Ruby
2
star
22

trie_example

JavaScript
2
star
23

simple_rhodes_app

test app for rhodes
Ruby
2
star
24

codespace-test

2
star
25

twitter_like_example_app

complex associations example using twitter-like example
Ruby
2
star
26

vim_settings

Here are the settings I like to use for vim
Vim Script
2
star
27

tfr_roster

example for Test First Rails
Ruby
2
star
28

rust-tokio-proxy

experimenting with tokio async/await and networking
Rust
2
star
29

hello-heroku-rust

sample app deploying Rust on Heroku -- with async/await & tokio
Rust
2
star
30

workshop-features

Ruby
2
star
31

rails3_webmock

example of using webmock
Ruby
2
star
32

rhodes_productshop_app

simple rhodes app
Ruby
2
star
33

ultra-simple-audio

Simple Audio Player using SoundManager2
JavaScript
1
star
34

sails-many-to-many

SailsJS Example of many-to-many relationship
JavaScript
1
star
35

1hour-experiment

1
star
36

rust-uri-comparison

looking at syntax of various URI crates
Rust
1
star
37

red5_webapps

Java
1
star
38

example_preview_action

Ruby
1
star
39

hello-petgraph

experimenting with rust
Rust
1
star
40

syntax-graph

experimenting with Google Natural Language API
JavaScript
1
star
41

irc-tokio

experiment with implementing irc protocol in Rust with tokio
Rust
1
star
42

rails_test_unit_webrat_example

a simple test-driven app with test unit and webrat for integration test
JavaScript
1
star
43

pandemic-pantry

list of food sources that deliver, so we don't have to leave our sick house...
1
star
44

class_app

example app for Test First Rails
Ruby
1
star
45

botany-collectors

Ruby
1
star
46

change-the-rules

Notes, Slides, Links from 2019 talk: "when reality is broken, change the rules"
1
star
47

hello-rust-parcel

Experiments calling Rust from JS via Wasm
Rust
1
star
48

hello-autotools

simple hello world unix package using Autotools
Shell
1
star
49

ghostscript-c-app

experiment calling Ghostscript as a library from C code
C
1
star
50

tfr_message_app

controller example for Test First Rails
Ruby
1
star
51

translations_example

experiment of how to model symetric translations
Ruby
1
star
52

class_app2

Ruby
1
star
53

tfr_class_app

source code for class_app example in Test First Rails book
Ruby
1
star
54

vivid-planet

Introductory programming using Sinatra
Ruby
1
star
55

csvtest

experimental, not done yet -- upload a csv, index with elasticsearch, access via JSON API
Ruby
1
star
56

videosnap

(not quite ready for prime time) open source video recording component
1
star
57

rhodes_mapping

open source example app to display simple map in Rhodes using Google API
Ruby
1
star
58

html5ever-hello

Rust
1
star