~= is the ruby match operator.
It matches a string to a regular expression.
'Pullo' =~ /o/
# => 4
If there is no match, it will return nil.
As for the method you posted:
if word =~/^qu/
it checks to see if the word it receives as an argument starts with a "qu".
If so, it returns 2
Otherwise it replaces everything after (and including) the occurrence of the first vowel, then returns the size of what's left.