lib/hub/github_api.rb
# Public: Fetch the first raw blob from a gist
Fetch the first raw blob from a gist
Fetch the first raw blob from a gist
def gist_raw gist_id
      res = get("https://%s/gists/%s" % [api_host('github.com'), gist_id])
      res.error! unless res.success?
      raw_url = res.data['files'].values.first['raw_url']
      res = get(raw_url) do |req|
        req['Accept'] = 'text/plain'
      end
      res.error! unless res.success?
      res.body
    end
def gist_raw gist_id res = get ( "https://%s/gists/%s" % [ api_host ( 'github.com' ) , gist_id ] ) res . error! unless res . success? raw_url = res . data [ 'files' ] . values . first [ 'raw_url' ] res = get ( raw_url ) do | req | req [ 'Accept' ] = 'text/plain' end res . error! unless res . success? res . body end
Public: Fetch the first raw blob from a gist
Public : Fetch the first raw blob from a gist
gist_id