File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env ruby
2+
13# Removes old version guards in ruby/spec.
24# Run it from the ruby/spec repository root.
35# The argument is the new minimum supported version.
6+ #
7+ # cd spec
8+ # ../mspec/tool/remove_old_guards.rb <ruby-version>
9+ #
10+ # where <ruby-version> is a version guard with which should be removed
11+ #
12+ # Example:
13+ # tool/remove_old_guards.rb 3.1
14+ #
15+ # As a result guards like
16+ # ruby_version_is "3.1" do
17+ # # ...
18+ # end
19+ #
20+ # will be removed.
421
522def dedent ( line )
623 if line . start_with? ( " " )
@@ -105,6 +122,8 @@ def search(regexp)
105122 end
106123end
107124
125+ abort "usage: #{ $0} <ruby-version>" if ARGV . empty?
126+
108127version = Regexp . escape ( ARGV . fetch ( 0 ) )
109128version += "(?:\\ .0)?" if version . count ( "." ) < 2
110129remove_guards ( /ruby_version_is (["'])#{ version } \1 do/ , true )
You can’t perform that action at this time.
0 commit comments