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'
|
||||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue