mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
fix gem module compatibility with ruby-4-rubygems (#11442)
* fix gem module compatibility with ruby-4-rubygems rubygem's `query` command has recently been removed, see ruby/rubygems#9083. address this by using the `list` command instead. resolves #11397 * add changelog * Adjust changelog fragment. --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
2
changelogs/fragments/11442-gem-module-ruby-4.yml
Normal file
2
changelogs/fragments/11442-gem-module-ruby-4.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- "gem - add compatibility with Ruby 4 rubygems (https://github.com/ansible-collections/community.general/issues/11397, https://github.com/ansible-collections/community.general/pull/11442)."
|
||||||
@@ -160,13 +160,12 @@ def get_rubygems_environ(module):
|
|||||||
|
|
||||||
def get_installed_versions(module, remote=False):
|
def get_installed_versions(module, remote=False):
|
||||||
cmd = get_rubygems_path(module)
|
cmd = get_rubygems_path(module)
|
||||||
cmd.append("query")
|
cmd.append("list")
|
||||||
cmd.extend(common_opts(module))
|
cmd.extend(common_opts(module))
|
||||||
if remote:
|
if remote:
|
||||||
cmd.append("--remote")
|
cmd.append("--remote")
|
||||||
if module.params["repository"]:
|
if module.params["repository"]:
|
||||||
cmd.extend(["--source", module.params["repository"]])
|
cmd.extend(["--source", module.params["repository"]])
|
||||||
cmd.append("-n")
|
|
||||||
cmd.append(f"^{module.params['name']}$")
|
cmd.append(f"^{module.params['name']}$")
|
||||||
|
|
||||||
environ = get_rubygems_environ(module)
|
environ = get_rubygems_environ(module)
|
||||||
|
|||||||
Reference in New Issue
Block a user