berkshelf/solve

= x.y.z is not recognized as a valid version

sethvargo opened this issue · 2 comments

To reproduce:

Solve::Version.new('= 1.2.3')
# => Solve::Errors::InvalidVersionFormat: '= 1.2.3' did not contain a valid version string: 'x.y.z' or 'x.y'.

I feel like the hard-lock, while the same as 1.2.3 should be permitted. Thoughts?

@sethvargo the thing is that anything with a constraint operator (=, >, <, >=, <=) is a Solve::Constraint. We would just end up throwing out the constraint operator if you passed it to the initializer of Solve::Version.

Do you have an example of where you were trying to use this?

Thanks @reset.

Basically, accepting user input on a closed-source project at the moment, but some user's are putting = x.y.z because "that's how they learned it". I could probably just regex for = and give a nicer error.