summaryrefslogtreecommitdiffstats
path: root/tool/compile_prelude.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 07:04:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-25 07:04:30 +0000
commit4b91a942be77b6b8f667b3d899dc8a734ba5bd16 (patch)
treec5ed92a313794595561a5c32ddb619fa0dfd930a /tool/compile_prelude.rb
parent6787bf92759c414b7738fb3e2c34eb459d79fc01 (diff)
downloadruby-4b91a942be77b6b8f667b3d899dc8a734ba5bd16.tar.gz
ruby-4b91a942be77b6b8f667b3d899dc8a734ba5bd16.tar.xz
ruby-4b91a942be77b6b8f667b3d899dc8a734ba5bd16.zip
* trunk/common.mk, goruby.c, golf_prelude.rb: for golfers.
* trunk/main.c (main): hook for embedding applications. * trunk/tool/compile_prelude.rb: can change initialize function name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/compile_prelude.rb')
-rw-r--r--tool/compile_prelude.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb
index 60d56fba6..2ffccc0d9 100644
--- a/tool/compile_prelude.rb
+++ b/tool/compile_prelude.rb
@@ -8,6 +8,7 @@ $:.unshift(File.expand_path("../..", __FILE__))
preludes = ARGV.dup
outfile = preludes.pop
+init_name = outfile[/\w+(?=_prelude.c\z)/] || 'prelude'
C_ESC = {
"\\" => "\\\\",
@@ -72,7 +73,7 @@ static const char prelude_code<%=i%>[] =
% }
void
-Init_prelude(void)
+Init_<%=init_name%>(void)
{
% lines_list.each_with_index {|(setup_lines, lines), i|
rb_iseq_eval(rb_iseq_compile(