Sha256: e439b6c653e872d520178d26b983d4fa1d28e9b621469e4e3c84eef84554e4a6

Contents?: true

Size: 1.12 KB

Versions: 8

Compression:

Stored size: 1.12 KB

Contents

base = File.dirname(__FILE__)
require File.expand_path("../boot/fancy_ext", base)
require File.expand_path("../boot/load", base)

Fancy::CodeLoader.load_compiled_file File.expand_path("../lib/boot", base)

# 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 fancy_message_args name_and_args
    method_name = []
    args = []
    name_and_args.each_with_index do |a, i|
      if i % 2 == 0
        method_name << a
      else
        args << a
      end
    end
    return [method_name.join(":") + ":", args]
  end

  def fy(*array_or_name)
    if array_or_name.size > 1
      message_name, args = fancy_message_args array_or_name
      self.send(message_name, *args)
    else
      self.send(":#{array_or_name}")
    end
  end

  def fancy_require(fancy_file)
    Fancy::CodeLoader.load_compiled_file fancy_file
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fancy-0.9.0 ruby_lib/fancy.rb
fancy-0.8.0 ruby_lib/fancy.rb
fancy-0.7.0 ruby_lib/fancy.rb
fancy-0.6.0 ruby_lib/fancy.rb
fancy-0.5.0 ruby_lib/fancy.rb
fancy-0.4.0 ruby_lib/fancy.rb
fancy-0.3.3 ruby_lib/fancy.rb
fancy-0.3.2 ruby_lib/fancy.rb