Skip to content

Commit

Permalink
dealing with invalid require statements
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed Oct 29, 2008
1 parent 9408452 commit 3a5ed73
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/amalgalite/requires.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,13 @@ def require( filename )
else
begin
rows = db_connection.execute(sql, filename)
row = rows.first
eval( row[contents_column].to_s, TOPLEVEL_BINDING)
$" << row[filename_column]
if rows.size > 0 then
row = rows.first
eval( row[contents_column].to_s, TOPLEVEL_BINDING)
$" << row[filename_column]
else
raise LoadError, "no row with filename #{filename} exists in #{dbfile_name}"
end
rescue => e
raise LoadError, "Failure loading #{filename} from #{dbfile_name} : #{e}"
end
Expand Down

0 comments on commit 3a5ed73

Please sign in to comment.