Sha256: 118c3a90880f36a0b7f9ccb5dc4ed21142055aaf4cd2aa76ff2ab1178aabcb75

Contents?: true

Size: 978 Bytes

Versions: 1

Compression:

Stored size: 978 Bytes

Contents

module IrbHacks   #:nodoc:
  module CoreExtensions   #:nodoc:
    module Kernel   #:nodoc:
      module SingletonMethods
        # Run code snippet.
        # See <tt>IrbHacks::Snippet.run</tt>.
        def a(*args, &block)
          IrbHacks::Snippet.run(*args, &block)
        end

        # Edit code snippet.
        # See <tt>IrbHacks::Snippet.edit</tt>.
        def ae(*args)
          IrbHacks::Snippet.edit(*args)
        end
      end # SingletonMethods

      module InstanceMethods
        private

        def a(*args, &block)
          ::Kernel.a(*args, &block)
        end

        def ae(*args)
          ::Kernel.ae(*args)
        end
      end
    end
  end
end

Kernel.extend IrbHacks::CoreExtensions::Kernel::SingletonMethods

module Kernel   #:nodoc:
  include IrbHacks::CoreExtensions::Kernel::InstanceMethods
end

# Reinclude module into those using it.
ObjectSpace.each_object(Module) {|m| (m.class_eval {include Kernel} if m.include? Kernel) rescue nil}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
irb_hacks-0.2.0 lib/irb_hacks/core_ext/kernel/a_and_ae.rb