Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
e63d008a
Commit
e63d008a
authored
Mar 16, 2013
by
Andrew Dunham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix --include-dependencies parameter on RubyGems >= 2.0.0
parent
94eefac4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
library/gem
+19
-2
No files found.
library/gem
100644 → 100755
View file @
e63d008a
...
@@ -66,6 +66,16 @@ gem: name=rake gem_source=/path/to/gems/rake-1.0.gem state=present
...
@@ -66,6 +66,16 @@ gem: name=rake gem_source=/path/to/gems/rake-1.0.gem state=present
import
re
import
re
def
get_rubygems_version
(
module
):
cmd
=
[
module
.
get_bin_path
(
'gem'
,
True
),
'--version'
]
(
rc
,
out
,
err
)
=
module
.
run_command
(
cmd
,
check_rc
=
True
)
match
=
re
.
match
(
r'^(\d+)\.(\d+)\.(\d+)'
,
out
)
if
not
match
:
return
None
return
tuple
(
int
(
x
)
for
x
in
match
.
groups
())
def
get_installed_versions
(
module
,
remote
=
False
):
def
get_installed_versions
(
module
,
remote
=
False
):
cmd
=
[
module
.
get_bin_path
(
'gem'
,
True
)
]
cmd
=
[
module
.
get_bin_path
(
'gem'
,
True
)
]
...
@@ -118,14 +128,21 @@ def install(module):
...
@@ -118,14 +128,21 @@ def install(module):
if
module
.
check_mode
:
if
module
.
check_mode
:
return
return
ver
=
get_rubygems_version
(
module
)
major
=
ver
[
0
]
if
ver
else
None
cmd
=
[
module
.
get_bin_path
(
'gem'
,
True
)
]
cmd
=
[
module
.
get_bin_path
(
'gem'
,
True
)
]
cmd
.
append
(
'install'
)
cmd
.
append
(
'install'
)
if
module
.
params
[
'version'
]:
if
module
.
params
[
'version'
]:
cmd
.
extend
([
'--version'
,
module
.
params
[
'version'
]
])
cmd
.
extend
([
'--version'
,
module
.
params
[
'version'
]
])
if
module
.
params
[
'repository'
]:
if
module
.
params
[
'repository'
]:
cmd
.
extend
([
'--source'
,
module
.
params
[
'repository'
]
])
cmd
.
extend
([
'--source'
,
module
.
params
[
'repository'
]
])
if
module
.
params
[
'include_dependencies'
]:
if
not
module
.
params
[
'include_dependencies'
]:
cmd
.
append
(
'--include-dependencies'
)
cmd
.
append
(
'--ignore-dependencies'
)
else
:
if
major
and
major
<
2
:
cmd
.
append
(
'--include-dependencies'
)
cmd
.
append
(
'--no-rdoc'
)
cmd
.
append
(
'--no-rdoc'
)
cmd
.
append
(
'--no-ri'
)
cmd
.
append
(
'--no-ri'
)
cmd
.
append
(
module
.
params
[
'gem_source'
])
cmd
.
append
(
module
.
params
[
'gem_source'
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment