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

ruby-changes:17899

From: yugui <ko1@a...>
Date: Wed, 24 Nov 2010 18:37:38 +0900 (JST)
Subject: [ruby-changes:17899] Ruby:r29914 (ruby_1_9_2): merges r29280 from trunk into ruby_1_9_2 and adds a minimal regression

yugui	2010-11-24 18:37:20 +0900 (Wed, 24 Nov 2010)

  New Revision: 29914

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

  Log:
    merges r29280 from trunk into ruby_1_9_2 and adds a minimal regression
    test.
    --
    * lib/tracer.rb: count only non-internal libraries in stack trace,
      ignoring custom_require.  [ruby-core:31858]

  Added files:
    branches/ruby_1_9_2/test/test_tracer.rb
  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/lib/tracer.rb
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 29913)
+++ ruby_1_9_2/ChangeLog	(revision 29914)
@@ -1,3 +1,8 @@
+Fri Sep 17 08:30:27 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/tracer.rb: count only non-internal libraries in stack trace,
+	  ignoring custom_require.  [ruby-core:31858]
+
 Thu Sep 16 08:30:28 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* sprintf.c (rb_f_sprintf): fix rdoc.  pointed out by Tomoyuki
Index: ruby_1_9_2/lib/tracer.rb
===================================================================
--- ruby_1_9_2/lib/tracer.rb	(revision 29913)
+++ ruby_1_9_2/lib/tracer.rb	(revision 29914)
@@ -190,6 +190,6 @@
   ARGV.shift
   Tracer.on
   require $0
-elsif caller.size <= 1 
+elsif caller.count {|bt| /\A<internal:[^<>]+>:/ !~ bt} <= 1
   Tracer.on
 end
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 29913)
+++ ruby_1_9_2/version.h	(revision 29914)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 46
+#define RUBY_PATCHLEVEL 47
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_2/test/test_tracer.rb
===================================================================
--- ruby_1_9_2/test/test_tracer.rb	(revision 0)
+++ ruby_1_9_2/test/test_tracer.rb	(revision 29914)
@@ -0,0 +1,20 @@
+require 'test/unit'
+require_relative 'ruby/envutil'
+
+class TestTracer < Test::Unit::TestCase
+  include EnvUtil
+
+  def test_work_with_e
+    assert_in_out_err(%w[-rtracer -e 1]) do |(*lines),|
+      case lines.size
+      when 2
+        assert_match %r[#0:<internal:lib/rubygems/custom_require>:\d+:Kernel:<: -], lines[0]
+      when 1
+        # do nothing
+      else
+        flunk 'unexpected output from `ruby -rtracer -e 1`'
+      end
+      assert_equal "#0:-e:1::-: 1", lines[1]
+    end
+  end
+end

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

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