ploeh / ZeroToNine

A tool for maintaining .NET Assembly versions across multiple files.
MIT License
147 stars 16 forks source link

Support for partial versions #15

Closed moodmosaic closed 10 years ago

moodmosaic commented 10 years ago

This Pull Request addresses #14 by adding support for versions with less than four components.

The following cases are now supported:

AssemblyVersion("2.1")
AssemblyFileVersion("2.1")

AssemblyVersion("2.1.4")
AssemblyFileVersion("2.1.4")

Because an ArgumentException is thrown when initializing a Version instance with fewer than two components in the constructor the following cases are not supported:

AssemblyVersion("2")
AssemblyFileVersion("2")

The proposed implementation is based exclusively on Regular Expressions by turning minor, build, and revision components into Optional Items thus expanding the Capturing Groups of the pattern matching.

ploeh commented 10 years ago

Thank you for your contribution.

Is there any particular reason why you didn't add any test cases to the TryParseVersionInformationReturnsCorrectData function?

This test function exercises the TryParse function, which is the heart of ZeroToNine.

FWIW, I consider retiring the IncrementAssemblyAttribute function...

moodmosaic commented 10 years ago

No, not that I can think of... They are now added in 60eedf3.

ploeh commented 10 years ago

Thank you for your contribution! It's now live as Zero29 0.4.1 and ZeroToNine 0.4.1.