From 0b0661aa1e74aa84bed2c21d3a2abf1d0b3c7713 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 14 Nov 2013 12:44:02 +1100 Subject: [PATCH 1/7] add gist get --- Octokit.Tests.Integration/GistsClientTests.cs | 32 ++++++++++ .../Octokit.Tests.Integration.csproj | 1 + Octokit.Tests/Clients/GistsClientTests.cs | 33 ++++++++++ Octokit.Tests/Octokit.Tests.csproj | 1 + Octokit.sln.DotSettings | 1 + Octokit/Clients/GistsClient.cs | 26 ++++++++ Octokit/Clients/IGistsClient.cs | 20 +++++++ Octokit/GitHubClient.cs | 2 + Octokit/Helpers/ApiUrls.cs | 9 +++ Octokit/IGitHubClient.cs | 1 + Octokit/Models/Response/Gist.cs | 60 +++++++++++++++++++ Octokit/Octokit-Mono.csproj | 3 + Octokit/Octokit-netcore45.csproj | 3 + Octokit/Octokit.csproj | 5 +- 14 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 Octokit.Tests.Integration/GistsClientTests.cs create mode 100644 Octokit.Tests/Clients/GistsClientTests.cs create mode 100644 Octokit/Clients/GistsClient.cs create mode 100644 Octokit/Clients/IGistsClient.cs create mode 100644 Octokit/Models/Response/Gist.cs diff --git a/Octokit.Tests.Integration/GistsClientTests.cs b/Octokit.Tests.Integration/GistsClientTests.cs new file mode 100644 index 0000000000..855e6c5815 --- /dev/null +++ b/Octokit.Tests.Integration/GistsClientTests.cs @@ -0,0 +1,32 @@ +using System; +using System.Linq; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Xunit; + +namespace Octokit.Tests.Integration +{ + public class GistsClientTests + { + readonly IGitHubClient _gitHubClient; + readonly IGistsClient _gistsClient; + + public GistsClientTests() + { + this._gitHubClient = new GitHubClient(new ProductHeaderValue("OctokitTests")) + { + Credentials = Helper.Credentials + }; + + this._gistsClient = this._gitHubClient.Gist; + } + + [IntegrationTest] + public async Task CanGetGist() + { + var retrieved = await this._gistsClient.Get(6305249); + Assert.NotNull(retrieved); + } + + } +} \ No newline at end of file diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index 205f8a4e9c..bc418d270b 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -60,6 +60,7 @@ + diff --git a/Octokit.Tests/Clients/GistsClientTests.cs b/Octokit.Tests/Clients/GistsClientTests.cs new file mode 100644 index 0000000000..bd7b5f95ef --- /dev/null +++ b/Octokit.Tests/Clients/GistsClientTests.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NSubstitute; +using Octokit; +using Xunit; + +public class GistsClientTests +{ + public class TheGetMethod + { + + [Fact] + public void RequestsCorrectUrl() + { + var connection = Substitute.For(); + var client = new GistsClient(connection); + + client.Get(1); + + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/owner/repo/git/commits/reference"), null); + } + } + + public class TheCtor + { + [Fact] + public void EnsuresArgument() + { + Assert.Throws(() => new GistsClient(null)); + } + } +} \ No newline at end of file diff --git a/Octokit.Tests/Octokit.Tests.csproj b/Octokit.Tests/Octokit.Tests.csproj index cff9ef07fe..4ea2946d81 100644 --- a/Octokit.Tests/Octokit.Tests.csproj +++ b/Octokit.Tests/Octokit.Tests.csproj @@ -62,6 +62,7 @@ + diff --git a/Octokit.sln.DotSettings b/Octokit.sln.DotSettings index 36aa179285..202116c9e8 100644 --- a/Octokit.sln.DotSettings +++ b/Octokit.sln.DotSettings @@ -262,4 +262,5 @@ II.2.12 <HandlesEvent /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> + True \ No newline at end of file diff --git a/Octokit/Clients/GistsClient.cs b/Octokit/Clients/GistsClient.cs new file mode 100644 index 0000000000..dc3a5099a5 --- /dev/null +++ b/Octokit/Clients/GistsClient.cs @@ -0,0 +1,26 @@ +using System.Threading.Tasks; + +namespace Octokit +{ + public class GistsClient : ApiClient, IGistsClient + { + public GistsClient(IApiConnection apiConnection) : + base(apiConnection) + { + } + + /// + /// Gets a gist + /// + /// + /// http://developer.github.com/v3/gists/#get-a-single-gist + /// + /// The id of the gist + public Task Get(int id) + { + return ApiConnection.Get(ApiUrls.Gist(id)); + } + + + } +} \ No newline at end of file diff --git a/Octokit/Clients/IGistsClient.cs b/Octokit/Clients/IGistsClient.cs new file mode 100644 index 0000000000..5137d71bbb --- /dev/null +++ b/Octokit/Clients/IGistsClient.cs @@ -0,0 +1,20 @@ +using System.Diagnostics.CodeAnalysis; +using System.Threading.Tasks; + +namespace Octokit +{ + public interface IGistsClient + { + /// + /// Gets a gist + /// + /// + /// http://developer.github.com/v3/gists/#get-a-single-gist + /// + /// The id of the gidt + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + Task Get(int id); + + } +} \ No newline at end of file diff --git a/Octokit/GitHubClient.cs b/Octokit/GitHubClient.cs index 9bbcd384b1..e14a01d726 100644 --- a/Octokit/GitHubClient.cs +++ b/Octokit/GitHubClient.cs @@ -86,6 +86,7 @@ public GitHubClient(IConnection connection) Notification = new NotificationsClient(apiConnection); Organization = new OrganizationsClient(apiConnection); Repository = new RepositoriesClient(apiConnection); + Gist = new GistsClient(apiConnection); Release = new ReleasesClient(apiConnection); User = new UsersClient(apiConnection); SshKey = new SshKeysClient(apiConnection); @@ -132,6 +133,7 @@ public Uri BaseAddress public IMiscellaneousClient Miscellaneous { get; private set; } public IOrganizationsClient Organization { get; private set; } public IRepositoriesClient Repository { get; private set; } + public IGistsClient Gist { get; private set; } public IReleasesClient Release { get; private set; } public ISshKeysClient SshKey { get; private set; } public IUsersClient User { get; private set; } diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index be8ebd597a..c3bcbe95cc 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -445,6 +445,15 @@ public static Uri Events() return "events".FormatUri(); } + /// + /// Returns the for the specified commit. + /// + /// The id of the gist + public static Uri Gist(int id) + { + return "gists/{0}".FormatUri(id); + } + /// /// Returns the for the specified commit. /// diff --git a/Octokit/IGitHubClient.cs b/Octokit/IGitHubClient.cs index c858620824..64c08db5f9 100644 --- a/Octokit/IGitHubClient.cs +++ b/Octokit/IGitHubClient.cs @@ -12,6 +12,7 @@ public interface IGitHubClient IMiscellaneousClient Miscellaneous { get; } IOrganizationsClient Organization { get; } IRepositoriesClient Repository { get; } + IGistsClient Gist { get; } IReleasesClient Release { get; } ISshKeysClient SshKey { get; } IUsersClient User { get; } diff --git a/Octokit/Models/Response/Gist.cs b/Octokit/Models/Response/Gist.cs new file mode 100644 index 0000000000..e273597787 --- /dev/null +++ b/Octokit/Models/Response/Gist.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Octokit +{ + public class Gist + { + public string Url { get; set; } + public string Id { get; set; } + public string Description { get; set; } + public bool Public { get; set; } + public User User { get; set; } + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public IDictionary Files { get; set; } + public int Comments { get; set; } + public string CommentsUrl { get; set; } + public string HtmlUrl { get; set; } + public string GitPullUrl { get; set; } + public string GitPushUrl { get; set; } + public DateTimeOffset CreatedAt { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public IList Forks { get; set; } + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public IList History { get; set; } + } + + public class GistFork + { + public User User { get; set; } + public string Url { get; set; } + public string CreatedAt { get; set; } + } + public class GistFile + { + public int Size { get; set; } + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")] + public string Filename { get; set; } + [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] + public string Type { get; set; } + public string Language { get; set; } + public string Content { get; set; } + public string RawUrl { get; set; } + } + public class GistHistory + { + public string Url { get; set; } + public string Version { get; set; } + public User User { get; set; } + public GistChangeStatus ChangeStatus { get; set; } + public string CommittedAt { get; set; } + } + public class GistChangeStatus + { + public int Deletions { get; set; } + public int Additions { get; set; } + public int Total { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index b6d6d65680..17d727c70a 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -45,11 +45,13 @@ + + @@ -85,6 +87,7 @@ + diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index fdd69ff7c2..41cbabc1b6 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -56,6 +56,7 @@ + @@ -63,6 +64,7 @@ + @@ -174,6 +176,7 @@ + diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index b457bda002..8d51b968bf 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -53,6 +53,8 @@ Properties\SolutionInfo.cs + + @@ -95,6 +97,7 @@ + @@ -237,4 +240,4 @@ --> - + \ No newline at end of file From cc779283ea9a482941c445fba919de1b17bfb220 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 14 Nov 2013 17:58:34 +1100 Subject: [PATCH 2/7] fix user mapping and add doco --- Octokit/Clients/IGistsClient.cs | 2 +- Octokit/Models/Response/Gist.cs | 98 ++++++++++++++------- Octokit/Models/Response/GistChangeStatus.cs | 23 +++++ Octokit/Models/Response/GistFile.cs | 40 +++++++++ Octokit/Models/Response/GistFork.cs | 23 +++++ Octokit/Models/Response/GistHistory.cs | 35 ++++++++ Octokit/Octokit-Mono.csproj | 4 + Octokit/Octokit-netcore45.csproj | 4 + Octokit/Octokit.csproj | 4 + 9 files changed, 198 insertions(+), 35 deletions(-) create mode 100644 Octokit/Models/Response/GistChangeStatus.cs create mode 100644 Octokit/Models/Response/GistFile.cs create mode 100644 Octokit/Models/Response/GistFork.cs create mode 100644 Octokit/Models/Response/GistHistory.cs diff --git a/Octokit/Clients/IGistsClient.cs b/Octokit/Clients/IGistsClient.cs index 5137d71bbb..40b68b60ee 100644 --- a/Octokit/Clients/IGistsClient.cs +++ b/Octokit/Clients/IGistsClient.cs @@ -11,7 +11,7 @@ public interface IGistsClient /// /// http://developer.github.com/v3/gists/#get-a-single-gist /// - /// The id of the gidt + /// The id of the gist [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] Task Get(int id); diff --git a/Octokit/Models/Response/Gist.cs b/Octokit/Models/Response/Gist.cs index e273597787..9224b6c792 100644 --- a/Octokit/Models/Response/Gist.cs +++ b/Octokit/Models/Response/Gist.cs @@ -4,57 +4,87 @@ namespace Octokit { - public class Gist + public class Gist { + /// + /// The API URL for this . + /// public string Url { get; set; } + + /// + /// The Id of this . + /// + /// + /// Given a gist url of https://gist.github.com/UserName/1234 the Id would be '1234'. + /// public string Id { get; set; } + + /// + /// A description of the . + /// public string Description { get; set; } + + /// + /// Indicates if the is private or public. + /// public bool Public { get; set; } - public User User { get; set; } + + /// + /// The who owns this . + /// + /// + /// Given a gist url of https://gist.github.com/UserName/1234 the Owner would be 'UserName'. + /// + public User Owner { get; set; } + + /// + /// A containing all s in this . + /// [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IDictionary Files { get; set; } + + /// + /// The number of comments on this . + /// public int Comments { get; set; } + + /// + /// A url to retrieve the comments for this . + /// public string CommentsUrl { get; set; } + public string HtmlUrl { get; set; } + + /// + /// The git url to pull from to retrieve the contents for this . + /// public string GitPullUrl { get; set; } + + /// + /// The git url to push to when changing this . + /// public string GitPushUrl { get; set; } + + /// + /// The for when this was created. + /// public DateTimeOffset CreatedAt { get; set; } + + /// + /// The for when this was last updated. + /// public DateTimeOffset UpdatedAt { get; set; } + + /// + /// A of all that exist for this . + /// [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IList Forks { get; set; } + + /// + /// A of all containing the full history for this . + /// [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IList History { get; set; } } - - public class GistFork - { - public User User { get; set; } - public string Url { get; set; } - public string CreatedAt { get; set; } - } - public class GistFile - { - public int Size { get; set; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")] - public string Filename { get; set; } - [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] - public string Type { get; set; } - public string Language { get; set; } - public string Content { get; set; } - public string RawUrl { get; set; } - } - public class GistHistory - { - public string Url { get; set; } - public string Version { get; set; } - public User User { get; set; } - public GistChangeStatus ChangeStatus { get; set; } - public string CommittedAt { get; set; } - } - public class GistChangeStatus - { - public int Deletions { get; set; } - public int Additions { get; set; } - public int Total { get; set; } - } } \ No newline at end of file diff --git a/Octokit/Models/Response/GistChangeStatus.cs b/Octokit/Models/Response/GistChangeStatus.cs new file mode 100644 index 0000000000..4b79034743 --- /dev/null +++ b/Octokit/Models/Response/GistChangeStatus.cs @@ -0,0 +1,23 @@ +namespace Octokit +{ + /// + /// User by to indicate the level of change. + /// + public class GistChangeStatus + { + /// + /// The number of deletions that occurred as part of this change. + /// + public int Deletions { get; set; } + + /// + /// The number of additions that occurred as part of this change. + /// + public int Additions { get; set; } + + /// + /// The total number of changes. + /// + public int Total { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Models/Response/GistFile.cs b/Octokit/Models/Response/GistFile.cs new file mode 100644 index 0000000000..2437951663 --- /dev/null +++ b/Octokit/Models/Response/GistFile.cs @@ -0,0 +1,40 @@ +using System.Diagnostics.CodeAnalysis; + +namespace Octokit +{ + public class GistFile + { + + /// + /// The size in bytes of the file. + /// + public int Size { get; set; } + + /// + /// The name of the file + /// + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")] + public string Filename { get; set; } + + /// + /// The mime type of the file + /// + [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] + public string Type { get; set; } + + /// + /// The programming language of the file, if any. + /// + public string Language { get; set; } + + /// + /// The text content of the file. + /// + public string Content { get; set; } + + /// + /// The url to download the file. + /// + public string RawUrl { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Models/Response/GistFork.cs b/Octokit/Models/Response/GistFork.cs new file mode 100644 index 0000000000..869b10bb03 --- /dev/null +++ b/Octokit/Models/Response/GistFork.cs @@ -0,0 +1,23 @@ +using System; + +namespace Octokit +{ + public class GistFork + { + + /// + /// The that created this + /// + public User User { get; set; } + + /// + /// The API URL for this . + /// + public string Url { get; set; } + + /// + /// The for when this was created. + /// + public DateTimeOffset CreatedAt { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Models/Response/GistHistory.cs b/Octokit/Models/Response/GistHistory.cs new file mode 100644 index 0000000000..0ea5fe32df --- /dev/null +++ b/Octokit/Models/Response/GistHistory.cs @@ -0,0 +1,35 @@ +using System; + +namespace Octokit +{ + /// + /// A historical version of a + /// + public class GistHistory + { + /// + /// The url that can be used by the API to retrieve this version of the . + /// + public string Url { get; set; } + + /// + /// A git sha representing the version. + /// + public string Version { get; set; } + + /// + /// The who create this version. + /// + public User User { get; set; } + + /// + /// A that represents the level of change for this . + /// + public GistChangeStatus ChangeStatus { get; set; } + + /// + /// The the version was created. + /// + public DateTimeOffset CommittedAt { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index 17d727c70a..b740338836 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -88,6 +88,10 @@ + + + + diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index 41cbabc1b6..5bc5567a6c 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -177,6 +177,10 @@ + + + + diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index 8d51b968bf..f49c12a01e 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -98,6 +98,10 @@ + + + + From f0ea90bb5f0fbe3da34fa81b520c5d770ee9e308 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 15 Nov 2013 08:19:40 +1100 Subject: [PATCH 3/7] fix gist test and remove some whitespace --- Octokit.Tests.Integration/GistsClientTests.cs | 1 - Octokit.Tests/Clients/GistsClientTests.cs | 5 +---- Octokit/Clients/GistsClient.cs | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Octokit.Tests.Integration/GistsClientTests.cs b/Octokit.Tests.Integration/GistsClientTests.cs index 855e6c5815..124ee8cc4d 100644 --- a/Octokit.Tests.Integration/GistsClientTests.cs +++ b/Octokit.Tests.Integration/GistsClientTests.cs @@ -27,6 +27,5 @@ public async Task CanGetGist() var retrieved = await this._gistsClient.Get(6305249); Assert.NotNull(retrieved); } - } } \ No newline at end of file diff --git a/Octokit.Tests/Clients/GistsClientTests.cs b/Octokit.Tests/Clients/GistsClientTests.cs index bd7b5f95ef..e2b025ba97 100644 --- a/Octokit.Tests/Clients/GistsClientTests.cs +++ b/Octokit.Tests/Clients/GistsClientTests.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; using NSubstitute; using Octokit; using Xunit; @@ -9,7 +7,6 @@ public class GistsClientTests { public class TheGetMethod { - [Fact] public void RequestsCorrectUrl() { @@ -18,7 +15,7 @@ public void RequestsCorrectUrl() client.Get(1); - connection.Received().Get(Arg.Is(u => u.ToString() == "repos/owner/repo/git/commits/reference"), null); + connection.Received().Get(Arg.Is(u => u.ToString() == "gists/1"), null); } } diff --git a/Octokit/Clients/GistsClient.cs b/Octokit/Clients/GistsClient.cs index dc3a5099a5..19e4a7ec46 100644 --- a/Octokit/Clients/GistsClient.cs +++ b/Octokit/Clients/GistsClient.cs @@ -20,7 +20,5 @@ public Task Get(int id) { return ApiConnection.Get(ApiUrls.Gist(id)); } - - } } \ No newline at end of file From ae34ccd4ae7aa59b67f4a35abaf85fcc00e5e539 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 15 Nov 2013 17:36:06 +1100 Subject: [PATCH 4/7] gist id can be a string --- Octokit.Tests.Integration/GistsClientTests.cs | 2 +- Octokit.Tests/Clients/GistsClientTests.cs | 2 +- Octokit/Clients/GistsClient.cs | 2 +- Octokit/Clients/IGistsClient.cs | 2 +- Octokit/Helpers/ApiUrls.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Octokit.Tests.Integration/GistsClientTests.cs b/Octokit.Tests.Integration/GistsClientTests.cs index 124ee8cc4d..e9de24ae78 100644 --- a/Octokit.Tests.Integration/GistsClientTests.cs +++ b/Octokit.Tests.Integration/GistsClientTests.cs @@ -24,7 +24,7 @@ public GistsClientTests() [IntegrationTest] public async Task CanGetGist() { - var retrieved = await this._gistsClient.Get(6305249); + var retrieved = await this._gistsClient.Get("6305249"); Assert.NotNull(retrieved); } } diff --git a/Octokit.Tests/Clients/GistsClientTests.cs b/Octokit.Tests/Clients/GistsClientTests.cs index e2b025ba97..5765cc6dc0 100644 --- a/Octokit.Tests/Clients/GistsClientTests.cs +++ b/Octokit.Tests/Clients/GistsClientTests.cs @@ -13,7 +13,7 @@ public void RequestsCorrectUrl() var connection = Substitute.For(); var client = new GistsClient(connection); - client.Get(1); + client.Get("1"); connection.Received().Get(Arg.Is(u => u.ToString() == "gists/1"), null); } diff --git a/Octokit/Clients/GistsClient.cs b/Octokit/Clients/GistsClient.cs index 19e4a7ec46..c2897f5944 100644 --- a/Octokit/Clients/GistsClient.cs +++ b/Octokit/Clients/GistsClient.cs @@ -16,7 +16,7 @@ public GistsClient(IApiConnection apiConnection) : /// http://developer.github.com/v3/gists/#get-a-single-gist /// /// The id of the gist - public Task Get(int id) + public Task Get(string id) { return ApiConnection.Get(ApiUrls.Gist(id)); } diff --git a/Octokit/Clients/IGistsClient.cs b/Octokit/Clients/IGistsClient.cs index 40b68b60ee..1f3abb480c 100644 --- a/Octokit/Clients/IGistsClient.cs +++ b/Octokit/Clients/IGistsClient.cs @@ -14,7 +14,7 @@ public interface IGistsClient /// The id of the gist [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - Task Get(int id); + Task Get(string id); } } \ No newline at end of file diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index c3bcbe95cc..eedfed9ac5 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -449,7 +449,7 @@ public static Uri Events() /// Returns the for the specified commit. /// /// The id of the gist - public static Uri Gist(int id) + public static Uri Gist(string id) { return "gists/{0}".FormatUri(id); } From 383ec596674e8500f582896997545659425b3856 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 21 Nov 2013 08:45:40 +1100 Subject: [PATCH 5/7] fixes for @shiftkey --- Octokit.sln.DotSettings | 1 - Octokit/Clients/IGistsClient.cs | 1 - Octokit/Models/Response/GistFile.cs | 1 - Octokit/Models/Response/GistFork.cs | 1 - 4 files changed, 4 deletions(-) diff --git a/Octokit.sln.DotSettings b/Octokit.sln.DotSettings index 202116c9e8..36aa179285 100644 --- a/Octokit.sln.DotSettings +++ b/Octokit.sln.DotSettings @@ -262,5 +262,4 @@ II.2.12 <HandlesEvent /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> - True \ No newline at end of file diff --git a/Octokit/Clients/IGistsClient.cs b/Octokit/Clients/IGistsClient.cs index 1f3abb480c..93a44d506f 100644 --- a/Octokit/Clients/IGistsClient.cs +++ b/Octokit/Clients/IGistsClient.cs @@ -15,6 +15,5 @@ public interface IGistsClient [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] Task Get(string id); - } } \ No newline at end of file diff --git a/Octokit/Models/Response/GistFile.cs b/Octokit/Models/Response/GistFile.cs index 2437951663..64aad8b0c8 100644 --- a/Octokit/Models/Response/GistFile.cs +++ b/Octokit/Models/Response/GistFile.cs @@ -4,7 +4,6 @@ namespace Octokit { public class GistFile { - /// /// The size in bytes of the file. /// diff --git a/Octokit/Models/Response/GistFork.cs b/Octokit/Models/Response/GistFork.cs index 869b10bb03..b6c3662c40 100644 --- a/Octokit/Models/Response/GistFork.cs +++ b/Octokit/Models/Response/GistFork.cs @@ -4,7 +4,6 @@ namespace Octokit { public class GistFork { - /// /// The that created this /// From c7a1766bd73cff2ed455159f2fffcf151fdb2fdc Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 21 Nov 2013 08:58:07 +1100 Subject: [PATCH 6/7] fix merge issue --- Octokit/Octokit.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index bcebd9dd8e..9e0ab8764a 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -115,7 +115,6 @@ - From 04408885f8308e186bd29ba2c5e40dcc659f2bd4 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 21 Nov 2013 20:44:18 +1100 Subject: [PATCH 7/7] sync projects --- Octokit/Octokit-MonoAndroid.csproj | 7 +++++++ Octokit/Octokit-Monotouch.csproj | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Octokit/Octokit-MonoAndroid.csproj b/Octokit/Octokit-MonoAndroid.csproj index 5fd88aecd7..4a3b0d7de7 100644 --- a/Octokit/Octokit-MonoAndroid.csproj +++ b/Octokit/Octokit-MonoAndroid.csproj @@ -227,6 +227,13 @@ + + + + + + + \ No newline at end of file diff --git a/Octokit/Octokit-Monotouch.csproj b/Octokit/Octokit-Monotouch.csproj index 755bcb74e4..3189e64f89 100644 --- a/Octokit/Octokit-Monotouch.csproj +++ b/Octokit/Octokit-Monotouch.csproj @@ -222,6 +222,13 @@ + + + + + + + \ No newline at end of file