Commit a0fb8b36 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾 Committed by Kirill Smelkov

Fix: make gem_search_pattern compatible with rubygems > 3.0

Search pattern for a gem name for rubygems > 3.0 is in format ^gem_name$ instead
of /^gem_name$/ for rubygems < 3.0

/reviewed-by @kirr
/reviewed-on nexedi/rubygemsrecipe!6
parent 158851a4
......@@ -207,6 +207,7 @@ class Recipe(object):
}
recipe = Download(self.buildout, self.name, options)
recipe.install()
self.version = version
current_dir = os.getcwd()
try:
......@@ -292,13 +293,17 @@ class Recipe(object):
return gem_executable[0]
def get_dependency_list(self, gem_dict, gem_executable):
gem_search_pattern = '^' + gem_dict['gemname'].replace('.',r'\.') + '$'
if self.version[0] < '3':
gem_search_pattern = '/' + gem_search_pattern + '/'
cmd = [
self.ruby_executable,
gem_executable,
'dependency',
'-rv',
gem_dict['version'],
'/^' + gem_dict['gemname'].replace('.',r'\.') + '$/',
gem_search_pattern,
]
cmd_result = self.run(cmd, self._get_env())
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment