Skip to content

Instantly share code, notes, and snippets.

View takaokouji's full-sized avatar

Kouji Takao takaokouji

View GitHub Profile
@takaokouji
takaokouji / test_include.rb
Created March 16, 2011 12:40
Could not find the constant in class_eval.
module A
B = 10
def f
class_eval { B }
end
end
class K
extend A
f
@takaokouji
takaokouji / prototype.rb
Created April 7, 2011 14:43
sanitize_regexp_string for "<pattern>{..}*" in Ruby
require 'test/unit'
def sanitize_regexp_string(chars)
lbrace_chars = "{"
rbrace_asterisk_chars = "}*"
backslash_chars = "\\"
res = chars.dup
res_diff = 0
diff --git a/compiler.cpp b/compiler.cpp
index f5ccc8a..e996c91 100644
--- a/compiler.cpp
+++ b/compiler.cpp
@@ -76,7 +76,8 @@ RoxorCompiler *RoxorCompiler::shared = NULL;
__save_state(NODE *, ensure_node);\
__save_state(bool, block_declaration);\
__save_state(AllocaInst *, dispatch_argv);\
- __save_state(uint64_t, outer_mask);
+ __save_state(uint64_t, outer_mask);\
@takaokouji
takaokouji / .globalrc
Created April 23, 2011 07:27
global using rtags
#
# Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003
# Tama Communications Corporation
#
# This file is part of GNU GLOBAL.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
@takaokouji
takaokouji / fixed-test_vm_20110504.patch
Created May 3, 2011 15:42
fixed break, next and redo with ensure block (before refactor)
diff --git a/compiler.cpp b/compiler.cpp
index 1ae055a..55188a0 100644
--- a/compiler.cpp
+++ b/compiler.cpp
@@ -2006,12 +2006,24 @@ RoxorCompiler::compile_jump(NODE *node)
compile_landing_pad_footer();
}
if (within_loop) {
- BranchInst::Create(current_loop_end_bb, bb);
- current_loop_exit_val->addIncoming(val, bb);
@takaokouji
takaokouji / add-licensing-policy-and-terms_README.rdoc.patch
Created May 7, 2011 08:09
Here are our licensing policy and terms for submitting contributions to our code base(From Trac on MacOS Forge)
diff --git a/README.rdoc b/README.rdoc
index 7fe3384..e70d547 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -74,6 +74,35 @@ http://macruby.org website has pointers). Thanks!
=== Contribute
+Here are our licensing policy and terms for submitting contributions
+to our code base:
@takaokouji
takaokouji / MacRuby_734a27c8df4c51534eebffccab4c47107bec2583_rails_server.log
Created May 18, 2011 15:34
rails server abort log on MacRuby 734a27c8df4c51534eebffccab4c47107bec2583
$ env DYLD_LIBRARY_PATH=/Users/kouji/work/MacRuby/MacRuby gdb --args macruby -S rails server
...
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Reading symbols for shared libraries . done
[2011-05-19 00:04:55] INFO WEBrick 1.3.1
[2011-05-19 00:04:55] INFO ruby 1.9.2 (2008-06-03) [universal-darwin10.0]
[2011-05-19 00:04:55] INFO WEBrick::HTTPServer#start: pid=79124 port=3000
@takaokouji
takaokouji / fixed_ee78786.patch
Created September 6, 2011 06:59
fixed a SEGV that is included #ee78786
Changes in HEAD
Modified lib/date.rb
diff --git a/lib/date.rb b/lib/date.rb
index 2fcde74..c367c9c 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -1392,11 +1392,8 @@ class Date
when Numeric; return jd == other
when Date; return jd == other.jd
else
@takaokouji
takaokouji / dot_bundle_instead_of_dot_so.patch
Created September 16, 2011 11:23
.bundle Indeed of .so in MacRuby
diff --git a/load.c b/load.c
index 06ca712..a1498b7 100644
--- a/load.c
+++ b/load.c
@@ -186,6 +186,21 @@ check_path(const char *path, VALUE *out, int *type)
else if (strcmp(p + 1, "bundle") == 0) {
t = TYPE_BUNDLE;
}
+ else if (strcmp(p + 1, "so") == 0) {
+ const char *ext = "bundle";
@takaokouji
takaokouji / id1391.patch
Created September 23, 2011 00:31
A patch fixes #1391 "macruby interpreter quits on 'quit' out of scope" - http://www.macruby.org/trac/ticket/1391
Changes in HEAD
Modified lib/irb/context.rb
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 0b03d00..a7e11fc 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -124,3 +124,7 @@ module IRB
end
end
end