Method: Octokit::Client::Gists#edit_gist

Defined in:
lib/octokit/client/gists.rb

#edit_gist(gist, options = {}) ⇒ Object

Edit a gist

Examples:

Update a gist

@client.edit_gist('some_id', {
  :files => {"boo.md" => {"content" => "updated stuff"}}
})

Parameters:

  • options (Hash) (defaults to: {})

    Gist information.

Options Hash (options):

  • :description (String)
  • :files (Hash)

    Files that make up this gist. Keys should be the filename, the value a Hash with a :content key with text content of the Gist.

    NOTE: All files from the previous version of the gist are carried over by default if not included in the hash. Deletes can be performed by including the filename with a null hash.

Returns:

  • Sawyer::Resource

    Newly created gist info

See Also:



93
94
95
# File 'lib/octokit/client/gists.rb', line 93

def edit_gist(gist, options = {})
  patch "gists/#{Gist.new(gist)}", options
end