Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby Segment changes for Python 2/3: #366

Merged
merged 1 commit into from
Feb 23, 2018

Conversation

Blue-Dog-Archolite
Copy link
Contributor

  • use "GEM_HOME" in keys
  • removal of python2 specific code
  • verification of python2 / python3 functionality

gem = os.environ["GEM_HOME"].split("@")
if len(gem) > 1:
version += " " + gem[1]
if "GEM_HOME" in os.environ.keys():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this not be "GEM_HOME" in os.environ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I find this version of the code even nicer:

gem = os.getenv("GEM_HOME", "").split("@")
if len(gem) > 1:
    ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your very right. I was just patching the issue for the python error. I'll fix it up and make it nice and not just functional.

@Blue-Dog-Archolite
Copy link
Contributor Author

@b-ryan Let me know if that is a better format. I find it easier to read.

@b-ryan
Copy link
Owner

b-ryan commented Feb 22, 2018

Looks good. Is there ever a case where GEM_HOME might not contain a @ character. If it didn't this would raise an index error.

- use "GEM_HOME" in keys
- removal of python2 specific code
- verification of python2 / python3 functionality
- use of format in append to replace string join
@Blue-Dog-Archolite
Copy link
Contributor Author

I managed to find one case and that caused the full path of the ruby executable to show and not the gemset.

Code corrected to sort that out.

@b-ryan b-ryan merged commit da8d923 into b-ryan:master Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants