base = File.dirname(__FILE__) require File.expand_path("../boot/fancy_ext", base) require File.expand_path("../boot/load", base) do_retry = true begin Fancy::CodeLoader.load_compiled_file File.expand_path("../lib/boot", base) rescue RuntimeError => e # need to bootstrap first time if e.message =~ /File not found (.*)lib\/boot.fyc/ if do_retry puts "Fancy hasn't been bootstrapped yet. Doing that now.\n\n" `cd #{base}/../ && rbx -S rake clean && rbx -S rake` do_retry = false retry else raise e end else raise e end end # Remove the bootstrapping code loader bcl = Fancy.send :remove_const, :CodeLoader bcl.load_compiled_file File.expand_path("../lib/rbx/code_loader", base) # Initialize the load path Fancy::CodeLoader.push_loadpath File.expand_path("../lib", base) # Load compiler+eval support Fancy::CodeLoader.load_compiled_file File.expand_path("../lib/eval", base) class Object def fy(hash_or_name) if hash_or_name.is_a? Hash self.send("#{hash_or_name.keys.join(':')}:", *hash_or_name.values) else self.send(":#{hash_or_name}") end end def fancy_require(fancy_file) Fancy::CodeLoader.load_compiled_file fancy_file end end