Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants