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

Refactored AppRunner and Console Main to use smaller methods. #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

j-cordova-aptera
Copy link

ConsoleMain.cs -- Took logic out of this class and moved it to MainRunner.cs

AppRunner.cs, MainRunner.cs -- extracted functionality of longer methods into smaller methods

ConsoleMain.cs -- Took logic out of this class and moved it to MainRunner.cs

AppRunner.cs, MainRunner.cs -- extracted functionality of longer methods into smaller methods
Copy link
Contributor

@savornicesei savornicesei left a comment

Choose a reason for hiding this comment

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

Just my thoughts on this PR...

private static void DisplayHelp(OptionSet opts)

private void DisplayHelp(OptionSet opts)
{
Assembly thisApp = Assembly.GetExecutingAssembly();
Stream helpStream = thisApp.GetManifestResourceStream("ThoughtWorks.CruiseControl.Console.Help.txt");
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @j-cordova-aptera

Some using(Stream sr = ...) would ensure the streams are properly handled in case of an error.
I also see no need for the WriteHelpToConsole method since it's used only here.

useShadowCopying);
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I prefer public methods to appear first in a class and then the protected/private ones.

}
catch (RemotingException)
{
// Sometimes this exception gets thrown and not sure why.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to log the RemotingException errors at debug level.

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