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

ruby-changes:55957

From: Nobuyoshi <ko1@a...>
Date: Sun, 2 Jun 2019 20:32:03 +0900 (JST)
Subject: [ruby-changes:55957] Nobuyoshi Nakada: d04ebc57f2 (trunk): Add true condition `Reline`

https://git.ruby-lang.org/ruby.git/commit/?id=d04ebc57f2

From d04ebc57f232e1a2ca36bd3d5ed9a24f63ee43d6 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 2 Jun 2019 12:21:09 +0900
Subject: Add true condition `Reline`


diff --git a/lib/reline/config.rb b/lib/reline/config.rb
index b5ed6a8..6330f77 100644
--- a/lib/reline/config.rb
+++ b/lib/reline/config.rb
@@ -143,6 +143,7 @@ class Reline::Config https://github.com/ruby/ruby/blob/trunk/lib/reline/config.rb#L143
       when 'version'
       else # application name
         condition = true if args == 'Ruby'
+        condition = true if args == 'Reline'
       end
       unless @skip_section.nil?
         @if_stack << @skip_section
diff --git a/test/reline/test_config.rb b/test/reline/test_config.rb
index 1e65c88..bb9bb30 100644
--- a/test/reline/test_config.rb
+++ b/test/reline/test_config.rb
@@ -103,16 +103,18 @@ class Reline::Config::Test < Reline::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/test_config.rb#L103
   end
 
   def test_if_with_indent
-    @config.read_lines(<<~LINES.split(/(?<=\n)/))
-      set bell-style none
-        $if Ruby
-          set bell-style audible
-        $else
-          set bell-style visible
-        $endif
-    LINES
-
-    assert_equal :audible, @config.instance_variable_get(:@bell_style)
+    %w[Ruby Reline].each do |cond|
+      @config.read_lines(<<~LINES.split(/(?<=\n)/))
+        set bell-style none
+          $if #{cond}
+            set bell-style audible
+          $else
+            set bell-style visible
+          $endif
+      LINES
+
+      assert_equal :audible, @config.instance_variable_get(:@bell_style)
+    end
   end
 
   def test_default_key_bindings
-- 
cgit v0.10.2


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

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