This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'pdf/reader' | |
class Script | |
def show_text(string) | |
puts string | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ONE DAY | |
by | |
David Nicholls | |
Based on the novel by David Nicholls | |
Yellow Pages - 27th July, 2010 | |
Pink Pages - 14th July, 2010 | |
Blue pages- 12th July, 2010 | |
Shooting draft - 2nd July, 2010 | |
Interim draft #2 - 11th June, 2010 | |
Interim draft - 28th May, 2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.foreach("script_test.txt") do |line| | |
match = /^EXT\.|^INT\.|^\d{1,3}\s|^\d{1,3}[A-Z]\s|^SCENE/ | |
if line =~ match | |
puts line | |
end | |
end | |
str = File.read("test.txt") | |
mch = (/^EXT\..+\n/).match(str) | |
mch.post_match |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MENU = {:hotdog => 2,:coke => 1,:chips => 20} | |
order = ["coke", "hotdog"] | |
h = Hash.new | |
order.each do |f| | |
h[f.to_sym] = MENU.fetch(f.to_sym) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An example below demonstrating 2 classes with the same name in different modules | |
# Modules simply provide ways to organize classes, methods, and constants into | |
# separate namespaces...courtesy of Peter Cooper | |
module Toolbox | |
class Ruler | |
attr_accessor :length | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Payroll | |
def initialize(args) | |
@rate = args[ :rate].to_f | |
@call = args[ :call].to_f | |
@wrap = args[ :wrap].to_f | |
@lunch = args[ :lunch].to_f | |
@dinner = args[ :dinner].to_f | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calculates Daily Pay Hours & Pay for Tier 3 Agreement Productions | |
class Payroll | |
def initialize(rate, call, wrap, lunch, dinner) | |
@rate = rate.to_f | |
@call = call.to_f | |
@wrap = wrap.to_f | |
@lunch = lunch.to_f | |
@dinner = dinner.to_f |