From 4a7eef57895983df41256fbc75d0a4cdd18c6a29 Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Wed, 16 Oct 2024 10:05:27 -0400 Subject: [PATCH] Refactor gemfile scanning regexp Now supports combined use of `~>` and `>` or `>=` for determining minimum allowed versions. --- gemfiles/minimum_dependencies.gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/minimum_dependencies.gemfile b/gemfiles/minimum_dependencies.gemfile index 115d932..a5f58d7 100644 --- a/gemfiles/minimum_dependencies.gemfile +++ b/gemfiles/minimum_dependencies.gemfile @@ -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] }