Skip to content

Commit

Permalink
Deprecate support for Ruby versions earlier than v2.0
Browse files Browse the repository at this point in the history
This is long overdue. Extended maintenance of Ruby v1.9.3 ended on 23
Feb 2015 [1]. Actually dropping support will allow significant
simplification of the code.

The immediate motivation is to come up with better parameter matching
for keyword arguments and we've run into parsing issues when trying to
do this in conjunction with continuing to support Ruby v1.9.

See #325.

[1]: https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/
  • Loading branch information
wasabigeek authored and floehopper committed Sep 20, 2022
1 parent 6a09a37 commit 185a7bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/mocha/ruby_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
require 'mocha/deprecation'

module Mocha
RUBY_V2_PLUS = Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2')

unless RUBY_V2_PLUS
Mocha::Deprecation.warning(
'Versions of Ruby earlier than v2.0 will not be supported in future versions of Mocha.'
)
end
end

0 comments on commit 185a7bf

Please sign in to comment.