mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Enclosed version constant
This commit is contained in:
parent
1ad9b231ca
commit
f14409c9bb
1 changed files with 5 additions and 3 deletions
|
@ -2,17 +2,19 @@ require_relative '../../spec_helper'
|
||||||
require 'stringio'
|
require 'stringio'
|
||||||
|
|
||||||
bug_guard = Class.new(VersionGuard) do
|
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)
|
def initialize(bug, version)
|
||||||
@bug = bug
|
@bug = bug
|
||||||
super(version)
|
super(version)
|
||||||
@parameters = [bug, version]
|
@parameters = [bug, version]
|
||||||
end
|
end
|
||||||
def match?
|
def match?
|
||||||
|
version = self.class::VERSION
|
||||||
if Range === @version
|
if Range === @version
|
||||||
@version.include? VERSION
|
@version.include? version
|
||||||
else
|
else
|
||||||
VERSION >= @version
|
version >= @version
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue