Parent

Methods

Class/Module Index [+]

Quicksearch

Github::GitData::Blobs

Since blobs can be any arbitrary binary data, the input and responses for the blob api takes an encoding parameter that can be either utf-8 or base64. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it.

Public Instance Methods

create(*args) click to toggle source

Create a blob

Inputs

  • :content - String of content

  • :encoding - String containing encodingutf-8 or base64

Examples

github = Github.new
github.git_data.blobs.create 'user-name', 'repo-name',
  "content" => "Content of the blob",
  "encoding" => "utf-8"
# File lib/github_api/git_data/blobs.rb, line 35
def create(*args)
  arguments(args, :required => [:user, :repo]) do
    sift VALID_BLOB_PARAM_NAMES
    assert_required VALID_BLOB_PARAM_NAMES
  end

  post_request("/repos/#{user}/#{repo}/git/blobs", arguments.params)
end
find(*args) click to toggle source
Alias for: get
get(*args) click to toggle source

Get a blob

Examples

github = Github.new
github.git_data.blobs.get 'user-name', 'repo-name', 'sha'
# File lib/github_api/git_data/blobs.rb, line 17
def get(*args)
  arguments(args, :required => [:user, :repo, :sha])

  get_request("/repos/#{user}/#{repo}/git/blobs/#{sha}", arguments.params)
end
Also aliased as: find

[Validate]

Generated with the Darkfish Rdoc Generator 2.