gem module supports prerelease (--pre)

This commit is contained in:
Bob Zoller 2013-12-18 11:34:08 -08:00 committed by Michael DeHaan
parent 6c206b3866
commit b023f32cdf

View file

@ -67,6 +67,12 @@ options:
description:
- Version of the gem to be installed/removed.
required: false
prerelease:
description:
- Allow installation of prerelease versions of the gem.
required: false
default: "no"
version_added: "1.6"
author: Johan Wiren
'''
@ -174,6 +180,8 @@ def install(module):
cmd.append('--user-install')
else:
cmd.append('--no-user-install')
if module.params['prerelease']:
cmd.append('--pre')
cmd.append('--no-rdoc')
cmd.append('--no-ri')
cmd.append(module.params['gem_source'])
@ -190,6 +198,7 @@ def main():
repository = dict(required=False, aliases=['source'], type='str'),
state = dict(required=False, default='present', choices=['present','absent','latest'], type='str'),
user_install = dict(required=False, default=True, type='bool'),
prerelease = dict(required=False, default=False, type='bool'),
version = dict(required=False, type='str'),
),
supports_check_mode = True,