forked from madskristensen/WebEssentials2013
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Nodejs as a Web Service - pt. 7. (madskristensen#381)
* Client: Wiring-up with new base. * Server: Fixed error handling. * Test: Updated to FluentAssertions 3.0.
- Loading branch information
Showing
37 changed files
with
569 additions
and
756 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
17 changes: 1 addition & 16 deletions
17
EditorExtensions/CoffeeScript/Linters/CoffeeLintCompiler.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 |
---|---|---|
@@ -1,28 +1,13 @@ | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using MadsKristensen.EditorExtensions.JavaScript; | ||
|
||
namespace MadsKristensen.EditorExtensions.CoffeeScript | ||
{ | ||
public class CoffeeLintCompiler : JsHintCompiler | ||
{ | ||
private static readonly string _compilerPath = Path.Combine(WebEssentialsResourceDirectory, @"nodejs\tools\node_modules\coffeelint\bin\coffeelint"); | ||
private static readonly string _reporter = Path.Combine(WebEssentialsResourceDirectory, @"Scripts\coffeeReporter.js"); | ||
public new readonly static string ConfigFileName = "coffeelint.json"; | ||
|
||
public override IEnumerable<string> SourceExtensions { get { return new[] { ".coffee", ".iced" }; } } | ||
public override string ServiceName { get { return "CoffeeLint"; } } | ||
protected override string CompilerPath { get { return _compilerPath; } } | ||
|
||
protected override Task<string> GetArguments(string sourceFileName, string targetFileName, string mapFileName) | ||
{ | ||
GetOrCreateGlobalSettings(ConfigFileName); // Ensure that default settings exist | ||
|
||
return Task.FromResult(string.Format(CultureInfo.CurrentCulture, "--reporter \"{0}\" \"{1}\"", | ||
_reporter, | ||
sourceFileName)); | ||
} | ||
} | ||
} | ||
} |
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
37 changes: 2 additions & 35 deletions
37
EditorExtensions/JavaScript/Linters/JsCodeStyleCompiler.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 |
---|---|---|
@@ -1,43 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
| ||
namespace MadsKristensen.EditorExtensions.JavaScript | ||
{ | ||
public class JsCodeStyleCompiler : JsHintCompiler | ||
{ | ||
private static readonly string _compilerPath = Path.Combine(WebEssentialsResourceDirectory, @"nodejs\tools\node_modules\jscs\bin\jscs"); | ||
private static readonly string _reporter = Path.Combine(WebEssentialsResourceDirectory, @"Scripts\jscsReporter.js"); | ||
public new static readonly string ConfigFileName = ".jscsrc"; | ||
|
||
public override IEnumerable<string> SourceExtensions { get { return new[] { ".js" }; } } | ||
public override string ServiceName { get { return "JSCS"; } } | ||
protected override string CompilerPath { get { return _compilerPath; } } | ||
|
||
protected override Task<string> GetArguments(string sourceFileName, string targetFileName, string mapFileName) | ||
{ | ||
GetOrCreateGlobalSettings(ConfigFileName); // Ensure that default settings exist | ||
|
||
return Task.FromResult(string.Format(CultureInfo.CurrentCulture, "--reporter \"{0}\" --config \"{1}\" \"{2}\"", | ||
_reporter, | ||
FindLocalSettings(sourceFileName, ConfigFileName) ?? GetOrCreateGlobalSettings(ConfigFileName), | ||
sourceFileName)); | ||
} | ||
|
||
protected static string FindLocalSettings(string sourcePath, string settingsName) | ||
{ | ||
string dir = Path.GetDirectoryName(sourcePath); | ||
|
||
while (!File.Exists(Path.Combine(dir, settingsName))) | ||
{ | ||
dir = Path.GetDirectoryName(dir); | ||
if (String.IsNullOrEmpty(dir)) | ||
return null; | ||
} | ||
|
||
return Path.Combine(dir, settingsName); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.