Skip to content

Commit

Permalink
Refactor gemfile scanning regexp
Browse files Browse the repository at this point in the history
Now supports combined use of `~>` and `>` or `>=` for determining minimum allowed versions.
  • Loading branch information
jgarber623-cargosense committed Oct 16, 2024
1 parent 610a3b5 commit 4a7eef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gemfiles/minimum_dependencies.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ eval_gemfile "../Gemfile"
File
.read("rubocop-cargosense.gemspec")
.each_line(chomp: true)
.grep(/add_dependency/) { |line| line.scan(/add_dependency "(.+)", "~> (.+)"$/).flatten }
.grep(/add_dependency/) { |line| line.scan(/add_dependency "(.+?)",.* "(?:>=?|~>) (.+)"$/).flatten }
.each { |line| gem line[0], line[1] }

0 comments on commit 4a7eef5

Please sign in to comment.