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

ruby-changes:51765

From: nobu <ko1@a...>
Date: Mon, 16 Jul 2018 14:05:32 +0900 (JST)
Subject: [ruby-changes:51765] nobu:r63977 (trunk): ruby.c: disable DidYouMean as gem

nobu	2018-07-16 14:05:27 +0900 (Mon, 16 Jul 2018)

  New Revision: 63977

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

  Log:
    ruby.c: disable DidYouMean as gem
    
    * ruby.c (process_options): as DidYouMean requires Rubygems, disable
      the former when the latter is disabled too.

  Modified files:
    trunk/ruby.c
    trunk/test/ruby/test_rubyoptions.rb
Index: ruby.c
===================================================================
--- ruby.c	(revision 63976)
+++ ruby.c	(revision 63977)
@@ -1690,9 +1690,9 @@ process_options(int argc, char **argv, r https://github.com/ruby/ruby/blob/trunk/ruby.c#L1690
     Init_ext();		/* load statically linked extensions before rubygems */
     if (opt->features & FEATURE_BIT(gems)) {
 	rb_define_module("Gem");
-    }
-    if (opt->features & FEATURE_BIT(did_you_mean)) {
-	rb_define_module("DidYouMean");
+	if (opt->features & FEATURE_BIT(did_you_mean)) {
+	    rb_define_module("DidYouMean");
+	}
     }
     ruby_init_prelude();
     if ((opt->features ^ DEFAULT_FEATURES) & COMPILATION_FEATURES) {
Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb	(revision 63976)
+++ test/ruby/test_rubyoptions.rb	(revision 63977)
@@ -151,6 +151,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L151
     assert_in_out_err(%w(--disable), "", [], /missing argument for --disable/)
     assert_in_out_err(%w(--disable-gems -e) + ['p defined? Gem'], "", ["nil"], [])
     assert_in_out_err(%w(--disable-did_you_mean -e) + ['p defined? DidYouMean'], "", ["nil"], [])
+    assert_in_out_err(%w(--disable-gems -e) + ['p defined? DidYouMean'], "", ["nil"], [])
   end
 
   def test_kanji

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

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