A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ruby/mspec/commit/484310dbed35b84c74484fd674602f88c42d063a below:

Merge pull request #73 from ruby/ak/polish-the-remove-old-guards-script · ruby/mspec@484310d · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+19

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+19

-0

lines changed Original file line number Diff line number Diff line change

@@ -1,6 +1,23 @@

1 +

#!/usr/bin/env ruby

2 + 1 3

# Removes old version guards in ruby/spec.

2 4

# Run it from the ruby/spec repository root.

3 5

# 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.

4 21 5 22

def dedent(line)

6 23

if line.start_with?(" ")

@@ -105,6 +122,8 @@ def search(regexp)

105 122

end

106 123

end

107 124 125 +

abort "usage: #{$0} <ruby-version>" if ARGV.empty?

126 + 108 127

version = Regexp.escape(ARGV.fetch(0))

109 128

version += "(?:\\.0)?" if version.count(".") < 2

110 129

remove_guards(/ruby_version_is (["'])#{version}\1 do/, true)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4