SemDiff  1.0.0
Semantic Diffing Tool
SemDiff.Core.Repo Class Reference

Contains all the methods and classes necessary to use the GitHub api to pull down data about pull requests. Additionally, contains the logic for authenticating More...

Classes

class  GitHubError
 Object used for parsing that reflects the json of the response from GitHub in an error
 

Public Member Functions

 Repo (string gitDir, string repoOwner, string repoName, string authUsername=null, string authToken=null)
 
void GetConfiguration ()
 If the authentication file exists, it reads in the data. If the authentication file doesn't exist, it creates a blank copy. More...
 
void UpdateGitIgnore ()
 
void GetCurrentSaved ()
 Reads the pull requests from the persistent file More...
 
async Task< IList< PullRequest > > GetPullRequestsAsync ()
 Gets each page of the pull request list from GitHub. Once the list is complete, get all the pull request files for each pull request. More...
 
Task UpdateLimitAsync ()
 Makes a request to GitHub to update RequestsRemaining and RequestsLimit More...
 
void UpdateLocalSavedList ()
 Write the current internal list of pull requests to a file More...
 
async Task UpdateRemoteChangesAsync ()
 Gets Pull Requests and the master branch if it has been modified, this method also insures that we don't update more than MaxUpdateInterval More...
 

Static Public Member Functions

static Repo GetRepoFor (string filePath)
 Looks for the git repo above the current file in the directory hierarchy. Null will be returned if no repo was found. More...
 

Public Attributes

string CachedLocalPullRequestListPath => Path.Combine(CacheDirectory, "LocalList.json")
 
string LocalRepoDirectory => Path.GetDirectoryName(Path.GetDirectoryName(LocalGitDirectory))
 

Properties

static TimeSpan MaxUpdateInterval [get, set]
 
string AuthToken = TimeSpan.FromMinutes(5) [get, set]
 
string AuthUsername [get, set]
 
string CacheDirectory [get, set]
 
string ConfigFile [get]
 
HttpClient Client = "User_Config.json" [get]
 
string EtagNoChanges [get, set]
 
DateTime LastUpdate [get, set]
 
string LocalGitDirectory = DateTime.MinValue [get]
 
string Owner [get, set]
 
LineEndingType LineEndings [get, set]
 
List< PullRequestPullRequests [get]
 
string RepoName = new List<PullRequest>() [get, set]
 
int RequestsLimit [get]
 
int RequestsRemaining [get]
 

Detailed Description

Contains all the methods and classes necessary to use the GitHub api to pull down data about pull requests. Additionally, contains the logic for authenticating

Member Function Documentation

void SemDiff.Core.Repo.GetConfiguration ( )

If the authentication file exists, it reads in the data. If the authentication file doesn't exist, it creates a blank copy.

void SemDiff.Core.Repo.GetCurrentSaved ( )

Reads the pull requests from the persistent file

async Task<IList<PullRequest> > SemDiff.Core.Repo.GetPullRequestsAsync ( )

Gets each page of the pull request list from GitHub. Once the list is complete, get all the pull request files for each pull request.

Returns
List of pull request information.
static Repo SemDiff.Core.Repo.GetRepoFor ( string  filePath)
static

Looks for the git repo above the current file in the directory hierarchy. Null will be returned if no repo was found.

Parameters
filePathPath to file in repo
Returns
Representation of repo or null (to indicate not found)
Task SemDiff.Core.Repo.UpdateLimitAsync ( )

Makes a request to GitHub to update RequestsRemaining and RequestsLimit

void SemDiff.Core.Repo.UpdateLocalSavedList ( )

Write the current internal list of pull requests to a file

async Task SemDiff.Core.Repo.UpdateRemoteChangesAsync ( )

Gets Pull Requests and the master branch if it has been modified, this method also insures that we don't update more than MaxUpdateInterval


The documentation for this class was generated from the following file: