This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Module | |
def declare(decorator, *args) | |
orig_method_added = method(:method_added) | |
metaclass = (class << self; self end) | |
defined_methods = [] | |
metaclass.send(:define_method, :method_added) do |name| | |
orig_method_added.call(name) | |
defined_methods << name | |
end | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'optparse' | |
class OptionParser | |
def list_opts(prior_opts) | |
opts = enum_for(:visit, :tap).map(&:list).flatten(1) | |
prior_opts = opts.select{|opt| opt.long.any?{|name| prior_opts.include?(name)} } | |
opts -= prior_opts | |
simple_opts = opts.select{|opt| !opt.short.empty? && opt.arg.nil? }.sort_by{|x| x.short.sort.first} | |
opts -= simple_opts | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
require '/Users/yugui/dev/evil-ruby/lib/evil' | |
class Object | |
alias_method :c, :actual_class | |
end | |
class Class | |
alias_method :s, :actual_superclass | |
end | |
class Foo; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "ruby-dev", | |
takes: {"number": noun_arb_text}, | |
execute: function(number) { | |
if (number && number.text && number.text.length != 0) { | |
window.content.location.href = "http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/" + number.text; | |
} else { | |
window.content.location.href = "http://blade.nagaokaut.ac.jp/ruby/ruby-dev/index.shtml"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
svn log -q http://svn.ruby-lang.org/repos/ruby/ | grep -v '^--' | cut -d'|' -f 2 | sed 's/ //g' | sort | uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC="ccache gcc" ../../mri/configure --prefix=~/local --program-suffix=-1.9.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.gitignore b/.gitignorenew file mode 100644 | |
index 0000000..01bee7b | |
--- /dev/null | |
+++ b/.gitignore | |
@@ -0,0 +1,30 @@ | |
+.obj | |
+.deps | |
+*.a | |
+config.log | |
+config.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- src/lib/getopt.c.orig 2010-04-18 08:54:21.000000000 -0500 | |
+++ src/lib/getopt.c 2010-04-18 08:54:34.000000000 -0500 | |
@@ -57,7 +57,9 @@ | |
#ifdef __GNU_LIBRARY__ | |
/* Don't include stdlib.h for non-GNU C libraries because some of them | |
contain conflicting prototypes for getopt. */ | |
+#ifndef _AIX | |
#include <stdlib.h> | |
+#endif | |
#endif /* GNU C library. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
GIT_DIR=`git rev-parse --git-dir` | |
sqlite3 $GIT_DIR/revisions.sqlite \ | |
'create table revisions(svn integer primary key, hash char(40) not null); alter table revisions add index i_hash(hash);' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ExpressionTrueness[T] { | |
def myElse(then: => T) | |
} | |
class ExpressionTruth[T](obj: T) extends ExpressionTrueness[T] { | |
def myElse(then: => T) = obj | |
} | |
class ExpressionFalsity[T] extends ExpressionTrueness[T]() { | |
def myElse(then: => T) = then |
OlderNewer