pcgeek86 / PSGitHub

This PowerShell module contains commands to manage GitHub through its REST API.
MIT License
186 stars 37 forks source link

GitHub gist #20

Closed dotps1 closed 4 years ago

dotps1 commented 8 years ago

Improvements / Enhancements

Added initial classes for GitHubGists which also lead to other classes that are partially embedded.

added a method to the GitHubGistFile method called GetFileContent allowing for the content of a file to be fetched if it is not present. which seems to be any time a Gist is retrieved without using the Id. This allows for the following syntax to work properly:

Get-GitHubGist | Select -First 1 | Save-GitHubGist

Updated Save-GitHubGist to accept object of type GitHubGist rather then System.Object.

I think that's it. I didn't move any of the classes you have defined already, but that will need to be done, unless i'm missing something.

this is my first attempt at classes, so feel free to be brutal with comments and suggestions lol

dotps1 commented 8 years ago

I'm not following that comment on any of those.

PlagueHO commented 8 years ago

Hi there @dotps1, All PS1 files should end with a new line character. GitHub will show you if you've missed any: 2016-03-31_16-42-29 See the little red symbol at the bottom. I'm always doing this myself TBH. Thanks! :smile:

dotps1 commented 8 years ago

Why do they need that? I've never done that on any of my stuff.

Sent from my iPhone

On Mar 30, 2016, at 11:44 PM, Daniel Scott-Raynsford notifications@github.com wrote:

Hi there @dotps1, All PS1 files should end with a new line character. GitHub will show you if you've missed any:

See the little red symbol at the bottom. I'm always doing this myself TBH. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

PlagueHO commented 8 years ago

See: http://stackoverflow.com/questions/5813311/no-newline-at-end-of-file

PlagueHO commented 8 years ago

All of the MSFT PowerShell community repos require this as well, so it's generally a good habit to get into (although as I said I'm always missing it myself).

dotps1 commented 8 years ago

I noticed my GitHubGistFork class was missing a few properties, I corrected that, also, GitHubGistHistory no longer derives that, no point. I added a lot of documentation to the Classes. I also added new lines at the end of all the files I have worked on.

dotps1 commented 8 years ago

I added the Copy-GitHubGist function with an alias of Fork-GitHubGist. I also noticed my constructor name was mistyped for GitHubGistFork, I corrected that, I also added a try catch to the private method Invoke-GitHubApi; if it fails it will throw and error containing the message property from the api response. this looks much better then the json response.

felixfbecker commented 4 years ago

Closing since we have these cmdlets in PSGitHub now.