ruby-changes:60420
From: Nobuyoshi <ko1@a...>
Date: Sun, 15 Mar 2020 22:22:06 +0900 (JST)
Subject: [ruby-changes:60420] f14409c9bb (master): Enclosed version constant
https://git.ruby-lang.org/ruby.git/commit/?id=f14409c9bb From f14409c9bb65451618b5f2da82ab9b138ec77469 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 15 Mar 2020 22:20:16 +0900 Subject: Enclosed version constant diff --git a/spec/ruby/library/stringio/initialize_spec.rb b/spec/ruby/library/stringio/initialize_spec.rb index 5900313..1422a15 100644 --- a/spec/ruby/library/stringio/initialize_spec.rb +++ b/spec/ruby/library/stringio/initialize_spec.rb @@ -2,17 +2,19 @@ require_relative '../../spec_helper' https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/stringio/initialize_spec.rb#L2 require 'stringio' bug_guard = Class.new(VersionGuard) do - VERSION = StringIO.const_defined?(:VERSION) ? StringIO::VERSION : "0.0.2" + self::VERSION = StringIO.const_defined?(:VERSION) ? StringIO::VERSION : "0.0.2" + def initialize(bug, version) @bug = bug super(version) @parameters = [bug, version] end def match? + version = self.class::VERSION if Range === @version - @version.include? VERSION + @version.include? version else - VERSION >= @version + version >= @version end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/