File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change
1
+ require 'mspec/utils/deprecate'
1
2
require 'mspec/utils/version'
2
3
require 'mspec/guards/guard'
3
4
@@ -9,6 +10,9 @@ def initialize(version)
9
10
when Range
10
11
a = SpecVersion . new version . begin
11
12
b = SpecVersion . new version . end
13
+ unless version . exclude_end?
14
+ MSpec . deprecate "ruby_version_is with an inclusive range" , 'an exclusive range ("2.1"..."2.3")'
15
+ end
12
16
@version = version . exclude_end? ? a ...b : a ..b
13
17
end
14
18
self . parameters = [ version ]
Original file line number Diff line number Diff line change
1
+ module MSpec
2
+ def self . deprecate ( what , replacement )
3
+ $stderr. puts "\n #{ what } is deprecated, use #{ replacement } instead."
4
+ user_caller = caller . find { |line | !line . include? ( 'lib/mspec' ) }
5
+ $stderr. puts "from #{ user_caller } "
6
+ end
7
+ end
You can’t perform that action at this time.
0 commit comments