Skip to content

Commit

Permalink
updated readme to let users know i'm pulling out some behavior into a…
Browse files Browse the repository at this point in the history
… gem. added a random address method to the factory_helpers. sweet.
  • Loading branch information
dcunited001 committed Aug 18, 2011
1 parent dd6596a commit 6796626
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Please note: Skate is currently a little broken, due to some of the changes i've introduced with SqlLoader
* i'm currently working to extract behavior in the SqlLoader module to the Skiima gem
* so please, pardon my dust as i work on this.
* i feel pulling this gem out is slightly higher priority than Skate at the moment
* while i hate to leave something in this state, it is one of many personal projects
* but even though that's the way the cookie is crumbling, it still tastes good, i promise (6 second rule)
* trust me, things will all be well in Skate Land shortly.
* you can relax from the edge of your seat. fallout.

# Skate

This is a personal project that's been in the works for some time. Originally, the project was written in Rails 3.0, but included a lot of bad code, from which I've since learned. The old project is still accessible in the aptly named 'rails3oh' branch.
Expand Down
19 changes: 18 additions & 1 deletion lib/factory_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,27 @@ def lorem(length=120)
def random_phone
area = (rand(900) + 100).to_s
local = (rand(900) + 100).to_s
id = (rand(900) + 100).to_s
id = (rand(9000) + 1000).to_s
"#{area}-#{local}-#{id}"
end

STREET_TYPES = %w(Street St. St Lane Ln. Ln Road Rd. Rd Drive Dr. Dr Avenue Ave. Ave Blvd)
STREET_NAMES = %w(Main main Market market Elm Broad Bear Atlantic Pacific Streety Laenus Rue)
APT_TYPES = %w(# Apt Apt# Suite Ste. Ste# Ste Number)
CITY_SAMPLES = %w(Salem Roanoke Columbia Blacksburg Charlottesville Norfolk Floyd)
STATE_SAMPLES = %w(VA NC MD KY OH IN NY WV PA)

def random_address
{
:line_one => "#{rand(1000) + 10} #{STREET_NAMES.sample} #{STREET_TYPES.sample}",
:line_two => "#{APT_TYPES.sample} #{rand(200) + 10}",
:city => CITY_SAMPLES.sample,
:state => STATE_SAMPLES.sample,
:zip => "%05d" % (rand(90000) + 500)
}
end


#module Fac
# class Date
#
Expand Down

0 comments on commit 6796626

Please sign in to comment.