Skip to content

Commit

Permalink
Merge branch 'onovotny-fixes-from-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
bennor committed Aug 31, 2015
2 parents a5eb5f8 + a9b50b8 commit 80370f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions InterfaceStubGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ static void Main(string[] args)
files = recursivelyListFiles(targetDir, "*.cs").ToArray();
}

var template = generator.GenerateInterfaceStubs(files.Select(x => x.FullName).ToArray());
var template = generator.GenerateInterfaceStubs(files.Select(x => x.FullName).ToArray()).Trim();

string contents = null;

if (target.Exists) {
// Only try writing if the contents are different. Don't cause a rebuild
contents = File.ReadAllText(target.FullName, Encoding.UTF8);
contents = File.ReadAllText(target.FullName, Encoding.UTF8).Trim();
if (string.Equals(contents, template, StringComparison.Ordinal)) {
return;
}
Expand All @@ -51,7 +51,7 @@ static void Main(string[] args)
// If the file is read-only, we might be on a build server. Check the file to see if
// the contents match what we expect
if (target.Exists && target.IsReadOnly) {
if (contents != template) {
if (!string.Equals(contents, template, StringComparison.Ordinal)) {
Console.Error.WriteLine(new ReadOnlyFileError(target));
Environment.Exit(-1); // error....
}
Expand Down
8 changes: 4 additions & 4 deletions Refit/RequestBuilderImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ Func<HttpClient, object[], IObservable<T>> buildRxFuncForMethod<T>(RestMethodInf
{
var taskFunc = buildCancellableTaskFuncForMethod<T>(restMethod);

return (client, paramList) => {
return (client, paramList) => {
return new TaskToObservable<T>(ct => {
var methodCt = CancellationToken.None;
if (restMethod.CancellationToken != null) {
Expand All @@ -359,10 +359,10 @@ Func<HttpClient, object[], IObservable<T>> buildRxFuncForMethod<T>(RestMethodInf

// link the two
var cts = CancellationTokenSource.CreateLinkedTokenSource(methodCt, ct);

return taskFunc(client, cts.Token, paramList);
});
}
};
}

class TaskToObservable<T> : IObservable<T>
Expand Down Expand Up @@ -591,7 +591,7 @@ Tuple<BodySerializationMethod, int> findBodyParameter(List<ParameterInfo> parame
}

// Not in post/put/patch? bail
if (!method.Equals(HttpMethod.Post) && method.Equals(HttpMethod.Put) && !method.Equals(patchMethod)) {
if (!method.Equals(HttpMethod.Post) && !method.Equals(HttpMethod.Put) && !method.Equals(patchMethod)) {
return null;
}

Expand Down

0 comments on commit 80370f2

Please sign in to comment.