Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-api

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Installation

NB: This is a super early version of this gem. Use only for testing purposes

To install the gem, simply run:

gem install 'github-api'

Or the bundler equivalent:

bundle install 'github-api'

Examples

Use the gem to create / retrieve Github repo data. You can use my 'github-oauth' gem to get the token.

Use oauth token to create a user object

@user = GithubApi::User.new(ab3cd9j4ks73hf7)

Then create stuff

@user.has_repo?("my_repo_name")

repo = @user.create_repo("githunch_bookmarks", {
  :description => "Repository for Githunch Bookmarks",
  :homepage => "http://githunch.heroku.com",
  :public => true,
  :has_issues => false,
  :has_wiki => false,
  :has_downloads => false
})

file = GithubApi::Blob.new(:content => "this is my content", :path => "bookmarks.json")
tree = repo.create_tree([file])

commit = repo.create_initial_commit(tree.data["sha"], "This is my commit text")

reference = repo.create_ref("refs/heads/master", commit.data["sha"])

Or retrieve stuff

blob = repo.ref("heads/master").commit.tree.file("bookmarks.json")
puts blob.content

FAQs

Package last updated on 04 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc