From a00c20c1af414fe230831049c48f3f3067017d1e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 6 Mar 2012 18:59:43 -0800 Subject: [PATCH] Fixed spelling of enviroment provider (Environment). :) --- NzbDrone.App.Test/RouterTest.cs | 12 +-- .../ConfigFileProviderTest.cs | 2 +- NzbDrone.Common.Test/DiskProviderFixture.cs | 2 +- .../EnviromentProviderTest.cs | 28 +++--- NzbDrone.Common.Test/PathExtentionFixture.cs | 4 +- ...portingService_ReportParseError_Fixture.cs | 2 +- NzbDrone.Common/ConfigFileProvider.cs | 8 +- ...mentProvider.cs => EnvironmentProvider.cs} | 4 +- NzbDrone.Common/IISProvider.cs | 20 ++-- NzbDrone.Common/LogConfiguration.cs | 2 +- .../NlogTargets/ExceptioneerTarget.cs | 4 +- NzbDrone.Common/NzbDrone.Common.csproj | 2 +- NzbDrone.Common/PathExtentions.cs | 92 +++++++++---------- NzbDrone.Common/ReportingService.cs | 8 +- NzbDrone.Common/RestProvider.cs | 12 +-- NzbDrone.Common/SecurityProvider.cs | 8 +- NzbDrone.Core.Test/CentralDispatchFixture.cs | 2 +- NzbDrone.Core.Test/Framework/CoreTest.cs | 2 +- .../ServiceIntegerationFixture.cs | 2 +- .../JobTests/AppUpdateJobFixture.cs | 12 +-- .../AnalyticsProviderFixture.cs | 12 +-- .../GetUpdateLogFixture.cs | 2 +- NzbDrone.Core/CentralDispatch.cs | 14 +-- NzbDrone.Core/Datastore/Connection.cs | 10 +- .../Datastore/Migrations/Migration20110707.cs | 2 +- NzbDrone.Core/Instrumentation/LogProvider.cs | 10 +- NzbDrone.Core/Jobs/AppUpdateJob.cs | 22 ++--- NzbDrone.Core/Providers/AnalyticsProvider.cs | 6 +- NzbDrone.Core/Providers/BackupProvider.cs | 12 +-- NzbDrone.Core/Providers/BannerProvider.cs | 10 +- NzbDrone.Core/Providers/TvDbProvider.cs | 8 +- NzbDrone.Core/Providers/UpdateProvider.cs | 10 +- .../App_Start/Logging.cs | 4 +- .../Controllers/HealthController.cs | 8 +- .../Helpers/HtmlIncludeExtentions.cs | 2 +- NzbDrone.Test.Common/TestBase.cs | 4 +- .../UpdateProviderStartFixture.cs | 6 +- .../UpdateProviderVerifyFixture.cs | 4 +- NzbDrone.Update/Program.cs | 8 +- NzbDrone.Update/Providers/UpdateProvider.cs | 18 ++-- NzbDrone.Web.UI.Test/AutomationTestBase.cs | 12 +-- NzbDrone.Web/App_Start/Logging.cs | 6 +- NzbDrone.Web/App_Start/MiniProfiler.cs | 2 +- NzbDrone.Web/Controllers/LogController.cs | 12 +-- NzbDrone.Web/Controllers/SharedController.cs | 8 +- NzbDrone.Web/Controllers/UpdateController.cs | 12 +-- NzbDrone.Web/Helpers/HtmlIncludeExtentions.cs | 4 +- NzbDrone.Web/Helpers/ProfilerHelper.cs | 4 +- NzbDrone.Web/Views/Shared/_Layout.cshtml | 4 +- NzbDrone/ApplicationServer.cs | 8 +- NzbDrone/CentralDispatch.cs | 8 +- NzbDrone/Providers/MonitoringProvider.cs | 2 +- NzbDrone/Router.cs | 8 +- 53 files changed, 245 insertions(+), 245 deletions(-) rename NzbDrone.Common/{EnviromentProvider.cs => EnvironmentProvider.cs} (97%) diff --git a/NzbDrone.App.Test/RouterTest.cs b/NzbDrone.App.Test/RouterTest.cs index 604db48db..b458a46f2 100644 --- a/NzbDrone.App.Test/RouterTest.cs +++ b/NzbDrone.App.Test/RouterTest.cs @@ -51,7 +51,7 @@ namespace NzbDrone.App.Test serviceProviderMock.Setup(c => c.Install(ServiceProvider.NZBDRONE_SERVICE_NAME)); serviceProviderMock.Setup(c => c.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)).Returns(false); serviceProviderMock.Setup(c => c.Start(ServiceProvider.NZBDRONE_SERVICE_NAME)); - Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); + Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); Mocker.Resolve().Route(ApplicationMode.InstallService); @@ -64,7 +64,7 @@ namespace NzbDrone.App.Test { var serviceProviderMock = Mocker.GetMock(); serviceProviderMock.Setup(c => c.UnInstall(ServiceProvider.NZBDRONE_SERVICE_NAME)); - Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); + Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); serviceProviderMock.Setup(c => c.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)).Returns(true); Mocker.Resolve().Route(ApplicationMode.UninstallService); @@ -79,7 +79,7 @@ namespace NzbDrone.App.Test var appServerProvider = Mocker.GetMock(); consoleProvider.Setup(c => c.WaitForClose()); appServerProvider.Setup(c => c.Start()); - Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); + Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); Mocker.Resolve().Route(ApplicationMode.Console); @@ -93,7 +93,7 @@ namespace NzbDrone.App.Test [TestCase(ApplicationMode.Help)] public void Route_should_call_service_start_when_run_in_service_more(ApplicationMode applicationMode) { - var envMock = Mocker.GetMock(); + var envMock = Mocker.GetMock(); var serviceProvider = Mocker.GetMock(); envMock.SetupGet(c => c.IsUserInteractive).Returns(false); @@ -111,7 +111,7 @@ namespace NzbDrone.App.Test { var consoleMock = Mocker.GetMock(); var serviceMock = Mocker.GetMock(); - Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); + Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); consoleMock.Setup(c => c.PrintServiceAlreadyExist()); serviceMock.Setup(c => c.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)).Returns(true); @@ -126,7 +126,7 @@ namespace NzbDrone.App.Test { var consoleMock = Mocker.GetMock(); var serviceMock = Mocker.GetMock(); - Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); + Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); consoleMock.Setup(c => c.PrintServiceDoestExist()); serviceMock.Setup(c => c.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)).Returns(false); diff --git a/NzbDrone.Common.Test/ConfigFileProviderTest.cs b/NzbDrone.Common.Test/ConfigFileProviderTest.cs index ad861d1b2..c40467cd2 100644 --- a/NzbDrone.Common.Test/ConfigFileProviderTest.cs +++ b/NzbDrone.Common.Test/ConfigFileProviderTest.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Common.Test WithTempAsAppPath(); //Reset config file - var configFile = Mocker.Resolve().GetConfigPath(); + var configFile = Mocker.Resolve().GetConfigPath(); if (File.Exists(configFile)) File.Delete(configFile); diff --git a/NzbDrone.Common.Test/DiskProviderFixture.cs b/NzbDrone.Common.Test/DiskProviderFixture.cs index b66c01753..c29924494 100644 --- a/NzbDrone.Common.Test/DiskProviderFixture.cs +++ b/NzbDrone.Common.Test/DiskProviderFixture.cs @@ -162,7 +162,7 @@ namespace NzbDrone.Common.Test [Test] public void folder_should_return_correct_value_for_last_write() { - var appPath = new EnviromentProvider().ApplicationPath; + var appPath = new EnvironmentProvider().ApplicationPath; Mocker.Resolve().GetLastDirectoryWrite(appPath).Should().BeOnOrAfter(DateTime.UtcNow.AddMinutes(-10)); Mocker.Resolve().GetLastDirectoryWrite(appPath).Should().BeBefore(DateTime.UtcNow); } diff --git a/NzbDrone.Common.Test/EnviromentProviderTest.cs b/NzbDrone.Common.Test/EnviromentProviderTest.cs index b7d253cf8..f6367e1d8 100644 --- a/NzbDrone.Common.Test/EnviromentProviderTest.cs +++ b/NzbDrone.Common.Test/EnviromentProviderTest.cs @@ -11,61 +11,61 @@ namespace NzbDrone.Common.Test [TestFixture] public class EnviromentProviderTest : TestBase { - readonly EnviromentProvider enviromentProvider = new EnviromentProvider(); + readonly EnvironmentProvider environmentProvider = new EnvironmentProvider(); [Test] public void StartupPath_should_not_be_empty() { - enviromentProvider.StartUpPath.Should().NotBeBlank(); - Path.IsPathRooted(enviromentProvider.StartUpPath).Should().BeTrue("Path is not rooted"); + environmentProvider.StartUpPath.Should().NotBeBlank(); + Path.IsPathRooted(environmentProvider.StartUpPath).Should().BeTrue("Path is not rooted"); } [Test] public void ApplicationPath_should_not_be_empty() { - enviromentProvider.ApplicationPath.Should().NotBeBlank(); - Path.IsPathRooted(enviromentProvider.ApplicationPath).Should().BeTrue("Path is not rooted"); + environmentProvider.ApplicationPath.Should().NotBeBlank(); + Path.IsPathRooted(environmentProvider.ApplicationPath).Should().BeTrue("Path is not rooted"); } [Test] public void ApplicationPath_should_find_root_in_current_folder() { - Directory.CreateDirectory(EnviromentProvider.ROOT_MARKER); - enviromentProvider.ApplicationPath.Should().BeEquivalentTo(Directory.GetCurrentDirectory()); + Directory.CreateDirectory(EnvironmentProvider.ROOT_MARKER); + environmentProvider.ApplicationPath.Should().BeEquivalentTo(Directory.GetCurrentDirectory()); } [Test] public void crawl_should_return_null_if_cant_find_root() { - enviromentProvider.CrawlToRoot("C:\\").Should().BeNullOrEmpty(); + environmentProvider.CrawlToRoot("C:\\").Should().BeNullOrEmpty(); } [Test] public void should_go_up_the_tree_to_find_iis() { - enviromentProvider.ApplicationPath.Should().NotBe(Environment.CurrentDirectory); - enviromentProvider.ApplicationPath.Should().NotBe(enviromentProvider.StartUpPath); + environmentProvider.ApplicationPath.Should().NotBe(Environment.CurrentDirectory); + environmentProvider.ApplicationPath.Should().NotBe(environmentProvider.StartUpPath); } [Test] public void IsProduction_should_return_false_when_run_within_nunit() { - EnviromentProvider.IsProduction.Should().BeFalse(); + EnvironmentProvider.IsProduction.Should().BeFalse(); } [TestCase("0.0.0.0")] [TestCase("1.0.0.0")] public void Application_version_should_not_be_default(string version) { - enviromentProvider.Version.Should().NotBe(new Version(version)); + environmentProvider.Version.Should().NotBe(new Version(version)); } [TearDown] public void TearDown() { - if (Directory.Exists(EnviromentProvider.ROOT_MARKER)) - Directory.Delete(EnviromentProvider.ROOT_MARKER); + if (Directory.Exists(EnvironmentProvider.ROOT_MARKER)) + Directory.Delete(EnvironmentProvider.ROOT_MARKER); } } } diff --git a/NzbDrone.Common.Test/PathExtentionFixture.cs b/NzbDrone.Common.Test/PathExtentionFixture.cs index 9da9f74b2..29885d890 100644 --- a/NzbDrone.Common.Test/PathExtentionFixture.cs +++ b/NzbDrone.Common.Test/PathExtentionFixture.cs @@ -11,9 +11,9 @@ namespace NzbDrone.Common.Test public class PathExtentionFixture : TestBase { - private EnviromentProvider GetEnviromentProvider() + private EnvironmentProvider GetEnviromentProvider() { - var envMoq = new Mock(); + var envMoq = new Mock(); envMoq.SetupGet(c => c.ApplicationPath).Returns(@"C:\NzbDrone\"); diff --git a/NzbDrone.Common.Test/ReportingService_ReportParseError_Fixture.cs b/NzbDrone.Common.Test/ReportingService_ReportParseError_Fixture.cs index 17fccf7b1..efe10a76e 100644 --- a/NzbDrone.Common.Test/ReportingService_ReportParseError_Fixture.cs +++ b/NzbDrone.Common.Test/ReportingService_ReportParseError_Fixture.cs @@ -68,7 +68,7 @@ namespace NzbDrone.Common.Test [Test] public void report_parse_error() { - ReportingService.RestProvider = new RestProvider(new EnviromentProvider()); + ReportingService.RestProvider = new RestProvider(new EnvironmentProvider()); ReportingService.ReportParseError("Test error"); } diff --git a/NzbDrone.Common/ConfigFileProvider.cs b/NzbDrone.Common/ConfigFileProvider.cs index 5f7758a25..ee9b8c6dc 100644 --- a/NzbDrone.Common/ConfigFileProvider.cs +++ b/NzbDrone.Common/ConfigFileProvider.cs @@ -11,16 +11,16 @@ namespace NzbDrone.Common { public class ConfigFileProvider { - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private readonly string _configFile; [Inject] - public ConfigFileProvider(EnviromentProvider enviromentProvider) + public ConfigFileProvider(EnvironmentProvider environmentProvider) { - _enviromentProvider = enviromentProvider; - _configFile = _enviromentProvider.GetConfigPath(); + _environmentProvider = environmentProvider; + _configFile = _environmentProvider.GetConfigPath(); CreateDefaultConfigFile(); } diff --git a/NzbDrone.Common/EnviromentProvider.cs b/NzbDrone.Common/EnvironmentProvider.cs similarity index 97% rename from NzbDrone.Common/EnviromentProvider.cs rename to NzbDrone.Common/EnvironmentProvider.cs index d743b0f85..158ad968c 100644 --- a/NzbDrone.Common/EnviromentProvider.cs +++ b/NzbDrone.Common/EnvironmentProvider.cs @@ -5,7 +5,7 @@ using System.Reflection; namespace NzbDrone.Common { - public class EnviromentProvider + public class EnvironmentProvider { public const string NZBDRONE_PATH = "NZBDRONE_PATH"; public const string NZBDRONE_PID = "NZBDRONE_PID"; @@ -13,7 +13,7 @@ namespace NzbDrone.Common private static readonly string processName = Process.GetCurrentProcess().ProcessName.ToLower(); - private static readonly EnviromentProvider instance = new EnviromentProvider(); + private static readonly EnvironmentProvider instance = new EnvironmentProvider(); public static bool IsProduction { diff --git a/NzbDrone.Common/IISProvider.cs b/NzbDrone.Common/IISProvider.cs index 52a838c3e..b04952dc6 100644 --- a/NzbDrone.Common/IISProvider.cs +++ b/NzbDrone.Common/IISProvider.cs @@ -12,15 +12,15 @@ namespace NzbDrone.Common private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private readonly ConfigFileProvider _configFileProvider; private readonly ProcessProvider _processProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; [Inject] - public IISProvider(ConfigFileProvider configFileProvider, ProcessProvider processProvider, EnviromentProvider enviromentProvider) + public IISProvider(ConfigFileProvider configFileProvider, ProcessProvider processProvider, EnvironmentProvider environmentProvider) { _configFileProvider = configFileProvider; _processProvider = processProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; } public IISProvider() @@ -42,9 +42,9 @@ namespace NzbDrone.Common var startInfo = new ProcessStartInfo(); - startInfo.FileName = _enviromentProvider.GetIISExe(); - startInfo.Arguments = String.Format("/config:\"{0}\" /trace:i", _enviromentProvider.GetIISConfigPath()); - startInfo.WorkingDirectory = _enviromentProvider.ApplicationPath; + startInfo.FileName = _environmentProvider.GetIISExe(); + startInfo.Arguments = String.Format("/config:\"{0}\" /trace:i", _environmentProvider.GetIISConfigPath()); + startInfo.WorkingDirectory = _environmentProvider.ApplicationPath; startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; @@ -52,12 +52,12 @@ namespace NzbDrone.Common startInfo.CreateNoWindow = true; - startInfo.EnvironmentVariables[EnviromentProvider.NZBDRONE_PATH] = _enviromentProvider.ApplicationPath; - startInfo.EnvironmentVariables[EnviromentProvider.NZBDRONE_PID] = Process.GetCurrentProcess().Id.ToString(); + startInfo.EnvironmentVariables[EnvironmentProvider.NZBDRONE_PATH] = _environmentProvider.ApplicationPath; + startInfo.EnvironmentVariables[EnvironmentProvider.NZBDRONE_PID] = Process.GetCurrentProcess().Id.ToString(); try { - _configFileProvider.UpdateIISConfig(_enviromentProvider.GetIISConfigPath()); + _configFileProvider.UpdateIISConfig(_environmentProvider.GetIISConfigPath()); } catch (Exception e) { @@ -102,7 +102,7 @@ namespace NzbDrone.Common foreach (var process in _processProvider.GetProcessByName("IISExpress")) { Logger.Info("[{0}]IIS Process found. Path:{1}", process.Id, process.StartPath); - if (DiskProvider.PathEquals(process.StartPath, _enviromentProvider.GetIISExe())) + if (DiskProvider.PathEquals(process.StartPath, _environmentProvider.GetIISExe())) { Logger.Info("[{0}]Process is considered orphaned.", process.Id); _processProvider.Kill(process.Id); diff --git a/NzbDrone.Common/LogConfiguration.cs b/NzbDrone.Common/LogConfiguration.cs index d45caf20a..d7c16699a 100644 --- a/NzbDrone.Common/LogConfiguration.cs +++ b/NzbDrone.Common/LogConfiguration.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Common { static LogConfiguration() { - if (EnviromentProvider.IsProduction) + if (EnvironmentProvider.IsProduction) { LogManager.ThrowExceptions = false; } diff --git a/NzbDrone.Common/NlogTargets/ExceptioneerTarget.cs b/NzbDrone.Common/NlogTargets/ExceptioneerTarget.cs index 8865a0d32..a07be7978 100644 --- a/NzbDrone.Common/NlogTargets/ExceptioneerTarget.cs +++ b/NzbDrone.Common/NlogTargets/ExceptioneerTarget.cs @@ -11,11 +11,11 @@ namespace NzbDrone.Common.NlogTargets { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - private static readonly Version version = new EnviromentProvider().Version; + private static readonly Version version = new EnvironmentProvider().Version; protected override void Write(LogEventInfo logEvent) { - if (logEvent == null || logEvent.Exception == null || !EnviromentProvider.IsProduction) return; + if (logEvent == null || logEvent.Exception == null || !EnvironmentProvider.IsProduction) return; Logger.Trace("Sending Exception to Exceptioneer. Process Name: {0}", Process.GetCurrentProcess().ProcessName); diff --git a/NzbDrone.Common/NzbDrone.Common.csproj b/NzbDrone.Common/NzbDrone.Common.csproj index 9426c50aa..334d12ba6 100644 --- a/NzbDrone.Common/NzbDrone.Common.csproj +++ b/NzbDrone.Common/NzbDrone.Common.csproj @@ -68,7 +68,7 @@ - + diff --git a/NzbDrone.Common/PathExtentions.cs b/NzbDrone.Common/PathExtentions.cs index 3bef6b7d0..3819ab0f9 100644 --- a/NzbDrone.Common/PathExtentions.cs +++ b/NzbDrone.Common/PathExtentions.cs @@ -42,119 +42,119 @@ namespace NzbDrone.Common } - public static string GetIISFolder(this EnviromentProvider enviromentProvider) + public static string GetIISFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.ApplicationPath, IIS_FOLDER); + return Path.Combine(environmentProvider.ApplicationPath, IIS_FOLDER); } - public static string GetIISExe(this EnviromentProvider enviromentProvider) + public static string GetIISExe(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetIISFolder(), IIS_EXE); + return Path.Combine(environmentProvider.GetIISFolder(), IIS_EXE); } - public static string GetIISConfigPath(this EnviromentProvider enviromentProvider) + public static string GetIISConfigPath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetIISFolder(), "AppServer", "applicationhost.config"); + return Path.Combine(environmentProvider.GetIISFolder(), "AppServer", "applicationhost.config"); } - public static string GetWebRoot(this EnviromentProvider enviromentProvider) + public static string GetWebRoot(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.ApplicationPath, WEB_FOLDER); + return Path.Combine(environmentProvider.ApplicationPath, WEB_FOLDER); } - public static string GetAppDataPath(this EnviromentProvider enviromentProvider) + public static string GetAppDataPath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetWebRoot(), APP_DATA); + return Path.Combine(environmentProvider.GetWebRoot(), APP_DATA); } - public static string GetNlogConfigPath(this EnviromentProvider enviromentProvider) + public static string GetNlogConfigPath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetWebRoot(), LOG_CONFIG_FILE); + return Path.Combine(environmentProvider.GetWebRoot(), LOG_CONFIG_FILE); } - public static string GetConfigPath(this EnviromentProvider enviromentProvider) + public static string GetConfigPath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.ApplicationPath, APP_CONFIG_FILE); + return Path.Combine(environmentProvider.ApplicationPath, APP_CONFIG_FILE); } - public static string GetNzbDronoeDbFile(this EnviromentProvider enviromentProvider) + public static string GetNzbDronoeDbFile(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetAppDataPath(), NZBDRONE_DB_FILE); + return Path.Combine(environmentProvider.GetAppDataPath(), NZBDRONE_DB_FILE); } - public static string GetLogDbFileDbFile(this EnviromentProvider enviromentProvider) + public static string GetLogDbFileDbFile(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetAppDataPath(), LOG_DB_FILE); + return Path.Combine(environmentProvider.GetAppDataPath(), LOG_DB_FILE); } - public static string GetMediaCoverPath(this EnviromentProvider enviromentProvider) + public static string GetMediaCoverPath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetWebRoot(), "MediaCover"); + return Path.Combine(environmentProvider.GetWebRoot(), "MediaCover"); } - public static string GetBannerPath(this EnviromentProvider enviromentProvider) + public static string GetBannerPath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetMediaCoverPath(), "Banners"); + return Path.Combine(environmentProvider.GetMediaCoverPath(), "Banners"); } - public static string GetFanArtPath(this EnviromentProvider enviromentProvider) + public static string GetFanArtPath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetMediaCoverPath(), "Fanarts"); + return Path.Combine(environmentProvider.GetMediaCoverPath(), "Fanarts"); } - public static string GetCacheFolder(this EnviromentProvider enviromentProvider) + public static string GetCacheFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetWebRoot(), "Cache"); + return Path.Combine(environmentProvider.GetWebRoot(), "Cache"); } - public static string GetUpdateLogFolder(this EnviromentProvider enviromentProvider) + public static string GetUpdateLogFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.ApplicationPath, UPDATE_LOG_FOLDER_NAME); + return Path.Combine(environmentProvider.ApplicationPath, UPDATE_LOG_FOLDER_NAME); } - public static string GetUpdateSandboxFolder(this EnviromentProvider enviromentProvider) + public static string GetUpdateSandboxFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.SystemTemp, UPDATE_SANDBOX_FOLDER_NAME); + return Path.Combine(environmentProvider.SystemTemp, UPDATE_SANDBOX_FOLDER_NAME); } - public static string GetUpdateBackUpFolder(this EnviromentProvider enviromentProvider) + public static string GetUpdateBackUpFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetUpdateSandboxFolder(), UPDATE_BACKUP_FOLDER_NAME); + return Path.Combine(environmentProvider.GetUpdateSandboxFolder(), UPDATE_BACKUP_FOLDER_NAME); } - public static string GetUpdatePackageFolder(this EnviromentProvider enviromentProvider) + public static string GetUpdatePackageFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetUpdateSandboxFolder(), UPDATE_PACKAGE_FOLDER_NAME); + return Path.Combine(environmentProvider.GetUpdateSandboxFolder(), UPDATE_PACKAGE_FOLDER_NAME); } - public static string GetUpdateClientFolder(this EnviromentProvider enviromentProvider) + public static string GetUpdateClientFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetUpdatePackageFolder(), UPDATE_CLIENT_FOLDER_NAME); + return Path.Combine(environmentProvider.GetUpdatePackageFolder(), UPDATE_CLIENT_FOLDER_NAME); } - public static string GetUpdateClientExePath(this EnviromentProvider enviromentProvider) + public static string GetUpdateClientExePath(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetUpdateSandboxFolder(), UPDATE_CLIENT_EXE); + return Path.Combine(environmentProvider.GetUpdateSandboxFolder(), UPDATE_CLIENT_EXE); } - public static string GetSandboxLogFolder(this EnviromentProvider enviromentProvider) + public static string GetSandboxLogFolder(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetUpdateSandboxFolder(), UPDATE_LOG_FOLDER_NAME); + return Path.Combine(environmentProvider.GetUpdateSandboxFolder(), UPDATE_LOG_FOLDER_NAME); } - public static string GetLogFileName(this EnviromentProvider enviromentProvider) + public static string GetLogFileName(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.ApplicationPath, "nzbdrone.log.txt"); + return Path.Combine(environmentProvider.ApplicationPath, "nzbdrone.log.txt"); } - public static string GetArchivedLogFileName(this EnviromentProvider enviromentProvider) + public static string GetArchivedLogFileName(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.ApplicationPath, "nzbdrone.log.0.txt"); + return Path.Combine(environmentProvider.ApplicationPath, "nzbdrone.log.0.txt"); } - public static string GetConfigBackupFile(this EnviromentProvider enviromentProvider) + public static string GetConfigBackupFile(this EnvironmentProvider environmentProvider) { - return Path.Combine(enviromentProvider.GetAppDataPath(), BACKUP_ZIP_FILE); + return Path.Combine(environmentProvider.GetAppDataPath(), BACKUP_ZIP_FILE); } } } \ No newline at end of file diff --git a/NzbDrone.Common/ReportingService.cs b/NzbDrone.Common/ReportingService.cs index 834d136ac..ff2eeee48 100644 --- a/NzbDrone.Common/ReportingService.cs +++ b/NzbDrone.Common/ReportingService.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Common } catch (Exception e) { - if (!EnviromentProvider.IsProduction) + if (!EnvironmentProvider.IsProduction) { throw; } @@ -70,7 +70,7 @@ namespace NzbDrone.Common } catch (Exception e) { - if (!EnviromentProvider.IsProduction) + if (!EnvironmentProvider.IsProduction) { throw; } @@ -84,10 +84,10 @@ namespace NzbDrone.Common { if(RestProvider == null) { - if(EnviromentProvider.IsProduction) + if(EnvironmentProvider.IsProduction) { logger.Warn("Rest provider wasn't provided. creating new one!"); - RestProvider = new RestProvider(new EnviromentProvider()); + RestProvider = new RestProvider(new EnvironmentProvider()); } else { diff --git a/NzbDrone.Common/RestProvider.cs b/NzbDrone.Common/RestProvider.cs index ac85a3010..390638264 100644 --- a/NzbDrone.Common/RestProvider.cs +++ b/NzbDrone.Common/RestProvider.cs @@ -16,13 +16,13 @@ namespace NzbDrone.Common private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; [Inject] - public RestProvider(EnviromentProvider enviromentProvider) + public RestProvider(EnvironmentProvider environmentProvider) { - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; } public RestProvider() @@ -35,9 +35,9 @@ namespace NzbDrone.Common public virtual void PostData(string url, ReportBase reportBase) { - reportBase.UGuid = EnviromentProvider.UGuid; - reportBase.Version = _enviromentProvider.Version.ToString(); - reportBase.IsProduction = EnviromentProvider.IsProduction; + reportBase.UGuid = EnvironmentProvider.UGuid; + reportBase.Version = _environmentProvider.Version.ToString(); + reportBase.IsProduction = EnvironmentProvider.IsProduction; PostData(url, reportBase as object); } diff --git a/NzbDrone.Common/SecurityProvider.cs b/NzbDrone.Common/SecurityProvider.cs index bbde053cd..be4abc2b0 100644 --- a/NzbDrone.Common/SecurityProvider.cs +++ b/NzbDrone.Common/SecurityProvider.cs @@ -13,15 +13,15 @@ namespace NzbDrone.Common private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private readonly ConfigFileProvider _configFileProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly ProcessProvider _processProvider; [Inject] - public SecurityProvider(ConfigFileProvider configFileProvider, EnviromentProvider enviromentProvider, + public SecurityProvider(ConfigFileProvider configFileProvider, EnvironmentProvider environmentProvider, ProcessProvider processProvider) { _configFileProvider = configFileProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _processProvider = processProvider; } @@ -55,7 +55,7 @@ namespace NzbDrone.Common } //Skip Url Register if not Vista or 7 - if (_enviromentProvider.GetOsVersion().Major < 6) + if (_environmentProvider.GetOsVersion().Major < 6) return; //Unregister Url (if port != 0) diff --git a/NzbDrone.Core.Test/CentralDispatchFixture.cs b/NzbDrone.Core.Test/CentralDispatchFixture.cs index 204c84478..c969df4e0 100644 --- a/NzbDrone.Core.Test/CentralDispatchFixture.cs +++ b/NzbDrone.Core.Test/CentralDispatchFixture.cs @@ -106,7 +106,7 @@ namespace NzbDrone.Core.Test public void app_should_be_marked_as_new_install_if_db_is_initilized_for_the_first_time() { WithRealDb(); - EnviromentProvider.RegisterNewInstall.Should().Be(true); + EnvironmentProvider.RegisterNewInstall.Should().Be(true); } } diff --git a/NzbDrone.Core.Test/Framework/CoreTest.cs b/NzbDrone.Core.Test/Framework/CoreTest.cs index 558d5402f..dae211d40 100644 --- a/NzbDrone.Core.Test/Framework/CoreTest.cs +++ b/NzbDrone.Core.Test/Framework/CoreTest.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test.Framework } //Delete App_data folder - var appData = new EnviromentProvider().GetAppDataPath(); + var appData = new EnvironmentProvider().GetAppDataPath(); if (Directory.Exists(appData)) { diff --git a/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs b/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs index 55e269f79..70c0f5465 100644 --- a/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs +++ b/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs @@ -58,7 +58,7 @@ namespace NzbDrone.Core.Test.Integeration [Test] public void should_be_able_to_submit_exceptions() { - ReportingService.RestProvider = new RestProvider(new EnviromentProvider()); + ReportingService.RestProvider = new RestProvider(new EnvironmentProvider()); var log = new LogEventInfo(); log.LoggerName = "LoggerName.LoggerName.LoggerName.LoggerName"; diff --git a/NzbDrone.Core.Test/JobTests/AppUpdateJobFixture.cs b/NzbDrone.Core.Test/JobTests/AppUpdateJobFixture.cs index b7c35b018..2e39a2bf1 100644 --- a/NzbDrone.Core.Test/JobTests/AppUpdateJobFixture.cs +++ b/NzbDrone.Core.Test/JobTests/AppUpdateJobFixture.cs @@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.JobTests [SetUp] public void Setup() { - Mocker.GetMock().SetupGet(c => c.SystemTemp).Returns(@"C:\Temp\"); + Mocker.GetMock().SetupGet(c => c.SystemTemp).Returns(@"C:\Temp\"); Mocker.GetMock().SetupGet(c => c.Guid).Returns(_clientGuid); Mocker.GetMock().Setup(c => c.GetAvilableUpdate(It.IsAny())).Returns(updatePackage); } @@ -93,7 +93,7 @@ namespace NzbDrone.Core.Test.JobTests [Test] public void Should_copy_update_client_to_root_of_sandbox() { - var updateClientFolder = Mocker.GetMock().Object.GetUpdateClientFolder(); + var updateClientFolder = Mocker.GetMock().Object.GetUpdateClientFolder(); //Act StartUpdate(); @@ -107,9 +107,9 @@ namespace NzbDrone.Core.Test.JobTests public void should_start_update_client() { //Setup - var updateClientPath = Mocker.GetMock().Object.GetUpdateClientExePath(); + var updateClientPath = Mocker.GetMock().Object.GetUpdateClientExePath(); - Mocker.GetMock() + Mocker.GetMock() .SetupGet(c => c.NzbDroneProcessIdFromEnviroment).Returns(12); //Act @@ -138,9 +138,9 @@ namespace NzbDrone.Core.Test.JobTests public void Should_download_and_extract_to_temp_folder() { - Mocker.GetMock().SetupGet(c => c.SystemTemp).Returns(TempFolder); + Mocker.GetMock().SetupGet(c => c.SystemTemp).Returns(TempFolder); - var updateSubFolder = new DirectoryInfo(Mocker.GetMock().Object.GetUpdateSandboxFolder()); + var updateSubFolder = new DirectoryInfo(Mocker.GetMock().Object.GetUpdateSandboxFolder()); //Act diff --git a/NzbDrone.Core.Test/ProviderTests/AnalyticsProviderTests/AnalyticsProviderFixture.cs b/NzbDrone.Core.Test/ProviderTests/AnalyticsProviderTests/AnalyticsProviderFixture.cs index 1d84ac77e..4758ba56c 100644 --- a/NzbDrone.Core.Test/ProviderTests/AnalyticsProviderTests/AnalyticsProviderFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/AnalyticsProviderTests/AnalyticsProviderFixture.cs @@ -53,7 +53,7 @@ namespace NzbDrone.Core.Test.ProviderTests.AnalyticsProviderTests [Test] public void new_install_should_be_registered() { - EnviromentProvider.RegisterNewInstall = true; + EnvironmentProvider.RegisterNewInstall = true; var provider = Mocker.Resolve(); @@ -65,7 +65,7 @@ namespace NzbDrone.Core.Test.ProviderTests.AnalyticsProviderTests [Test] public void new_install_should_only_be_registered_on_first_call() { - EnviromentProvider.RegisterNewInstall = true; + EnvironmentProvider.RegisterNewInstall = true; var provider = Mocker.Resolve(); @@ -79,7 +79,7 @@ namespace NzbDrone.Core.Test.ProviderTests.AnalyticsProviderTests [Test] public void upgrade_should_not_register_install() { - EnviromentProvider.RegisterNewInstall = false; + EnvironmentProvider.RegisterNewInstall = false; var provider = Mocker.Resolve(); @@ -92,7 +92,7 @@ namespace NzbDrone.Core.Test.ProviderTests.AnalyticsProviderTests [Test] public void shouldnt_register_anything_if_not_on_master_branch() { - EnviromentProvider.RegisterNewInstall = false; + EnvironmentProvider.RegisterNewInstall = false; Mocker.GetMock().SetupGet(c => c.UpdateUrl).Returns("http://update.nzbdrone.com/master_auto/"); @@ -104,7 +104,7 @@ namespace NzbDrone.Core.Test.ProviderTests.AnalyticsProviderTests [Test] public void new_install_shouldnt_register_anything_if_not_on_master_branch() { - EnviromentProvider.RegisterNewInstall = true; + EnvironmentProvider.RegisterNewInstall = true; Mocker.GetMock().SetupGet(c => c.UpdateUrl).Returns("http://update.nzbdrone.com/master_auto/"); @@ -116,7 +116,7 @@ namespace NzbDrone.Core.Test.ProviderTests.AnalyticsProviderTests [Test] public void should_be_able_to_call_deskmetrics_using_test_appid() { - EnviromentProvider.RegisterNewInstall = true; + EnvironmentProvider.RegisterNewInstall = true; Mocker.Resolve().Checkpoint(); } diff --git a/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs b/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs index 3bd737abf..cd029786f 100644 --- a/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.ProviderTests.UpdateProviderTests { WithTempAsAppPath(); - UpdateLogFolder = Mocker.GetMock().Object.GetUpdateLogFolder(); + UpdateLogFolder = Mocker.GetMock().Object.GetUpdateLogFolder(); Mocker.GetMock() .Setup(c => c.GetFiles(UpdateLogFolder, SearchOption.TopDirectoryOnly)) diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index 7d21015ef..af2ca6a11 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -24,13 +24,13 @@ namespace NzbDrone.Core public class CentralDispatch { private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; public StandardKernel Kernel { get; private set; } public CentralDispatch() { - _enviromentProvider = new EnviromentProvider(); + _environmentProvider = new EnvironmentProvider(); logger.Debug("Initializing Kernel:"); Kernel = new StandardKernel(); @@ -52,7 +52,7 @@ namespace NzbDrone.Core { logger.Info("Initializing Database..."); - var appDataPath = _enviromentProvider.GetAppDataPath(); + var appDataPath = _environmentProvider.GetAppDataPath(); if (!Directory.Exists(appDataPath)) Directory.CreateDirectory(appDataPath); var connection = Kernel.Get(); @@ -67,15 +67,15 @@ namespace NzbDrone.Core private void InitReporting() { - EnviromentProvider.UGuid = Kernel.Get().UGuid; + EnvironmentProvider.UGuid = Kernel.Get().UGuid; ReportingService.RestProvider = Kernel.Get(); var appId = AnalyticsProvider.DESKMETRICS_TEST_ID; - if (EnviromentProvider.IsProduction) + if (EnvironmentProvider.IsProduction) appId = AnalyticsProvider.DESKMETRICS_PRODUCTION_ID; - var deskMetricsClient = new DeskMetricsClient(Kernel.Get().UGuid.ToString(), appId, _enviromentProvider.Version); + var deskMetricsClient = new DeskMetricsClient(Kernel.Get().UGuid.ToString(), appId, _environmentProvider.Version); Kernel.Bind().ToConstant(deskMetricsClient); Kernel.Get().Checkpoint(); @@ -149,7 +149,7 @@ namespace NzbDrone.Core { try { - var pid = _enviromentProvider.NzbDroneProcessIdFromEnviroment; + var pid = _environmentProvider.NzbDroneProcessIdFromEnviroment; logger.Debug("Attaching to parent process ({0}) for automatic termination.", pid); diff --git a/NzbDrone.Core/Datastore/Connection.cs b/NzbDrone.Core/Datastore/Connection.cs index c2a019e64..b650997d0 100644 --- a/NzbDrone.Core/Datastore/Connection.cs +++ b/NzbDrone.Core/Datastore/Connection.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Core.Datastore { public class Connection { - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; static Connection() { @@ -23,16 +23,16 @@ namespace NzbDrone.Core.Datastore , "System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"); } - public Connection(EnviromentProvider enviromentProvider) + public Connection(EnvironmentProvider environmentProvider) { - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; } public String MainConnectionString { get { - return GetConnectionString(_enviromentProvider.GetNzbDronoeDbFile()); + return GetConnectionString(_environmentProvider.GetNzbDronoeDbFile()); } } @@ -40,7 +40,7 @@ namespace NzbDrone.Core.Datastore { get { - return GetConnectionString(_enviromentProvider.GetLogDbFileDbFile()); + return GetConnectionString(_environmentProvider.GetLogDbFileDbFile()); } } diff --git a/NzbDrone.Core/Datastore/Migrations/Migration20110707.cs b/NzbDrone.Core/Datastore/Migrations/Migration20110707.cs index f4901672e..af0adf72b 100644 --- a/NzbDrone.Core/Datastore/Migrations/Migration20110707.cs +++ b/NzbDrone.Core/Datastore/Migrations/Migration20110707.cs @@ -12,7 +12,7 @@ namespace NzbDrone.Core.Datastore.Migrations protected override void MainDbUpgrade() { //This should not run unless for a clean install - EnviromentProvider.RegisterNewInstall = true; + EnvironmentProvider.RegisterNewInstall = true; Database.AddTable("Series", new[] { diff --git a/NzbDrone.Core/Instrumentation/LogProvider.cs b/NzbDrone.Core/Instrumentation/LogProvider.cs index 334c476dc..792cb2e73 100644 --- a/NzbDrone.Core/Instrumentation/LogProvider.cs +++ b/NzbDrone.Core/Instrumentation/LogProvider.cs @@ -12,17 +12,17 @@ namespace NzbDrone.Core.Instrumentation private readonly IDatabase _database; private readonly LogDbContext _logDbContext; private readonly DiskProvider _diskProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - public LogProvider(IDatabase database, LogDbContext logDbContext, DiskProvider diskProvider, EnviromentProvider enviromentProvider) + public LogProvider(IDatabase database, LogDbContext logDbContext, DiskProvider diskProvider, EnvironmentProvider environmentProvider) { _database = database; _logDbContext = logDbContext; _diskProvider = diskProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; } public IQueryable GetAllLogs() @@ -52,8 +52,8 @@ namespace NzbDrone.Core.Instrumentation public void DeleteAll() { _database.Delete(""); - _diskProvider.DeleteFile(_enviromentProvider.GetLogFileName()); - _diskProvider.DeleteFile(_enviromentProvider.GetArchivedLogFileName()); + _diskProvider.DeleteFile(_environmentProvider.GetLogFileName()); + _diskProvider.DeleteFile(_environmentProvider.GetArchivedLogFileName()); Logger.Info("Cleared Log History"); } diff --git a/NzbDrone.Core/Jobs/AppUpdateJob.cs b/NzbDrone.Core/Jobs/AppUpdateJob.cs index 2cfb7de05..9be7bd970 100644 --- a/NzbDrone.Core/Jobs/AppUpdateJob.cs +++ b/NzbDrone.Core/Jobs/AppUpdateJob.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Core.Jobs public class AppUpdateJob : IJob { private readonly UpdateProvider _updateProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly DiskProvider _diskProvider; private readonly HttpProvider _httpProvider; private readonly ProcessProvider _processProvider; @@ -24,11 +24,11 @@ namespace NzbDrone.Core.Jobs private static readonly Logger logger = LogManager.GetCurrentClassLogger(); [Inject] - public AppUpdateJob(UpdateProvider updateProvider, EnviromentProvider enviromentProvider, DiskProvider diskProvider, + public AppUpdateJob(UpdateProvider updateProvider, EnvironmentProvider environmentProvider, DiskProvider diskProvider, HttpProvider httpProvider, ProcessProvider processProvider, ArchiveProvider archiveProvider, ConfigFileProvider configFileProvider) { _updateProvider = updateProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _diskProvider = diskProvider; _httpProvider = httpProvider; _processProvider = processProvider; @@ -50,18 +50,18 @@ namespace NzbDrone.Core.Jobs { notification.CurrentMessage = "Checking for updates"; - var updatePackage = _updateProvider.GetAvilableUpdate(_enviromentProvider.Version); + var updatePackage = _updateProvider.GetAvilableUpdate(_environmentProvider.Version); //No updates available if (updatePackage == null) return; - var packageDestination = Path.Combine(_enviromentProvider.GetUpdateSandboxFolder(), updatePackage.FileName); + var packageDestination = Path.Combine(_environmentProvider.GetUpdateSandboxFolder(), updatePackage.FileName); - if (_diskProvider.FolderExists(_enviromentProvider.GetUpdateSandboxFolder())) + if (_diskProvider.FolderExists(_environmentProvider.GetUpdateSandboxFolder())) { logger.Info("Deleting old update files"); - _diskProvider.DeleteFolder(_enviromentProvider.GetUpdateSandboxFolder(), true); + _diskProvider.DeleteFolder(_environmentProvider.GetUpdateSandboxFolder(), true); } logger.Info("Downloading update package from [{0}] to [{1}]", updatePackage.Url, packageDestination); @@ -71,19 +71,19 @@ namespace NzbDrone.Core.Jobs logger.Info("Extracting Update package"); notification.CurrentMessage = "Extracting Update"; - _archiveProvider.ExtractArchive(packageDestination, _enviromentProvider.GetUpdateSandboxFolder()); + _archiveProvider.ExtractArchive(packageDestination, _environmentProvider.GetUpdateSandboxFolder()); logger.Info("Update package extracted successfully"); logger.Info("Preparing client"); notification.CurrentMessage = "Preparing to start Update"; - _diskProvider.MoveDirectory(_enviromentProvider.GetUpdateClientFolder(), _enviromentProvider.GetUpdateSandboxFolder()); + _diskProvider.MoveDirectory(_environmentProvider.GetUpdateClientFolder(), _environmentProvider.GetUpdateSandboxFolder()); logger.Info("Starting update client"); var startInfo = new ProcessStartInfo { - FileName = _enviromentProvider.GetUpdateClientExePath(), - Arguments = string.Format("{0} {1}", _enviromentProvider.NzbDroneProcessIdFromEnviroment, _configFileProvider.Guid) + FileName = _environmentProvider.GetUpdateClientExePath(), + Arguments = string.Format("{0} {1}", _environmentProvider.NzbDroneProcessIdFromEnviroment, _configFileProvider.Guid) }; var process = _processProvider.Start(startInfo); diff --git a/NzbDrone.Core/Providers/AnalyticsProvider.cs b/NzbDrone.Core/Providers/AnalyticsProvider.cs index f4d62fb45..6879d94ee 100644 --- a/NzbDrone.Core/Providers/AnalyticsProvider.cs +++ b/NzbDrone.Core/Providers/AnalyticsProvider.cs @@ -37,10 +37,10 @@ namespace NzbDrone.Core.Providers if (!IsOnMasterBranch()) return; - if (EnviromentProvider.RegisterNewInstall) + if (EnvironmentProvider.RegisterNewInstall) { _deskMetricsClient.RegisterInstall(); - EnviromentProvider.RegisterNewInstall = false; + EnvironmentProvider.RegisterNewInstall = false; } if (_deskMetricsClient.Started) @@ -52,7 +52,7 @@ namespace NzbDrone.Core.Providers } catch (Exception e) { - if (!EnviromentProvider.IsProduction) + if (!EnvironmentProvider.IsProduction) throw; logger.WarnException("Error while sending analytics data.", e); diff --git a/NzbDrone.Core/Providers/BackupProvider.cs b/NzbDrone.Core/Providers/BackupProvider.cs index 08c3a08fb..14c54a457 100644 --- a/NzbDrone.Core/Providers/BackupProvider.cs +++ b/NzbDrone.Core/Providers/BackupProvider.cs @@ -9,13 +9,13 @@ namespace NzbDrone.Core.Providers { public class BackupProvider { - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); [Inject] - public BackupProvider(EnviromentProvider enviromentProvider) + public BackupProvider(EnvironmentProvider environmentProvider) { - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; } public BackupProvider() @@ -25,9 +25,9 @@ namespace NzbDrone.Core.Providers public virtual string CreateBackupZip() { - var dbFile = _enviromentProvider.GetNzbDronoeDbFile(); - var configFile = _enviromentProvider.GetConfigPath(); - var zipFile = _enviromentProvider.GetConfigBackupFile(); + var dbFile = _environmentProvider.GetNzbDronoeDbFile(); + var configFile = _environmentProvider.GetConfigPath(); + var zipFile = _environmentProvider.GetConfigBackupFile(); using (var zip = new ZipFile()) { diff --git a/NzbDrone.Core/Providers/BannerProvider.cs b/NzbDrone.Core/Providers/BannerProvider.cs index 0c14f0f2e..e03466c76 100644 --- a/NzbDrone.Core/Providers/BannerProvider.cs +++ b/NzbDrone.Core/Providers/BannerProvider.cs @@ -13,17 +13,17 @@ namespace NzbDrone.Core.Providers public class BannerProvider { private readonly HttpProvider _httpProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly DiskProvider _diskProvider; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private const string BANNER_URL_PREFIX = "http://www.thetvdb.com/banners/"; - public BannerProvider(HttpProvider httpProvider, EnviromentProvider enviromentProvider, + public BannerProvider(HttpProvider httpProvider, EnvironmentProvider environmentProvider, DiskProvider diskProvider) { _httpProvider = httpProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _diskProvider = diskProvider; } @@ -34,7 +34,7 @@ namespace NzbDrone.Core.Providers public virtual bool Download(ProgressNotification notification, Series series) { - var bannerPath = _enviromentProvider.GetBannerPath(); + var bannerPath = _environmentProvider.GetBannerPath(); logger.Trace("Ensuring Banner Folder exists: ", bannerPath); _diskProvider.CreateDirectory(bannerPath); @@ -62,7 +62,7 @@ namespace NzbDrone.Core.Providers public virtual bool Delete(int seriesId) { - var bannerPath = _enviromentProvider.GetBannerPath(); + var bannerPath = _environmentProvider.GetBannerPath(); var bannerFilename = Path.Combine(bannerPath, seriesId.ToString()) + ".jpg"; try diff --git a/NzbDrone.Core/Providers/TvDbProvider.cs b/NzbDrone.Core/Providers/TvDbProvider.cs index 45dc3a09d..c6e26be7a 100644 --- a/NzbDrone.Core/Providers/TvDbProvider.cs +++ b/NzbDrone.Core/Providers/TvDbProvider.cs @@ -13,17 +13,17 @@ namespace NzbDrone.Core.Providers { public class TvDbProvider { - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private const string TVDB_APIKEY = "5D2D188E86E07F4F"; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private readonly TvdbHandler _handler; [Inject] - public TvDbProvider(EnviromentProvider enviromentProvider) + public TvDbProvider(EnvironmentProvider environmentProvider) { - _enviromentProvider = enviromentProvider; - _handler = new TvdbHandler(new XmlCacheProvider(_enviromentProvider.GetCacheFolder()), TVDB_APIKEY); + _environmentProvider = environmentProvider; + _handler = new TvdbHandler(new XmlCacheProvider(_environmentProvider.GetCacheFolder()), TVDB_APIKEY); } public TvDbProvider() diff --git a/NzbDrone.Core/Providers/UpdateProvider.cs b/NzbDrone.Core/Providers/UpdateProvider.cs index 224420c3a..416cfe324 100644 --- a/NzbDrone.Core/Providers/UpdateProvider.cs +++ b/NzbDrone.Core/Providers/UpdateProvider.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.Providers { private readonly HttpProvider _httpProvider; private readonly ConfigProvider _configProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly DiskProvider _diskProvider; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); @@ -29,11 +29,11 @@ namespace NzbDrone.Core.Providers [Inject] public UpdateProvider(HttpProvider httpProvider, ConfigProvider configProvider, - EnviromentProvider enviromentProvider, DiskProvider diskProvider) + EnvironmentProvider environmentProvider, DiskProvider diskProvider) { _httpProvider = httpProvider; _configProvider = configProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _diskProvider = diskProvider; } @@ -80,9 +80,9 @@ namespace NzbDrone.Core.Providers var list = new Dictionary(); CultureInfo provider = CultureInfo.InvariantCulture; - if (_diskProvider.FolderExists(_enviromentProvider.GetUpdateLogFolder())) + if (_diskProvider.FolderExists(_environmentProvider.GetUpdateLogFolder())) { - var files = _diskProvider.GetFiles(_enviromentProvider.GetUpdateLogFolder(), SearchOption.TopDirectoryOnly).ToList(); + var files = _diskProvider.GetFiles(_environmentProvider.GetUpdateLogFolder(), SearchOption.TopDirectoryOnly).ToList(); foreach (var file in files.Select(c => new FileInfo(c)).OrderByDescending(c => c.Name)) { diff --git a/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs b/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs index 8b1aa0cda..1a0f82e3a 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/App_Start/Logging.cs @@ -15,8 +15,8 @@ namespace NzbDrone.Services.Service.App_Start public static void PreStart() { - string logPath = string.Format("C:\\NLog\\{0}\\{1}\\${{shortdate}}-${{logger}}.log", HostingEnvironment.SiteName, new EnviromentProvider().Version); - string error = string.Format("C:\\NLog\\{0}\\{1}\\${{shortdate}}_Error.log", HostingEnvironment.SiteName, new EnviromentProvider().Version); + string logPath = string.Format("C:\\NLog\\{0}\\{1}\\${{shortdate}}-${{logger}}.log", HostingEnvironment.SiteName, new EnvironmentProvider().Version); + string error = string.Format("C:\\NLog\\{0}\\{1}\\${{shortdate}}_Error.log", HostingEnvironment.SiteName, new EnvironmentProvider().Version); LogConfiguration.RegisterUdpLogger(); LogConfiguration.RegisterFileLogger(logPath, LogLevel.Trace); diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/HealthController.cs b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/HealthController.cs index 918aa8fd6..7b6bbd009 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/HealthController.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/HealthController.cs @@ -9,12 +9,12 @@ namespace NzbDrone.Services.Service.Controllers { public class HealthController : Controller { - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly IDatabase _database; - public HealthController(EnviromentProvider enviromentProvider, IDatabase database) + public HealthController(EnvironmentProvider environmentProvider, IDatabase database) { - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _database = database; } @@ -23,7 +23,7 @@ namespace NzbDrone.Services.Service.Controllers { var stat = new { - Service = _enviromentProvider.Version.ToString(), + Service = _environmentProvider.Version.ToString(), Schema = _database.Fetch().OrderByDescending(c => c.Version).First() }; diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Helpers/HtmlIncludeExtentions.cs b/NzbDrone.Services/NzbDrone.Services.Service/Helpers/HtmlIncludeExtentions.cs index 4ee2dfd5a..41702bda6 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Helpers/HtmlIncludeExtentions.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Helpers/HtmlIncludeExtentions.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Services.Service.Helpers static HtmlIncludeExtentions() { - versionString = new EnviromentProvider().Version.ToString().Replace('.', '_'); + versionString = new EnvironmentProvider().Version.ToString().Replace('.', '_'); isProduction = true; } diff --git a/NzbDrone.Test.Common/TestBase.cs b/NzbDrone.Test.Common/TestBase.cs index c346e6922..abdb4d6c8 100644 --- a/NzbDrone.Test.Common/TestBase.cs +++ b/NzbDrone.Test.Common/TestBase.cs @@ -45,7 +45,7 @@ namespace NzbDrone.Test.Common [SetUp] public void TestBaseSetup() { - EnviromentProvider.RegisterNewInstall = true; + EnvironmentProvider.RegisterNewInstall = true; MockedRestProvider = new Mock(); ReportingService.RestProvider = MockedRestProvider.Object; @@ -75,7 +75,7 @@ namespace NzbDrone.Test.Common protected void WithTempAsAppPath() { - Mocker.GetMock() + Mocker.GetMock() .SetupGet(c => c.ApplicationPath) .Returns(VirtualPath); } diff --git a/NzbDrone.Update.Test/UpdateProviderStartFixture.cs b/NzbDrone.Update.Test/UpdateProviderStartFixture.cs index ec8dd9be7..bcafbb6e3 100644 --- a/NzbDrone.Update.Test/UpdateProviderStartFixture.cs +++ b/NzbDrone.Update.Test/UpdateProviderStartFixture.cs @@ -19,16 +19,16 @@ namespace NzbDrone.Update.Test private const string TARGET_FOLDER = @"C:\NzbDrone\"; private const string UPDATE_LOG_FOLDER = @"C:\NzbDrone\UpdateLogs\"; - Mock _enviromentProvider; + Mock _environmentProvider; [SetUp] public void Setup() { - _enviromentProvider = Mocker.GetMock(); + _environmentProvider = Mocker.GetMock(); - _enviromentProvider.SetupGet(c => c.SystemTemp).Returns(@"C:\Temp\"); + _environmentProvider.SetupGet(c => c.SystemTemp).Returns(@"C:\Temp\"); Mocker.GetMock() .Setup(c => c.FolderExists(UPDATE_FOLDER)) diff --git a/NzbDrone.Update.Test/UpdateProviderVerifyFixture.cs b/NzbDrone.Update.Test/UpdateProviderVerifyFixture.cs index 2c7caca3a..238af56ef 100644 --- a/NzbDrone.Update.Test/UpdateProviderVerifyFixture.cs +++ b/NzbDrone.Update.Test/UpdateProviderVerifyFixture.cs @@ -18,10 +18,10 @@ namespace NzbDrone.Update.Test [SetUp] public void Setup() { - Mocker.GetMock() + Mocker.GetMock() .Setup(c => c.StartUpPath).Returns(@"C:\Temp\NzbDrone_update\"); - Mocker.GetMock() + Mocker.GetMock() .Setup(c => c.SystemTemp).Returns(@"C:\Temp\"); } diff --git a/NzbDrone.Update/Program.cs b/NzbDrone.Update/Program.cs index eeadaaf41..798d7b42d 100644 --- a/NzbDrone.Update/Program.cs +++ b/NzbDrone.Update/Program.cs @@ -32,7 +32,7 @@ namespace NzbDrone.Update - logger.Info("Updating NzbDrone to version {0}", _kernel.Get().Version); + logger.Info("Updating NzbDrone to version {0}", _kernel.Get().Version); _kernel.Get().Start(args); } catch (Exception e) @@ -48,10 +48,10 @@ namespace NzbDrone.Update { try { - var enviromentProvider = _kernel.Get(); + var environmentProvider = _kernel.Get(); var diskProvider = _kernel.Get(); logger.Info("Copying log files to application directory."); - diskProvider.CopyDirectory(enviromentProvider.GetSandboxLogFolder(), enviromentProvider.GetUpdateLogFolder()); + diskProvider.CopyDirectory(environmentProvider.GetSandboxLogFolder(), environmentProvider.GetUpdateLogFolder()); } catch (Exception e) { @@ -68,7 +68,7 @@ namespace NzbDrone.Update LogConfiguration.RegisterConsoleLogger(LogLevel.Trace); LogConfiguration.RegisterUdpLogger(); - var logPath = Path.Combine(new EnviromentProvider().GetSandboxLogFolder(), DateTime.Now.ToString("yyyy.MM.dd-H-mm") + ".txt"); + var logPath = Path.Combine(new EnvironmentProvider().GetSandboxLogFolder(), DateTime.Now.ToString("yyyy.MM.dd-H-mm") + ".txt"); LogConfiguration.RegisterFileLogger(logPath, LogLevel.Info); LogConfiguration.Reload(); diff --git a/NzbDrone.Update/Providers/UpdateProvider.cs b/NzbDrone.Update/Providers/UpdateProvider.cs index 2080f51d1..9e2101ee4 100644 --- a/NzbDrone.Update/Providers/UpdateProvider.cs +++ b/NzbDrone.Update/Providers/UpdateProvider.cs @@ -12,17 +12,17 @@ namespace NzbDrone.Update.Providers private readonly DiskProvider _diskProvider; private readonly ServiceProvider _serviceProvider; private readonly ProcessProvider _processProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly IISProvider _iisProvider; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); public UpdateProvider(DiskProvider diskProvider, ServiceProvider serviceProvider, - ProcessProvider processProvider, EnviromentProvider enviromentProvider, IISProvider iisProvider) + ProcessProvider processProvider, EnvironmentProvider environmentProvider, IISProvider iisProvider) { _diskProvider = diskProvider; _serviceProvider = serviceProvider; _processProvider = processProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _iisProvider = iisProvider; } @@ -41,8 +41,8 @@ namespace NzbDrone.Update.Providers throw new DirectoryNotFoundException("Target folder doesn't exist " + targetFolder); logger.Info("Verifying Update Folder"); - if (!_diskProvider.FolderExists(_enviromentProvider.GetUpdatePackageFolder())) - throw new DirectoryNotFoundException("Update folder doesn't exist " + _enviromentProvider.GetUpdatePackageFolder()); + if (!_diskProvider.FolderExists(_environmentProvider.GetUpdatePackageFolder())) + throw new DirectoryNotFoundException("Update folder doesn't exist " + _environmentProvider.GetUpdatePackageFolder()); } @@ -73,17 +73,17 @@ namespace NzbDrone.Update.Providers _iisProvider.StopServer(); logger.Info("Creating backup of existing installation"); - _diskProvider.CopyDirectory(targetFolder, _enviromentProvider.GetUpdateBackUpFolder()); + _diskProvider.CopyDirectory(targetFolder, _environmentProvider.GetUpdateBackUpFolder()); logger.Info("Moving update package to target"); try { - _diskProvider.CopyDirectory(_enviromentProvider.GetUpdatePackageFolder(), targetFolder); + _diskProvider.CopyDirectory(_environmentProvider.GetUpdatePackageFolder(), targetFolder); logger.Trace("Deleting Update Package."); - _diskProvider.DeleteFolder(_enviromentProvider.GetUpdatePackageFolder(), true); + _diskProvider.DeleteFolder(_environmentProvider.GetUpdatePackageFolder(), true); } catch (Exception e) { @@ -106,7 +106,7 @@ namespace NzbDrone.Update.Providers { //TODO:this should ignore single file failures. logger.Info("Attempting to rollback upgrade"); - _diskProvider.CopyDirectory(_enviromentProvider.GetUpdateBackUpFolder(), targetFolder); + _diskProvider.CopyDirectory(_environmentProvider.GetUpdateBackUpFolder(), targetFolder); } diff --git a/NzbDrone.Web.UI.Test/AutomationTestBase.cs b/NzbDrone.Web.UI.Test/AutomationTestBase.cs index 79ef23474..6bdace82c 100644 --- a/NzbDrone.Web.UI.Test/AutomationTestBase.cs +++ b/NzbDrone.Web.UI.Test/AutomationTestBase.cs @@ -15,7 +15,7 @@ namespace NzbDrone.Web.UI.Automation [TestFixture(Category = "Automation")] public abstract class AutomationTestBase { - private static readonly EnviromentProvider enviromentProvider = new EnviromentProvider(); + private static readonly EnvironmentProvider environmentProvider = new EnvironmentProvider(); private readonly string _clonePackagePath; private readonly string _masterPackagePath; @@ -30,7 +30,7 @@ namespace NzbDrone.Web.UI.Automation protected AutomationTestBase() { - var rawPackagePath = Path.Combine(enviromentProvider.ApplicationPath, "_rawPackage"); + var rawPackagePath = Path.Combine(environmentProvider.ApplicationPath, "_rawPackage"); _clonePackagePath = Path.Combine(rawPackagePath, "NzbDrone_Automation"); _masterPackagePath = Path.Combine(rawPackagePath, "NzbDrone"); } @@ -197,7 +197,7 @@ namespace NzbDrone.Web.UI.Automation StopNzbDrone(); - var rootDirectory = new DirectoryInfo(enviromentProvider.ApplicationPath); + var rootDirectory = new DirectoryInfo(environmentProvider.ApplicationPath); if (rootDirectory.GetDirectories("_rawPackage").Any()) { @@ -212,7 +212,7 @@ namespace NzbDrone.Web.UI.Automation Process.Start(startInfo).WaitForExit(); - var testFolder = Path.Combine(enviromentProvider.SystemTemp, "NzbDroneAutomation"); + var testFolder = Path.Combine(environmentProvider.SystemTemp, "NzbDroneAutomation"); if (Directory.Exists(testFolder)) { @@ -239,12 +239,12 @@ namespace NzbDrone.Web.UI.Automation { var folderName = "Debug"; - if (EnviromentProvider.IsDebug) + if (EnvironmentProvider.IsDebug) { folderName = "Release"; } - var dirs = Directory.GetDirectories(enviromentProvider.ApplicationPath, folderName, SearchOption.AllDirectories); + var dirs = Directory.GetDirectories(environmentProvider.ApplicationPath, folderName, SearchOption.AllDirectories); foreach (var dir in dirs) diff --git a/NzbDrone.Web/App_Start/Logging.cs b/NzbDrone.Web/App_Start/Logging.cs index 0d920a98f..7a53a6b51 100644 --- a/NzbDrone.Web/App_Start/Logging.cs +++ b/NzbDrone.Web/App_Start/Logging.cs @@ -13,15 +13,15 @@ namespace NzbDrone.Web.App_Start { public static void PreStart() { - var enviromentProvider = new EnviromentProvider(); + var environmentProvider = new EnvironmentProvider(); - LogManager.Configuration = new XmlLoggingConfiguration(enviromentProvider.GetNlogConfigPath(), false); + LogManager.Configuration = new XmlLoggingConfiguration(environmentProvider.GetNlogConfigPath(), false); LogConfiguration.RegisterUdpLogger(); LogConfiguration.RegisterRemote(); LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Web.MvcApplication"); LogConfiguration.RegisterConsoleLogger(LogLevel.Info, "NzbDrone.Core.CentralDispatch"); - LogConfiguration.RegisterRollingFileLogger(enviromentProvider.GetLogFileName(), LogLevel.Trace); + LogConfiguration.RegisterRollingFileLogger(environmentProvider.GetLogFileName(), LogLevel.Trace); } } diff --git a/NzbDrone.Web/App_Start/MiniProfiler.cs b/NzbDrone.Web/App_Start/MiniProfiler.cs index 4dd5a5fa7..40a877994 100644 --- a/NzbDrone.Web/App_Start/MiniProfiler.cs +++ b/NzbDrone.Web/App_Start/MiniProfiler.cs @@ -70,7 +70,7 @@ namespace NzbDrone.Web.App_Start // so authenticated users are always profiled //if (request.IsLocal) { MiniProfiler.Start(); } - if (!EnviromentProvider.IsProduction || ProfilerHelper.Enabled()) + if (!EnvironmentProvider.IsProduction || ProfilerHelper.Enabled()) { var requestPath = ((HttpApplication)sender).Request.AppRelativeCurrentExecutionFilePath.ToLower(); if (!requestPath.StartsWith("~/signalr") && !requestPath.EndsWith("notification/comet")) diff --git a/NzbDrone.Web/Controllers/LogController.cs b/NzbDrone.Web/Controllers/LogController.cs index 5430d6dc3..bd414087a 100644 --- a/NzbDrone.Web/Controllers/LogController.cs +++ b/NzbDrone.Web/Controllers/LogController.cs @@ -13,13 +13,13 @@ namespace NzbDrone.Web.Controllers public class LogController : Controller { private readonly LogProvider _logProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly DiskProvider _diskProvider; - public LogController(LogProvider logProvider, EnviromentProvider enviromentProvider, DiskProvider diskProvider) + public LogController(LogProvider logProvider, EnvironmentProvider environmentProvider, DiskProvider diskProvider) { _logProvider = logProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _diskProvider = diskProvider; } @@ -32,12 +32,12 @@ namespace NzbDrone.Web.Controllers { string log = string.Empty; - if (_diskProvider.FileExists(_enviromentProvider.GetArchivedLogFileName())) + if (_diskProvider.FileExists(_environmentProvider.GetArchivedLogFileName())) { - log = _diskProvider.ReadAllText(_enviromentProvider.GetArchivedLogFileName()); + log = _diskProvider.ReadAllText(_environmentProvider.GetArchivedLogFileName()); } - log += _diskProvider.ReadAllText(_enviromentProvider.GetLogFileName()); + log += _diskProvider.ReadAllText(_environmentProvider.GetLogFileName()); return new FileContentResult(Encoding.ASCII.GetBytes(log), "text/plain"); } diff --git a/NzbDrone.Web/Controllers/SharedController.cs b/NzbDrone.Web/Controllers/SharedController.cs index 3408efc2c..a4ce35d43 100644 --- a/NzbDrone.Web/Controllers/SharedController.cs +++ b/NzbDrone.Web/Controllers/SharedController.cs @@ -6,11 +6,11 @@ namespace NzbDrone.Web.Controllers { public class SharedController : Controller { - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; - public SharedController(EnviromentProvider enviromentProvider) + public SharedController(EnvironmentProvider environmentProvider) { - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; } public ActionResult Index() @@ -22,7 +22,7 @@ namespace NzbDrone.Web.Controllers [OutputCache(Duration = 3600)] public ActionResult Footer() { - return PartialView(new FooterModel { BuildTime = _enviromentProvider.BuildDateTime, Version = _enviromentProvider.Version }); + return PartialView(new FooterModel { BuildTime = _environmentProvider.BuildDateTime, Version = _environmentProvider.Version }); } } } \ No newline at end of file diff --git a/NzbDrone.Web/Controllers/UpdateController.cs b/NzbDrone.Web/Controllers/UpdateController.cs index fc2033657..ce79d5865 100644 --- a/NzbDrone.Web/Controllers/UpdateController.cs +++ b/NzbDrone.Web/Controllers/UpdateController.cs @@ -12,24 +12,24 @@ namespace NzbDrone.Web.Controllers { private readonly UpdateProvider _updateProvider; private readonly JobProvider _jobProvider; - private readonly EnviromentProvider _enviromentProvider; + private readonly EnvironmentProvider _environmentProvider; private readonly DiskProvider _diskProvider; public UpdateController(UpdateProvider updateProvider, JobProvider jobProvider, - EnviromentProvider enviromentProvider, DiskProvider diskProvider) + EnvironmentProvider environmentProvider, DiskProvider diskProvider) { _updateProvider = updateProvider; _jobProvider = jobProvider; - _enviromentProvider = enviromentProvider; + _environmentProvider = environmentProvider; _diskProvider = diskProvider; } public ActionResult Index() { var updateModel = new UpdateModel(); - updateModel.UpdatePackage = _updateProvider.GetAvilableUpdate(_enviromentProvider.Version); + updateModel.UpdatePackage = _updateProvider.GetAvilableUpdate(_environmentProvider.Version); updateModel.LogFiles = _updateProvider.UpdateLogFile(); - updateModel.LogFolder = _enviromentProvider.GetUpdateLogFolder(); + updateModel.LogFolder = _environmentProvider.GetUpdateLogFolder(); return View(updateModel); } @@ -51,7 +51,7 @@ namespace NzbDrone.Web.Controllers public ActionResult Post(string expectedVersion) { var model = new PostUpgradeModel(); - model.CurrentVersion = _enviromentProvider.Version; + model.CurrentVersion = _environmentProvider.Version; model.ExpectedVersion = Version.Parse(expectedVersion); model.Success = model.CurrentVersion >= model.ExpectedVersion; diff --git a/NzbDrone.Web/Helpers/HtmlIncludeExtentions.cs b/NzbDrone.Web/Helpers/HtmlIncludeExtentions.cs index 94848660b..14ec57015 100644 --- a/NzbDrone.Web/Helpers/HtmlIncludeExtentions.cs +++ b/NzbDrone.Web/Helpers/HtmlIncludeExtentions.cs @@ -13,8 +13,8 @@ namespace NzbDrone.Web.Helpers static HtmlIncludeExtentions() { - versionString = new EnviromentProvider().Version.ToString().Replace('.', '_'); - isProduction = EnviromentProvider.IsProduction; + versionString = new EnvironmentProvider().Version.ToString().Replace('.', '_'); + isProduction = EnvironmentProvider.IsProduction; } public static MvcHtmlString IncludeScript(this HtmlHelper helper, string filename) diff --git a/NzbDrone.Web/Helpers/ProfilerHelper.cs b/NzbDrone.Web/Helpers/ProfilerHelper.cs index 641fd3916..c93e71275 100644 --- a/NzbDrone.Web/Helpers/ProfilerHelper.cs +++ b/NzbDrone.Web/Helpers/ProfilerHelper.cs @@ -10,8 +10,8 @@ namespace NzbDrone.Web.Helpers { public static bool Enabled() { - var enviromentProvider = new EnviromentProvider(); - var configFileProvider = new ConfigFileProvider(enviromentProvider); + var environmentProvider = new EnvironmentProvider(); + var configFileProvider = new ConfigFileProvider(environmentProvider); return configFileProvider.EnableProfiler; } diff --git a/NzbDrone.Web/Views/Shared/_Layout.cshtml b/NzbDrone.Web/Views/Shared/_Layout.cshtml index 6e0894533..bb437a340 100644 --- a/NzbDrone.Web/Views/Shared/_Layout.cshtml +++ b/NzbDrone.Web/Views/Shared/_Layout.cshtml @@ -13,7 +13,7 @@ ViewBag.Title = String.Format("{0} - NzbDrone", ViewBag.Title); } @ViewBag.Title - @if (!EnviromentProvider.IsProduction || ProfilerHelper.Enabled()) + @if (!EnvironmentProvider.IsProduction || ProfilerHelper.Enabled()) { @MvcMiniProfiler.MiniProfiler.RenderIncludes() } @@ -51,7 +51,7 @@ @RenderSection("Scripts", required: false) @Html.IncludeScript("jquery.signalR.min.js") - @if (EnviromentProvider.IsProduction) + @if (EnvironmentProvider.IsProduction) {