Skip to content

Conversation

@manasdk
Copy link
Contributor

@manasdk manasdk commented Aug 21, 2015

  • The original sort looks ok but it acts very strange on the minor and patch values
  • The new sort is not as elegant but it works reliably.

With the previous sort even with ["0.11.0", "0.11.1", "0.11.2", "0.11.2", "0.11.3", "0.11.4", "0.11.5", "0.11.6", "0.12.0", "0.12.1", "0.12.2", "0.8.3", "0.9.0", "0.9.0", "0.9.1", "0.9.2"]
it would return 0.12.1 as highest. The new one does the right sort.

* The original sort looks ok but it acts very strange on the minor and patch values
* The new sort is not as elegant but it works reliably.

With the previous sort even with ["0.11.0", "0.11.1", "0.11.2", "0.11.2", "0.11.3", "0.11.4", "0.11.5", "0.11.6", "0.12.0", "0.12.1", "0.12.2", "0.8.3", "0.9.0", "0.9.0", "0.9.1", "0.9.2"]
it would return 0.12.1 as highest. The new one does the right sort.
@manasdk
Copy link
Contributor Author

manasdk commented Aug 21, 2015

/cc jfryman

If you have a better idea feel free to close PR and submit alternate fix. Best I could come up with :)

@jfryman
Copy link
Contributor

jfryman commented Aug 21, 2015

What a mess, right? Usually, I'd install a library and be done with it.

Thanks for the fix.

jfryman added a commit that referenced this pull request Aug 21, 2015
Original sort was broken so fixed with a somewhat stabler sort
@jfryman jfryman merged commit 830b72f into master Aug 21, 2015
@jfryman jfryman deleted the fix_version_check branch August 21, 2015 11:39
@manasdk
Copy link
Contributor Author

manasdk commented Aug 21, 2015

Lol. I thought you would reject it as ugly ruby (btw, 1st time writing ruby) or write some short 1liner and do some magic :)

Thanks for merging!

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.

3 participants