From 2a25e27979dcdf9033eb9127cff20337fe547b5d Mon Sep 17 00:00:00 2001 From: Guillaume Delpierre Date: Tue, 30 Aug 2016 12:23:24 +0200 Subject: [PATCH] gem: add support for --env-shebang (#4377) * gem: add support for --env-shebang * fix version added --- packaging/language/gem.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packaging/language/gem.py b/packaging/language/gem.py index d3fbc61061d..acd088dc0c5 100644 --- a/packaging/language/gem.py +++ b/packaging/language/gem.py @@ -63,6 +63,12 @@ options: - Override the path to the gem executable required: false version_added: "1.4" + env_shebang: + description: + - Rewrite the shebang line on installed scripts to use /usr/bin/env. + required: false + default: "no" + version_added: "2.2" version: description: - Version of the gem to be installed/removed. @@ -201,6 +207,8 @@ def install(module): cmd.append('--no-ri') else: cmd.append('--no-document') + if module.params['env_shebang']: + cmd.append('--env-shebang') cmd.append(module.params['gem_source']) if module.params['build_flags']: cmd.extend([ '--', module.params['build_flags'] ]) @@ -218,7 +226,8 @@ def main(): state = dict(required=False, default='present', choices=['present','absent','latest'], type='str'), user_install = dict(required=False, default=True, type='bool'), pre_release = dict(required=False, default=False, type='bool'), - include_doc = dict(required=False, default=False, type='bool'), + include_doc = dict(required=False, default=False, type='bool'), + env_shebang = dict(required=False, default=False, type='bool'), version = dict(required=False, type='str'), build_flags = dict(required=False, type='str'), ),