R
RichardOnRails
HI,
I've got the code below. it creates the output:
Exception `NameError' at ReformChartNames.rb:8 - uninitialized
constant DATA
"__END__" statement or subsequent directory-name missing
Quitting job
I thought the "Exception" statement should not be generated because I
rescued from and errors. So, what's up?
Thanks in Advance,
Richard
=== code ===
[snip]
$DEBUG = true
$source_directory_name
begin
$source_directory_name =
DATA.readline # Line # 8
rescue
puts %<"__END__" statement or subsequent directory-name missing
\nQuitting job>
STDOUT.flush
exit
end
class ReformChartNames
def initialize
@source_dir_name = $source_directory_name.chomp
unless File.directory?(@source_dir_name)
puts %<ERROR: "%s" is not a valid directory name> %
[@source_dir_name]
exit
end
end
end
rcn = ReformChartNames.new
puts %<Got ReformChartNames object "rcn"> if $DEBUG
I've got the code below. it creates the output:
Exception `NameError' at ReformChartNames.rb:8 - uninitialized
constant DATA
"__END__" statement or subsequent directory-name missing
Quitting job
I thought the "Exception" statement should not be generated because I
rescued from and errors. So, what's up?
Thanks in Advance,
Richard
=== code ===
[snip]
$DEBUG = true
$source_directory_name
begin
$source_directory_name =
DATA.readline # Line # 8
rescue
puts %<"__END__" statement or subsequent directory-name missing
\nQuitting job>
STDOUT.flush
exit
end
class ReformChartNames
def initialize
@source_dir_name = $source_directory_name.chomp
unless File.directory?(@source_dir_name)
puts %<ERROR: "%s" is not a valid directory name> %
[@source_dir_name]
exit
end
end
end
rcn = ReformChartNames.new
puts %<Got ReformChartNames object "rcn"> if $DEBUG