Public Gists by wycats

Gravatar
Sun Nov 22 00:24:45 -0800 2009
1
2
3
  # Singleton method
  def conf.inspect
    IRB.version unless self[:VERSION]
Gravatar
Sun Nov 22 00:18:01 -0800 2009
1
2
3
% irb --help
Usage: irb.rb [options] [programfile] [arguments]
  -f ~/.irbrc ???ɤ߹??ޤʤ?.
Gravatar
Sat Nov 21 22:39:31 -0800 2009
1
2
3
    def set_prompt(scanner)
      scanner.set_prompt do |state, ltype, indent, line_no|
        format = send(PROMPTS[state]) || ""
Gravatar
Mon Nov 16 20:21:03 -0800 2009
1
2
3
class Module
  def append_features(base)
    base.class_eval(&@_included_block) if instance_variable_defined?("@_included_block")
Gravatar
Mon Nov 16 17:46:13 -0800 2009
1
2
3
Cat = function() {}
Dog = function() {}
 
Gravatar
Mon Nov 16 17:30:39 -0800 2009
1
2
3
class Class
  class PrototypeProxy
    def initialize(klass)
Gravatar
Mon Nov 16 08:40:23 -0800 2009
1
2
3
module Kernel
  def using(hash, &block)
    m = Module.new do
Gravatar
Fri Nov 13 09:15:12 -0800 2009
1
2
3
using(org.eclipse.jetty => "Jetty") do
  class RackHandler < Server::Handler::AbstractHandler
    attr_accessor :app
Gravatar
Thu Nov 12 20:13:20 -0800 2009
1
2
3
require "jetty/jruby_ext/packages"
 
%w(ajp annotations client continuation deploy http
Gravatar
Thu Nov 12 17:44:34 -0800 2009
1
2
3
m = Module.new do
  X = 1
  
Gravatar
Thu Nov 12 17:24:21 -0800 2009
1
2
3
  def using(hash, &block)
    namespace = Module.new do
      @@usings = hash.keys
Gravatar
Thu Nov 12 17:19:55 -0800 2009
1
2
3
Module.new do
  class << self
    def const_missing(k)
Gravatar
Thu Nov 12 17:15:31 -0800 2009
1
2
3
class Bar
end
 
Gravatar
Thu Nov 12 14:46:29 -0800 2009
1
2
3
module Java
  class Packages
    class << self
Gravatar
Thu Nov 12 11:06:47 -0800 2009
1
2
3
  def remove_subclasses_of(*superclasses) #:nodoc:
    Class.remove_class(*subclasses_of(*superclasses))
  end
Gravatar
Thu Nov 12 10:42:56 -0800 2009
1
2
3
  begin
    ObjectSpace.each_object(Class.new) {}
 
Gravatar
Tue Nov 10 23:30:17 -0800 2009
1
2
3
module Yaffle
  def acts_as_yaffle(options = {})
    cattr_accessor :yaffle_text_field
Gravatar
Tue Nov 10 13:59:54 -0800 2009
1
2
3
 
  % cumulative self self total
 time seconds seconds calls ms/call ms/call name
Gravatar
Tue Nov 10 00:06:14 -0800 2009
1
2
3
# them
@server = Jetty::Server.new
thread_pool = Jetty::Thread::QueuedThreadPool.new
Gravatar
Mon Nov 09 23:59:15 -0800 2009
1
2
3
$:.push File.join(Dir.pwd, "lib")
 
Dir["#{Dir.pwd}/lib/*.jar"].each do |file|