How do we start a new program?
Let’s try it by building:
A small program that takes input and does something with it.
# encoding: UTF-8 | |
# This file is auto-generated from the current state of the database. Instead | |
# of editing this file, please use the migrations feature of Active Record to | |
# incrementally modify your database, and then regenerate this schema definition. | |
# | |
# Note that this schema.rb definition is the authoritative source for your | |
# database schema. If you need to create the application database on another | |
# system, you should be using db:schema:load, not running all the migrations | |
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | |
# you'll amass, the slower it'll run and the greater likelihood for issues). |
#!/usr/bin/env ruby | |
# -*- ruby -*- | |
require 'rake/testtask' | |
Rake::TestTask.new() do |t| | |
t.pattern = "test/test_*.rb" | |
end | |
desc "Run tests" | |
task :default => :test |
class Cron | |
def self.run! | |
User.send_digests! | |
end | |
end |
# Build on the results of our in-class exploration to output, for example: | |
# Give me an... A | |
# Give me a... B | |
# Give me a... B | |
# Give me a... Y | |
# ABBY’s just GRAND! | |
# When given the input of “Abby”. | |
# Note: the “a” vs. “an” |
01. about_asserts: TDD, minitest [TDD: Terrence][ minitest: adam ] | |
02. about_nil: nil in ruby (Matt Spell) | |
03. about_object: objects, to_s, object_id (Richmond) | |
04. about_arrays: slicing vs. access (MaRisa) | |
05. about_array_assignment (MaRisa) | |
06. about_hashes (Kelley) | |
07. about_strings (Carter) | |
08. about_symbols (Andrew) (D1 milestone) | |
09. about_regular_expressions (Courey) | |
10. about_methods (Wes) |
class CreateLineItems < ActiveRecord::Migration | |
def change | |
create_table :line_items do |t| | |
t.references :order | |
t.references :product | |
t.integer :quantity | |
t.boolean :delivered | |
end | |
end | |
end |