Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
github
oh-my-zsh
Commits
6bab89a4
Commit
6bab89a4
authored
Dec 26, 2011
by
Robby Russell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #671 from peterhoeg/
31cddcd3
fix: rbenv plugin - gemset.
parents
359fe538
31cddcd3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
rbenv.plugin.zsh
plugins/rbenv/rbenv.plugin.zsh
+44
-0
No files found.
plugins/rbenv/rbenv.plugin.zsh
0 → 100644
View file @
6bab89a4
FOUND_RBENV
=
0
for
rbenvdir
in
"
$HOME
/.rbenv"
"/usr/local/rbenv"
"/opt/rbenv"
;
do
if
[
-d
$rbenvdir
/bin
-a
$FOUND_RBENV
-eq
0
]
;
then
FOUND_RBENV
=
1
export
RBENV_ROOT
=
$rbenvdir
export
PATH
=
${
rbenvdir
}
/bin:
$PATH
eval
"
$(
rbenv init -
)
"
alias
rubies
=
"rbenv versions"
alias
gemsets
=
"rbenv gemset list"
function
current_ruby
()
{
echo
"
$(
rbenv version-name
)
"
}
function
current_gemset
()
{
echo
"
$(
rbenv gemset active 2&>/dev/null |
sed
-e
":a"
-e
'$ s/\n/+/gp;N;b a'
|
head
-n1
)
"
}
function
gems
{
local
rbenv_path
=
$(
rbenv prefix
)
gem list
$@
|
sed
\
-Ee
"s/
\(
[0-9
\.
]+( .+)?
\)
/
$fg
[blue]&
$reset_color
/g"
\
-Ee
"s|
$(
echo
$rbenv_path
)
|
$fg
[magenta]
\$
rbenv_path
$reset_color
|g"
\
-Ee
"s/
$current_ruby
@global/
$fg
[yellow]&
$reset_color
/g"
\
-Ee
"s/
$current_ruby$current_gemset$/$fg
[green]&
$reset_color
/g"
}
function
rbenv_prompt_info
()
{
if
[[
-n
$(
current_gemset
)
]]
;
then
echo
"
$(
current_ruby
)
@
$(
current_gemset
)
"
else
echo
"
$(
current_ruby
)
"
fi
}
fi
done
unset
rbenvdir
if
[
$FOUND_RBENV
-eq
0
]
;
then
alias
rubies
=
'ruby -v'
function
gemsets
()
{
echo
'not supported'
}
function
rbenv_prompt_info
()
{
echo
"system:
$(
ruby
-v
|
cut
-f-2
-d
' '
)
"
}
fi
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