Skip to content

Commit

Permalink
Merge pull request b-ryan#81 from flyinprogramer/master
Browse files Browse the repository at this point in the history
Adds support for gemsets which are a thing for RVM users
  • Loading branch information
amtrivedi91 committed Jul 16, 2013
2 parents ef6ae51 + f7f0cf9 commit f4241ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions segments/ruby_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ def add_ruby_version_segment():
p1 = subprocess.Popen(["ruby", "-v"], stdout=subprocess.PIPE)
p2 = subprocess.Popen(["sed", "s/ (.*//"], stdin=p1.stdout, stdout=subprocess.PIPE)
version = p2.communicate()[0].rstrip()
if os.environ.has_key("GEM_HOME"):
gem = os.environ["GEM_HOME"].split("@")
if len(gem) > 1:
version += " " + gem[1]
powerline.append(version, 15, 1)
except OSError:
return
Expand Down

0 comments on commit f4241ac

Please sign in to comment.