Sha256: 0dcbdff5b864582f4edfbcec4f02768ac82a80f80fc19569af6340294aca1a5b
Contents?: true
Size: 645 Bytes
Versions: 6
Compression:
Stored size: 645 Bytes
Contents
module BackgrounDRb module BdrbServerHelper # Load data using Marshal.load, if load fails because of undefined constant # try to load the constant. FIXME: regexp needs to handle all the cases. def load_data data begin return Marshal.load(data) rescue error_msg = $!.message if error_msg =~ /^undefined\ .+\ ([A-Z][^:]+)/ file_name = $1.underscore begin require file_name return Marshal.load(data) rescue return nil end else return nil end end # end of load_data method end end end
Version data entries
6 entries across 6 versions & 1 rubygems