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
"WORD WORD WORD/WORD WORD-WORD".split(" ").each | |
{ | |
|w| w.split("/").each | |
{ | |
|w| w.split("-").each | |
{ | |
|w| w.capitalize! | |
} | |
.join("-") | |
} |
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
Dir.glob('script/parsing/raw-data/*.ets').each do |filename| | |
puts "Reading #{filename}..." | |
raw = File.open(filename, 'r') | |
section_data = Array.new | |
(0..9).each do |d| | |
puts "Selecting: 00#{d.to_s}" | |
lines = raw.select{|line| /^00#{d.to_s}/.match(line)} |
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
username@hostname:/$ irb | |
irb(main):001:0> require 'rubygems' | |
=> true | |
irb(main):003:0> require 'active_record' | |
=> true | |
irb(main):004:0> load 'active_record/railties/databases.rake' | |
MissingSourceFile: no such file to load -- active_record/railties/databases.rake | |
from /usr/lib/ruby/1.8/active_support/dependencies.rb:145:in `load_without_new_constant_marking' | |
from /usr/lib/ruby/1.8/active_support/dependencies.rb:145:in `load' | |
from /usr/lib/ruby/1.8/active_support/dependencies.rb:521:in `new_constants_in' |
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
#!/usr/bin/env /home/baronmango/ipdb/ipdb/script/rails runner | |
require 'script/parsing/parser.rb' | |
require 'script/parsing/add_data.rb' | |
require 'rake' | |
require 'rake/rdoctask' | |
require 'rake/testtask' | |
require 'rails/tasks' | |
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
= form_for @office, :remote => true do |f| | |
-if @office.errors.any? | |
#error_explanation | |
%h2= "#{pluralize(@office.errors.count, "error")} prohibited this office from being saved:" | |
%ul | |
- @office.errors.full_messages.each do |msg| | |
%li= msg | |
.field | |
= f.label :title |
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 CitiesController < ApplicationController | |
# GET /cities | |
# GET /cities.xml | |
def index | |
@cities = City.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.xml { render :xml => @cities } | |
end |