push and pop create a LIFO (last in first out, not last in last out, lol), shift and push and you have a FIFO, first in first out, because push adds to the end and shift removes from the beginning.
unshift does the opposite of shift, it adds an element to teh front of an array.  so you could use unshit with shift to create a LIFO method, you unshift something on, unshift another thing, then shift, and the last thing you unshifted comes out.  Could pair unshift with with pop to get a FIFO stack.
array.first(5) gives you the first 5 elements, array.last(4) gives you the last 4 elements.
hashes can be assigned, and when they do they return their value, so puts h[:assignment] = value - will print the value!  coolness.
ruby remembers the order you add things to a hash.  also, hashes can use anything as a key, they can use any object, unlike arrays which are assigned a kay equal to their position on the array.
ok, wrote a little program here.  first we took a string and converted it to downcase, .downcase and then chopped it up into words using .scan(/[\w']+/) where that regex matches all word characters and the ' character.  I would simplify it to .scan(/[\w]+/) b/c who cares about the ' ? right?  lol.  Ok.  Then, we got the frequency of each by creating a new hash with default value 0 (using Hash.new(0) so that it's not nil) and for the word in word_list += 1 to the hash.  then we return the hash.  Finally, we sorted teh hash using .sort_by and passing in a block {|word, count| count} which knew to sort it by count (the value).
So it then worked.  Then we used File.read("para.txt") to read in som text, sent it to the string to array converter using .downcase.scan(regex),  then on the the hash counter with the Hash.new(0), and then through the sorter, and then print it out.  It sorted it in ascending order.
Ok, breaking the words_from_string into seperate file so that it can be tested.  To test some ruby code, you create a test file, require_relative the ruby code you want to test, require 'test/unit', and  then throw in some assert_equal statements :)
my first Test::Unit::TestCase, lots of fun.  require_relative 'the_file_you_are_testing' require 'test/unit'

class TestThingYouAreTesting < Test::Unit::TestCase

def test_name_of_thing   - must start with 'test' keyword, this way it knows to run it.  then use asser_equal stsatments.
created my second test from test/unit.  again, require 'test/unit' then require_relative 'thefileyouneed'

class NameOfYourTest < Test::Unit::TestCase

def test_anything_here
assert_equal(thing it should be equal to, thing itself)

and that's the basics