forked from chucknorris/roundhouse
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue chucknorris#120 (Pass version via command line argument)
- Add CommandLineVersionResolver.cs which extracts version directly from a string. - Update VersionResolverBuilder.cs to include the new resolver. Logic now groups the file based resolvers together and skips them if the command line resolver is valid. - Added Version property to the configuration objects. - Fix small typo / spelling error (already submitted in Pull Request chucknorris#134
- Loading branch information
1 parent
7a02c2a
commit 3a94914
Showing
6 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
product/roundhouse/resolvers/CommandLineVersionResolver.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using roundhouse.infrastructure.logging; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace roundhouse.resolvers | ||
{ | ||
public sealed class CommandLineVersionResolver : VersionResolver | ||
{ | ||
private readonly string _version; | ||
|
||
public CommandLineVersionResolver(string version) | ||
{ | ||
_version = version; | ||
} | ||
public bool meets_criteria() | ||
{ | ||
return !string.IsNullOrEmpty(_version); | ||
} | ||
|
||
public string resolve_version() | ||
{ | ||
Log.bound_to(this).log_an_info_event_containing( | ||
" Found version {0} from command line argument.", _version); | ||
|
||
return _version; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters