Rugged 是一个 GitRuby 开发包,使用 libgit2 API

安装方法:

$ gem install rugged

使用方法:

require 'rugged'
 
repo = Rugged::ReposiTory.new('path/to/my/repository')
# => #<Rugged::Repository:2228536260 {path: "path/to/my/repository/.git/"}>
 
Rugged::Repository.iNit_at('.':bare)
 
Rugged::Repository.discover("/Users/me/projects/repo/lib/subdir/")
# => "/Users/me/projects/repo/.git/"
 
# Does the given SHA1 exist in this repository?
repo.exists?('07b44cbda23b726e5d54e2ef383495922c024202')
# => true
 
# Boolean repository state values:
repo.bare?
# => false
repo.empty?
# => true
repo.head_orphan?
# => false
repo.head_detached?
# => false
 
# Path Accessors
repo.path
# => "path/to/my/repository/.git/"
repo.workdir
# => "path/to/my/repository/"
 
# The HEAD of the repository.
ref = repo.head
# => #<Rugged::Reference:2228467240 {name: "refs/heads/master", target: "07b44cbda23b726e5d54e2ef383495922c024202"}>
 
# From the returned ref, you can also access the `name` and `target`:
ref.name
# => "refs/heads/master"
ref.target
# => "07b44cbda23b726e5d54e2ef383495922c024202"
 
# Reading an object
object = repo.read('a0ae5566e3c8a3bddffab21022056f0b5e03ef07')
# => #<Rugged::OdbObject:0x109a64780>
object.len
# => 237
object.Data
# => "tree 76f23f186076fc291742816721ea8c3e95567241\nparent 8e3c5c52b8f29da0adc7e8be8a037cbeaea6de6b\nauthor VICEnt Mart\303\255 <tanoku@Gmail.com> 1333859005 +0200\ncommitter Vicent Mart\303\255 <tanoku@gmail.com> 1333859005 +0200\n\nAdd `Repository#blob_at`\n"
object.type
# => :commit
rugged v0.25.0b1 发布
rugged v0.25.0b1 发布了,rugged是一个Git 的 Ruby 开发包。暂无相关改进说明,你可以关注这里。下载地址:Source code (zip)Source code (tar.gz)

发布于 2016-03-11 01:28:54 | 85 次阅读

rugged v0.24.0b14 发布,Git 的 Ruby 开发包
Rugged 是一个 Git 的 Ruby 开发包,使用 libgit2 API 。更新记录如下:Add Rugged::Repository#checkout_index.This allows to perform checkout from a given GIT index. It might be handy in case of manual merge conflicts resolution with user intervention.Dmytro MilinevskyyAdd accessors for th

发布于 2016-03-03 00:27:37 | 152 次阅读

rugged 0.24.0b13 发布,Git 的 Ruby 开发包
rugged 0.24.0b13 发布了,该版本升级 libgit2 到 0.23.3 版本,修复了很多 bug 同时包含一些新特性。Rugged 是一个 Git 的 Ruby 开发包,使用 libgit2 API

发布于 2016-02-16 23:30:52 | 89 次阅读

Rugged 0.23.2 发布,Git 的 Ruby 开发包
Rugged 0.23.2 发布,改进内容请查看更新日志。下载地址:Source code (zip)Rugged 是一个 Git 的 Ruby 开发包,使用 libgit2 API。

发布于 2015-08-14 00:00:16 | 165 次阅读

Rugged 0.23.0b4 发布,Git 的 Ruby 开发包
Rugged 0.23.0b4 发布,详细改进内容请查看更新日志。该版本下载地址:Source code (zip)

发布于 2015-06-29 23:56:56 | 105 次阅读

Rugged 0.23.0b3 发布,Git 的 Ruby 开发包
Rugged 是一个 Git 的 Ruby 开发包,使用 libgit2 APIRugged 0.23.0b3 发布,此版本现已提供下载:https://github.com/libgit2/rugged/archive/v0.23.0b3.zip。详细改进内容请看更新日志:https://github.com/libgit2/rugged/blob/master/CHANGELOG.md。 

发布于 2015-06-27 01:29:46 | 84 次阅读

Rugged 0.23.0b2 发布,Git Ruby 开发包
rugged 0.23.0b2 发布,此版本主要有以下更新:Updated the API of reflog modifying methods.The :safe_create flag was removed from Repository#checkout_tree.Update bundled libgit2 to 8311db0cf8ae15b46edd14358a8238862e0bac4d.详细信息请查看发行页面。此版本现已提供下载:S

发布于 2015-05-18 23:27:03 | 102 次阅读

Rugged 0.22.1b1 发布,Git 的 Ruby 开发包
Rugged 0.22.1b1 版本已经发布,与 Rugged 0.21 相比,Rugged 0.22.1b1 做了如下修正:Add Rugged::Tree#count_recursiveUpdate bundled libgit2 to 0.22.1.Add missing handling of libgit2 errors in Rugged::BranchCollection#each and Rugged::BranchCollection#each_nameThe Ru

发布于 2015-03-10 04:32:19 | 187 次阅读

Rugged 0.21.4 发布,Git 的 Ruby 开发包
Rugged 0.21.4 发布,Rugged 是一个 Git 的 Ruby 开发包,使用 libgit2 API该版本升级 libgit2 到 0.21.4,libgit2 0.21.4 主要是修复了如下 bug :bce9484 Fix assert when receiving uncommon sideband packet4f2d272 ignore: don't leak rules into higher directories8fce79b ignore:

发布于 2015-01-18 23:47:27 | 173 次阅读

Rugged v0.21.3 发布,Ruby 的 Git 开发包
Rugged 0.21.3 发布了,该版本更新了 libgit2 到 0.21.3 版本,而 libgit2 0.21.3 是一个重要的 bug 修复版本,修复了如下 bug :e476e7b index tests: test capitalization before mkdir90fad07 Plug leaks188ca62 Create miscapitialised dirs for case-sensitive filesystems88c8abf Bu

发布于 2014-12-19 00:22:32 | 143 次阅读

Rugged v0.22.0b1 发布,Ruby 的 Git 开发包
Rugged v0.22.0b1 发布了,该版本将 libgit2 从 0.21.0 版本升级到 0.21.2 版本。同时修复了一些 bug。Rugged 是一个 Git 的 Ruby 开发包,使用 libgit2 API下载地址:https://github.com/libgit2/rugged/releases

发布于 2014-11-19 00:56:26 | 150 次阅读


Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务