[前][次][番号順一覧][スレッド一覧]

ruby-changes:34632

From: nobu <ko1@a...>
Date: Sun, 6 Jul 2014 14:20:16 +0900 (JST)
Subject: [ruby-changes:34632] nobu:r46715 (trunk): split tool/fake.rb

nobu	2014-07-06 14:20:10 +0900 (Sun, 06 Jul 2014)

  New Revision: 46715

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46715

  Log:
    split tool/fake.rb
    
    * tool/fake.rb: split from template/fake.rb.in.

  Added files:
    trunk/tool/fake.rb
  Modified files:
    trunk/template/fake.rb.in
Index: tool/fake.rb
===================================================================
--- tool/fake.rb	(revision 0)
+++ tool/fake.rb	(revision 46715)
@@ -0,0 +1,30 @@ https://github.com/ruby/ruby/blob/trunk/tool/fake.rb#L1
+class File
+  sep = ("\\" if RUBY_PLATFORM =~ /mswin|bccwin|mingw/)
+  if sep != ALT_SEPARATOR
+    remove_const :ALT_SEPARATOR
+    ALT_SEPARATOR = sep
+  end
+end
+
+$:.unshift(builddir)
+posthook = proc do
+  mkconfig = RbConfig::MAKEFILE_CONFIG
+  extout = File.expand_path(mkconfig["EXTOUT"], builddir)
+  $arch_hdrdir = "#{extout}/include/$(arch)"
+  $ruby = baseruby
+  untrace_var(:$ruby, posthook)
+end
+prehook = proc do |extmk|
+  unless extmk
+    config = RbConfig::CONFIG
+    mkconfig = RbConfig::MAKEFILE_CONFIG
+    mkconfig["top_srcdir"] = $top_srcdir = top_srcdir
+    mkconfig["rubyhdrdir"] = "$(top_srcdir)/include"
+    mkconfig["builddir"] = config["builddir"] = builddir
+    config["rubyhdrdir"] = File.join(mkconfig["top_srcdir"], "include")
+    mkconfig["libdir"] = config["libdir"] = mkconfig["topdir"]
+    trace_var(:$ruby, posthook)
+  end
+  untrace_var(:$extmk, prehook)
+end
+trace_var(:$extmk, prehook)

Property changes on: tool/fake.rb
___________________________________________________________________
Added: svn:eol-style
   + LF

Index: template/fake.rb.in
===================================================================
--- template/fake.rb.in	(revision 46714)
+++ template/fake.rb.in	(revision 46715)
@@ -10,39 +10,15 @@ class Object https://github.com/ruby/ruby/blob/trunk/template/fake.rb.in#L10
   CROSS_COMPILING = RUBY_PLATFORM
   remove_const :RUBY_PLATFORM
   remove_const :RUBY_VERSION
+  remove_const :RUBY_RELEASE_DATE
   remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION)
   RUBY_PLATFORM = "@arch@"
   RUBY_VERSION = "@RUBY_PROGRAM_VERSION@"
-  RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (@RUBY_RELEASE_DATE@) [#{RUBY_PLATFORM}]"
+  RUBY_RELEASE_DATE = "@RUBY_RELEASE_DATE@"
+  RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
 end
-class File
-  sep = ("\\" if RUBY_PLATFORM =~ /mswin|bccwin|mingw/)
-  if sep != ALT_SEPARATOR
-    remove_const :ALT_SEPARATOR
-    ALT_SEPARATOR = sep
-  end
-end
-
-builddir = File.expand_path(File.dirname(__FILE__))
-$:.unshift(builddir)
-posthook = proc do
-  mkconfig = RbConfig::MAKEFILE_CONFIG
-  extout = File.expand_path(mkconfig["EXTOUT"], builddir)
-  $arch_hdrdir = "#{extout}/include/$(arch)"
-  $ruby = baseruby
-  untrace_var(:$ruby, posthook)
-end
-prehook = proc do |extmk|
-  unless extmk
-    config = RbConfig::CONFIG
-    mkconfig = RbConfig::MAKEFILE_CONFIG
-    mkconfig["top_srcdir"] = $top_srcdir = File.expand_path("@top_srcdir@", builddir)
-    mkconfig["rubyhdrdir"] = "$(top_srcdir)/include"
-    mkconfig["builddir"] = config["builddir"] = builddir
-    config["rubyhdrdir"] = File.join(mkconfig["top_srcdir"], "include")
-    mkconfig["libdir"] = config["libdir"] = mkconfig["topdir"]
-    trace_var(:$ruby, posthook)
-  end
-  untrace_var(:$extmk, prehook)
-end
-trace_var(:$extmk, prehook)
+builddir = File.dirname(__FILE__)
+top_srcdir = File.join(builddir, "@srcdir@")
+$:.unshift(File.expand_path(builddir))
+fake = File.join(top_srcdir, "tool/fake.rb")
+eval(File.read(fake), nil, fake)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]