[HTC Rezound] carngeX:
Easiest thing to do, will be to loop through the entire input string and parse each letter at a time. Had to do a morse-code conversion program in several older languages (Pascal, Fortran, Ada, C, C++) for my Programming Languages course last semester. Pseudocode was something like:

Get input from user (or parse an input file).

Store input into a string (or a string array if multiple lines).

Loop through string and check each letter individually and look up what the morse-code equivalent is.

Store the morse code equivalent in a new string inside the loop.

When you hit the end of the string (end of the loop), save the morse string to a file.

In the loop, checking each individual letter, a case statement (or if else-if else's) will be the easiest (more typing, but easier logic).

So, for example, here's a C++ version that I wrote for my class last semester:

#include <cstdlib>
#include <iostream>
#include <string>
#include <cctype>
using namespace std;

string search(char character);

int main()
{
string encryptionString = "";
string morseString = "";

cout << "Enter a sentence, containing only letters and blanks \nand ending with a period, to convert to morse code: " << endl;
getline(cin, encryptionString);

//remove ending period, if it exists
if(encryptionString[encryptionString.length() - 1] == '.')
{
encryptionString.erase(encryptionString.length() - 1);
}//if

for(int i = 0; i < encryptionString.length(); i++)
{
encryptionString[i] = toupper(encryptionString[i]);
}//for

int index = 0;
while(index < encryptionString.length())
{
if(encryptionString[index] != ' ' || encryptionString[index] != '\n')
{
cout << " ";
morseString = search(encryptionString[index]);
cout << morseString;
}
else
{
cout << endl;
morseString = "";
}

index++;
}//while

cin.ignore();
cout << "\n\nPress enter to exit...";
cin.get();

return 0;
}//main

string search(char character)
{
string returnString = "";

if(character >= 65 || character <= 90 )
{
switch(character)
{
case 'A':
returnString = ".-";
break;
case 'B':
returnString = "-...";
break;
case 'C':
returnString = "-.-.";
break;
case 'D':
returnString = "-..";
break;
case 'E':
returnString = ".";
break;
case 'F':
returnString = "..-.";
break;
case 'G':
returnString = "--.";
break;
case 'H':
returnString = "....";
break;
case 'I':
returnString = "..";
break;
case 'J':
returnString = ".---";
break;
case 'K':
returnString = "-.-";
break;
case 'L':
returnString = ".-..";
break;
case 'M':
returnString = "--";
break;
case 'N':
returnString = "-.";
break;
case 'O':
returnString = "---";
break;
case 'P':
returnString = ".--.";
break;
case 'Q':
returnString = "--.-";
break;
case 'R':
returnString = ".-.";
break;
case 'S':
returnString = "...";
break;
case 'T':
returnString = "-";
break;
case 'U':
returnString = "..-";
break;
case 'V':
returnString = "...-";
break;
case 'W':
returnString = ".--";
break;
case 'X':
returnString = "-..-";
break;
case 'Y':
returnString = "-.--";
break;
case 'Z':
returnString = "--..";
break;
}//switch
}//if

return returnString;

}//search

For you, you would instead print to a file instead of print to screen. You'll need to look up the exact syntax for Ruby, but should be easy.