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

ruby-changes:59964

From: Kazuhiro <ko1@a...>
Date: Sun, 9 Feb 2020 13:39:47 +0900 (JST)
Subject: [ruby-changes:59964] e077a910b6 (master): Fix message of ExceptionForMatrix::ErrOperationNotDefined

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

From e077a910b62ef448380c3f9607d740e5c98100b3 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Sun, 9 Feb 2020 13:39:24 +0900
Subject: Fix message of ExceptionForMatrix::ErrOperationNotDefined

```
 % RBENV_VERSION=2.6.5 ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)'
 #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can't be defined: Vector op Vector>
 % RBENV_VERSION=2.7.0 ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)'
 #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can\'t be defined: Vector op Vector>
 % RBENV_VERSION=master ruby -r matrix -e 'Vector[1]*Vector[2] rescue p($!)'
 #<ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can't be defined: Vector op Vector>
```

diff --git a/lib/matrix.rb b/lib/matrix.rb
index fc0e8ef..81e3f59 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -38,7 +38,7 @@ module ExceptionForMatrix # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/matrix.rb#L38
   class ErrOperationNotDefined < StandardError
     def initialize(vals)
       if vals.is_a?(Array)
-        super("Operation(#{vals[0]}) can\\'t be defined: #{vals[1]} op #{vals[2]}")
+        super("Operation(#{vals[0]}) can't be defined: #{vals[1]} op #{vals[2]}")
       else
         super(vals)
       end
-- 
cgit v0.10.2


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

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