This repository was archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Drop Ruby < 2.3 #435
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
a53ab85
Reduce Travis matrix
pirj 13f7104
Bump MRI 2.7 to 2.7.2
pirj 1f43f0f
Bump JRuby to 9.2
pirj 70d85dc
Simplify update RubyGems script
pirj 499c4c5
Simplify fork_supported?
pirj bc3f5de
Simplify ripper_supported?
pirj 8554441
Remove redundant jruby_version
pirj 7fb9297
Remove redundant jruby_9000?
pirj 9c11344
Remove kw_args_supported?
pirj 7784683
Remove supports_rebinding_module_methods?
pirj 5941986
Remove required_kw_args_supported?
pirj 963ac13
Always use require_relative
pirj c952c96
Remove optional_and_splat_args_supported?
pirj e757fd2
Remove caller_locations_supported?
pirj 6754b48
Remove supports_exception_cause?
pirj eb44090
Remove unused module_refinement_supported?
pirj 5887afd
Remove JRuby arity check workaround
pirj 74530e8
Remove 1.8.7-specific workaround
pirj d1fab98
Remove JRuby in 1.8.7 compat mode workaround
pirj 9582d42
Remove 1.9 Open3 workaround
pirj 3bcc44c
Remove module_prepends_supported?
pirj 47d6299
Remove String#encoding workarounds
pirj b0b2f80
Remove Time#nsec workaround
pirj a416c70
Remove 1.9.2-specific workaround
pirj 877fe9d
Simplify a macro definition
pirj ed17177
Update required Ruby version gemspec constraint
pirj 139b468
Bump version
pirj 0291798
Remove explicit gem version constraints
pirj f017880
Remove warning ignores for unsupported rubies
pirj 61d2acd
EXPERIMENTAL: Prototype rspec-dev changes
pirj a4833b4
Remove assorted older rubies workarounds
pirj 2184664
Explicitly require ruby_features where needed
pirj beef835
Remove const_defined? workaround
pirj e42f72b
Remove version-specific details from a doc
pirj 8bb78a7
Prefer Ruby core Mutex to our local copy
pirj ca82cc3
Remove Ruby < 2.3 from AppVeyor
pirj 9ccb1c9
Remove old JRuby workaround
pirj a7737b4
Remove usages of jruby_9000
pirj ea6ada6
Remove non_mri?
pirj 6e546c9
Retire 1.8-induced RuboCop settings
pirj 213a999
TEMP: Update maintenance-branch to keep all changes in sync
pirj 09ac883
TEMP: Don't clone rspec?
pirj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,46 +1 @@ | |||
module RSpec | # FIXME: if you remove this, `double`, `hide_const`, `stub_const` can't be found in specs | ||
module Support | |||
# @private | |||
class ComparableVersion | |||
include Comparable | |||
|
|||
attr_reader :string | |||
|
|||
def initialize(string) | |||
@string = string | |||
end | |||
|
|||
def <=>(other) # rubocop:disable Metrics/AbcSize | |||
other = self.class.new(other) unless other.is_a?(self.class) | |||
|
|||
return 0 if string == other.string | |||
|
|||
longer_segment_count = [self, other].map { |version| version.segments.count }.max | |||
|
|||
longer_segment_count.times do |index| | |||
self_segment = segments[index] || 0 | |||
other_segment = other.segments[index] || 0 | |||
|
|||
if self_segment.class == other_segment.class | |||
result = self_segment <=> other_segment | |||
return result unless result == 0 | |||
else | |||
return self_segment.is_a?(String) ? -1 : 1 | |||
end | |||
end | |||
|
|||
0 | |||
end | |||
|
|||
def segments | |||
@segments ||= string.scan(/[a-z]+|\d+/i).map do |segment| | |||
if segment =~ /\A\d+\z/ | |||
segment.to_i | |||
else | |||
segment | |||
end | |||
end | |||
end | |||
end | |||
end | |||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤯 🤷♂️