Coder Social home page Coder Social logo

anehing / git-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from schacon/git-ruby

0.0 1.0 0.0 184 KB

A pure ruby implementation of Git - unmaintained. See grit for an active project that has inherited much of this code.

Home Page: http://groups.google.com/group/git-ruby

License: MIT License

git-ruby's Introduction

  • Git-Ruby Is Not Maintained * ==============================

The Git-Ruby project is no longer maintained by me. I will leave it up here for now, but almost all of this code has since been incorporated into the Grit project (http://github.com/schacon/grit) and works much, much better. If you're interested in using Git from Ruby, please check out Grit (specifically the schacon/grit fork) - it does as much as it can from Ruby and falls back to system calls if it needs to. The API is different, but the project is being actively maintained.

Git Library for Ruby

A pure ruby implementation of Git

Homepage

Git public hosting of the project source code and project wiki is at:

http://github.com/schacon/gitruby

Gitr

I have included a command line pure-ruby git client called 'gitr'

The following commands are available - they all will run in pure ruby, without forking out the the git binary. In fact, they can be run on a machine without git compiled on it.

Commands currently implemented:

  • add
  • commit
  • log
  • log-shas
  • cat-file (treeish)
  • rev-parse (treeish)
  • branches
  • ls-tree (tree)

Examples

Here are some of examples of how to use the Git-Ruby package.

First you have to remember to require rubygems if it's not. Then include the 'git-ruby' gem.

require 'rubygems'
require 'git-ruby'

g = GitRuby.open('my_project')  # has a .git subdir

g.add('file')
g.commit('commit message')

g.log.each do |commit|
  puts commit.sha
  puts commit.message
  puts commit.author.email

  commit.gtree.children.each do |name, obj|
    if obj.tree?
      puts ['tree: ' name, obj.sha].join("\t")
    end

    if obj.blob?
      puts ['blob: ' name, obj.sha].join("\t")
    end
  end
end

git-ruby's People

Contributors

schacon avatar

Watchers

anehing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.