Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
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
ruby-build
Commits
b275e87c
Commit
b275e87c
authored
Sep 08, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #632 from sstephenson/definitions-completion
`rbenv install` completion includes definitions from plugins
parents
aaf50ec6
56c8f296
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
+27
-13
bin/rbenv-install
+13
-13
test/rbenv.bats
+14
-0
No files found.
bin/rbenv-install
View file @
b275e87c
...
@@ -24,15 +24,24 @@
...
@@ -24,15 +24,24 @@
set
-e
set
-e
[
-n
"
$RBENV_DEBUG
"
]
&&
set
-x
[
-n
"
$RBENV_DEBUG
"
]
&&
set
-x
if
[
-z
"
$RBENV_ROOT
"
]
;
then
RBENV_ROOT
=
"
${
HOME
}
/.rbenv"
fi
# Add `share/ruby-build/` directory from each rbenv plugin to the list of
# paths where build definitions are looked up.
shopt
-s
nullglob
for
plugin_path
in
"
$RBENV_ROOT
"
/plugins/
*
/share/ruby-build
;
do
RUBY_BUILD_DEFINITIONS
=
"
${
RUBY_BUILD_DEFINITIONS
}
:
${
plugin_path
}
"
done
export
RUBY_BUILD_DEFINITIONS
shopt
-u
nullglob
# Provide rbenv completions
# Provide rbenv completions
if
[
"
$1
"
=
"--complete"
]
;
then
if
[
"
$1
"
=
"--complete"
]
;
then
exec
ruby-build
--definitions
exec
ruby-build
--definitions
fi
fi
if
[
-z
"
$RBENV_ROOT
"
]
;
then
RBENV_ROOT
=
"
${
HOME
}
/.rbenv"
fi
# Load shared library functions
# Load shared library functions
eval
"
$(
ruby-build
--lib
)
"
eval
"
$(
ruby-build
--lib
)
"
...
@@ -51,15 +60,6 @@ indent() {
...
@@ -51,15 +60,6 @@ indent() {
sed
's/^/ /'
sed
's/^/ /'
}
}
# Add `share/ruby-build/` directory from each rbenv plugin to the list of
# paths where build definitions are looked up.
shopt
-s
nullglob
for
plugin_path
in
"
$RBENV_ROOT
"
/plugins/
*
/share/ruby-build
;
do
RUBY_BUILD_DEFINITIONS
=
"
${
RUBY_BUILD_DEFINITIONS
}
:
${
plugin_path
}
"
done
export
RUBY_BUILD_DEFINITIONS
shopt
-u
nullglob
unset
FORCE
unset
FORCE
unset
SKIP_EXISTING
unset
SKIP_EXISTING
unset
KEEP
unset
KEEP
...
...
test/rbenv.bats
View file @
b275e87c
...
@@ -110,3 +110,17 @@ Available versions:
...
@@ -110,3 +110,17 @@ Available versions:
${RBENV_ROOT}/plugins/foo/share/ruby-build
${RBENV_ROOT}/plugins/foo/share/ruby-build
OUT
OUT
}
}
@test "completion results include build definitions from plugins" {
mkdir -p "${RBENV_ROOT}/plugins/foo/share/ruby-build"
mkdir -p "${RBENV_ROOT}/plugins/bar/share/ruby-build"
stub ruby-build "--definitions : echo \$RUBY_BUILD_DEFINITIONS | tr ':' $'\\n'"
run rbenv-install --complete
assert_success
assert_output <<OUT
${RBENV_ROOT}/plugins/bar/share/ruby-build
${RBENV_ROOT}/plugins/foo/share/ruby-build
OUT
}
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