How do we start a new program?
Let’s try it by building:
A small program that takes input and does something with it.
def starts_listing(line) | |
line.include? "\\begin{lstlisting}" | |
end | |
def ends_listing(line) | |
line.include? "\\end{lstlisting}" | |
end | |
def process_file_line(unique_words, line) | |
unique_words.each do |verb_word| |
puts "Hey there! What's your name?" | |
name = gets.chomp | |
puts name | |
# Give me a K! | |
# Give me a e! | |
# Give me a i! | |
# Give me a t! | |
# Give me a h! |
month = ARGV[0] | |
year = ARGV[1] | |
puts `cal #{month} #{year}` |
class Countdown | |
BELL = "\a" | |
COLORS = { | |
'black' => 30, | |
'red' => 31, | |
'green' => 32, | |
'yellow' => 33, | |
'blue' => 34, | |
'magenta' => 35, | |
'cyan' => 36, |
# 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” |