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
4ef4ed4c
Commit
4ef4ed4c
authored
Sep 11, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #633 from sstephenson/upgrade-instructions
Show specific upgrade instructions based on environment
parents
5285456b
aa4a237f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
bin/rbenv-install
+12
-4
test/rbenv.bats
+26
-4
No files found.
bin/rbenv-install
View file @
4ef4ed4c
...
@@ -195,17 +195,25 @@ ruby-build $KEEP $VERBOSE $HAS_PATCH "$DEFINITION" "$PREFIX" || STATUS="$?"
...
@@ -195,17 +195,25 @@ ruby-build $KEEP $VERBOSE $HAS_PATCH "$DEFINITION" "$PREFIX" || STATUS="$?"
# Display a more helpful message if the definition wasn't found.
# Display a more helpful message if the definition wasn't found.
if
[
"
$STATUS
"
==
"2"
]
;
then
if
[
"
$STATUS
"
==
"2"
]
;
then
{
candidates
=
"
$(
definitions
"
$DEFINITION
"
)
"
{
candidates
=
"
$(
definitions
"
$DEFINITION
"
)
"
here
=
"
$(
dirname
"
${
0
%/*
}
"
)
"
if
[
-n
"
$candidates
"
]
;
then
if
[
-n
"
$candidates
"
]
;
then
echo
echo
echo
"The following versions contain
\`
$DEFINITION
' in the name:"
echo
"The following versions contain
\`
$DEFINITION
' in the name:"
echo
"
$candidates
"
| indent
echo
"
$candidates
"
| indent
fi
fi
echo
echo
echo
"
You can list
all available versions with
\`
rbenv install --list'."
echo
"
See
all available versions with
\`
rbenv install --list'."
echo
echo
echo
"If the version you're looking for is not present, first try upgrading"
echo
-n
"If the version you need is missing, try upgrading ruby-build"
echo
"ruby-build. If it's still missing, open a request on the ruby-build"
if
[
"
$here
"
!=
"
${
here
#
$(
brew
--prefix
2>/dev/null
)}
"
]
;
then
echo
"issue tracker: https://github.com/sstephenson/ruby-build/issues"
printf
":
\n\n
"
echo
" brew update && brew upgrade ruby-build"
elif
[
-d
"
${
here
}
/.git"
]
;
then
printf
":
\n\n
"
echo
" cd
${
here
}
&& git pull"
else
printf
".
\n
"
fi
}
>
&2
}
>
&2
fi
fi
...
...
test/rbenv.bats
View file @
4ef4ed4c
...
@@ -52,6 +52,7 @@ OUT
...
@@ -52,6 +52,7 @@ OUT
}
}
@test "nonexistent version" {
@test "nonexistent version" {
stub brew false
stub_ruby_build 'echo ERROR >&2 && exit 2' \
stub_ruby_build 'echo ERROR >&2 && exit 2' \
"--definitions : echo 1.8.7 1.9.3-p0 1.9.3-p194 2.1.2 | tr ' ' $'\\n'"
"--definitions : echo 1.8.7 1.9.3-p0 1.9.3-p194 2.1.2 | tr ' ' $'\\n'"
...
@@ -64,13 +65,34 @@ The following versions contain \`1.9.3' in the name:
...
@@ -64,13 +65,34 @@ The following versions contain \`1.9.3' in the name:
1.9.3-p0
1.9.3-p0
1.9.3-p194
1.9.3-p194
You can list
all available versions with \`rbenv install --list'.
See
all available versions with \`rbenv install --list'.
If the version you're looking for is not present, first try upgrading
If the version you need is missing, try upgrading ruby-build:
ruby-build. If it's still missing, open a request on the ruby-build
issue tracker: https://github.com/sstephenson/ruby-build/issues
cd ${BATS_TEST_DIRNAME}/.. && git pull
OUT
unstub ruby-build
}
@test "Homebrew upgrade instructions" {
stub brew "--prefix : echo '${BATS_TEST_DIRNAME%/*}'"
stub_ruby_build 'echo ERROR >&2 && exit 2' \
"--definitions : true"
run rbenv-install 1.9.3
assert_failure
assert_output <<OUT
ERROR
See all available versions with \`rbenv install --list'.
If the version you need is missing, try upgrading ruby-build:
brew update && brew upgrade ruby-build
OUT
OUT
unstub brew
unstub ruby-build
unstub ruby-build
}
}
...
...
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