Skip to content

Commit

Permalink
Merge pull request #759 from khellang/nuke-repo-client-apis
Browse files Browse the repository at this point in the history
Nuke GetReadme and GetReadmeHtml
  • Loading branch information
shiftkey committed Mar 19, 2015
2 parents 0517c3e + def374d commit 4418e26
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 127 deletions.
18 changes: 0 additions & 18 deletions Octokit.Reactive/Clients/IObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,6 @@ public interface IObservableRepositoriesClient
Justification = "Makes a network request")]
IObservable<Repository> GetAllForOrg(string organization);

/// <summary>
/// Returns the HTML rendered README.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadme. Please use that instead.")]
IObservable<Readme> GetReadme(string owner, string name);

/// <summary>
/// Returns just the HTML portion of the README without the surrounding HTML document.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadmeHtml. Please use that instead.")]
IObservable<string> GetReadmeHtml(string owner, string name);

/// <summary>
/// A client for GitHub's Commit Status API.
/// </summary>
Expand Down
24 changes: 0 additions & 24 deletions Octokit.Reactive/Clients/ObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,30 +159,6 @@ public IObservable<Repository> GetAllForOrg(string organization)
return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.OrganizationRepositories(organization));
}

/// <summary>
/// Returns the HTML rendered README.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadme. Please use that instead.")]
public IObservable<Readme> GetReadme(string owner, string name)
{
return _client.Content.GetReadme(owner, name).ToObservable();
}

/// <summary>
/// Returns just the HTML portion of the README without the surrounding HTML document.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadmeHtml. Please use that instead.")]
public IObservable<string> GetReadmeHtml(string owner, string name)
{
return _client.Content.GetReadmeHtml(owner, name).ToObservable();
}

/// <summary>
/// A client for GitHub's Commit Status API.
/// </summary>
Expand Down
27 changes: 0 additions & 27 deletions Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,33 +575,6 @@ public async Task ReturnsAllRepositoriesForOrganization()
}
}

public class TheGetReadmeMethod
{
[IntegrationTest]
public async Task ReturnsReadmeForSeeGit()
{
var github = Helper.GetAuthenticatedClient();

var readme = await github.Repository.GetReadme("octokit", "octokit.net");
Assert.Equal("README.md", readme.Name);
string readMeHtml = await readme.GetHtmlContent();
Assert.True(readMeHtml.StartsWith("<div class="));
Assert.Contains(@"data-path=""README.md"" id=""file""", readMeHtml);
Assert.Contains("Octokit - GitHub API Client Library for .NET", readMeHtml);
}

[IntegrationTest]
public async Task ReturnsReadmeHtmlForSeeGit()
{
var github = Helper.GetAuthenticatedClient();

var readmeHtml = await github.Repository.GetReadmeHtml("octokit", "octokit.net");
Assert.True(readmeHtml.StartsWith("<div class="));
Assert.Contains(@"data-path=""README.md"" id=""readme""", readmeHtml);
Assert.Contains("Octokit - GitHub API Client Library for .NET", readmeHtml);
}
}

public class TheGetAllContributorsMethod
{
[IntegrationTest]
Expand Down
26 changes: 0 additions & 26 deletions Octokit/Clients/IRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,32 +164,6 @@ public interface IRepositoriesClient
Justification = "Makes a network request")]
Task<IReadOnlyList<Repository>> GetAllForOrg(string organization);

/// <summary>
/// Gets the preferred README for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/contents/#get-the-readme">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadme. Please use that instead.")]
Task<Readme> GetReadme(string owner, string name);

/// <summary>
/// Gets the perferred README's HTML for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/contents/#get-the-readme">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadmeHtml. Please use that instead.")]
Task<string> GetReadmeHtml(string owner, string name);

/// <summary>
/// A client for GitHub's Commit Status API.
/// </summary>
Expand Down
32 changes: 0 additions & 32 deletions Octokit/Clients/RepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,38 +254,6 @@ public Task<IReadOnlyList<Repository>> GetAllForOrg(string organization)
return ApiConnection.GetAll<Repository>(ApiUrls.OrganizationRepositories(organization));
}

/// <summary>
/// Gets the preferred README for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/contents/#get-the-readme">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadme. Please use that instead.")]
public Task<Readme> GetReadme(string owner, string name)
{
return Content.GetReadme(owner, name);
}

/// <summary>
/// Gets the perferred README's HTML for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/contents/#get-the-readme">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns></returns>
[Obsolete("This method has been obsoleted by Content.GetReadmeHtml. Please use that instead.")]
public Task<string> GetReadmeHtml(string owner, string name)
{
return Content.GetReadmeHtml(owner, name);
}

/// <summary>
/// A client for GitHub's Commit Status API.
/// </summary>
Expand Down

0 comments on commit 4418e26

Please sign in to comment.