Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

renamed everything to Rugged from Ribbit

  • Loading branch information...
commit b6eac62956c82115ba3a4b5af3e5b0b3285afa5c 1 parent 5a977b9
@schacon schacon authored
View
92 README.md
@@ -1,7 +1,7 @@
-Ribbit - libgit2 bindings in Ruby
+Rugged - libgit2 bindings in Ruby
===================================
-Ribbit is a Ruby bindings to the libgit2 linkable C Git library. This is
+Rugged is a Ruby bindings to the libgit2 linkable C Git library. This is
for testing and using the libgit2 library in a language that is awesome.
INSTALLING AND RUNNING
@@ -18,10 +18,10 @@ Next, you need to install rake-compiler:
$ sudo gem install rake-compiler
-Now that those are installed, you can install Ribbit:
+Now that those are installed, you can install Rugged:
- $ git clone git://github.com/libgit2/ribbit.git
- $ cd ribbit
+ $ git clone git://github.com/libgit2/rubbit.git
+ $ cd rugged
$ rake compile
$ rake test
@@ -32,10 +32,12 @@ API
There is a general library for some basic Gitty methods. So far, just converting
a raw sha (20 bytes) into a readable hex sha (40 char).
- raw = Ribbit::Lib.hex_to_raw(hex_sha)
- hex = Ribbit::Lib.raw_to_hex(20_byte_raw_sha)
+ raw = Rugged::Lib.hex_to_raw(hex_sha)
+ hex = Rugged::Lib.raw_to_hex(20_byte_raw_sha)
-=== Repository Access
+
+Repository Access
+-----------------
There is a Repository class that you can instantiate with a path.
This lets you check for objects, read raw object data, write raw object data and
@@ -46,7 +48,7 @@ Repository is the main repository object that everything
else will emanate from.
repo =
- Ribbit::Repository.new(path, git_dir=nil, index_path=nil)
+ Rugged::Repository.new(path, git_dir=nil, index_path=nil)
ctnt, type = repo.read(sha)
gobj = repo.lookup(sha, type[?]) # optional type argument for checking
sha = repo.write(content, type)
@@ -55,11 +57,13 @@ else will emanate from.
If Repository is initialized without `git_dir`, path + '.git' will be assumed
and path will be assumed to be the working directory. If `path` is a git
-directory, then `git_dir` will be set to that and none of the Ribbit functions
+directory, then `git_dir` will be set to that and none of the Rugged functions
that need a working directory will work. If the `index_path` is not specified,
the `git_dir` path plus '/index' will be assumed.
-=== Object Access
+
+Object Access
+-----------------
Object is the main object class - it shouldn't be created directly,
but all of these methods should be useful in it's derived classes
@@ -72,7 +76,7 @@ but all of these methods should be useful in it's derived classes
# the repository and instantiated
# If the 'sha' ID of the object is missing, the object will be
# created in memory and can be written later on to the repository
- Ribbit::Object(repo, sha)
+ Rugged::Object(repo, sha)
obj.sha
obj.type
@@ -87,7 +91,7 @@ so the object can be re-written slightly differently or no parameter
to simply read the current value out
gobjc =
- Ribbit::Commit.new < Ribbit::Object
+ Rugged::Commit.new < Rugged::Object
str = gobjc.message
str = gobjc.message_short
str = gobjc.message_body # TODO
@@ -98,7 +102,7 @@ to simply read the current value out
arr = gobjc.parents [*] # TODO
gobtg =
- Ribbit::Tag.new < Ribbit::Object
+ Rugged::Tag.new < Rugged::Object
gobj = gobtg.target
int = gobtg.target_type
str = gobtg.name
@@ -106,14 +110,14 @@ to simply read the current value out
str = gobtg.message
gobtr =
- Ribbit::Tree.new < Ribbit::Object
+ Rugged::Tree.new < Rugged::Object
gobtr.add(ent) # TODO
gobtr.remove(name) # TODO
int = gobtr.entry_count
ent = gobtr.get_entry
ent =
- Ribbit::TreeEntry.new(attributes, name, sha)
+ Rugged::TreeEntry.new(attributes, name, sha)
int = ent.attributes
str = ent.name
sha = ent.sha
@@ -121,7 +125,9 @@ to simply read the current value out
// * Person information is returned as a hash table
-=== Commit Walker
+
+Commit Walker
+-----------------
There is also a Walker class that currently takes a repo object. You can push
head SHAs onto the walker, then call next to get a list of the reachable commit
@@ -129,20 +135,22 @@ objects, one at a time. You can also hide() commits if you are not interested in
anything beneath them (useful for a `git log master ^origin/master` type deal).
walker =
- Ribbit::Walker.new(repo)
+ Rugged::Walker.new(repo)
walker.push(hex_sha_interesting)
walker.hide(hex_sha_uninteresting)
cmt = walker.next # false if none left
walker.reset
-=== Index/Staging Area
+
+Index/Staging Area
+-------------------
We can inspect and manipulate the Git Index as well.
# the remove and add functions immediately flush to the index file on disk
index =
- Ribbit::Index.new(repo, path=nil) # TODO: take a repo or a path
+ Rugged::Index.new(repo, path=nil) # TODO: take a repo or a path
index.refresh # re-read the index file from disk
int = index.entry_count # count of index entries
ent = index.get_entry(i/path)
@@ -153,7 +161,7 @@ We can inspect and manipulate the Git Index as well.
#TODO index.write_tree
ientry =
- Ribbit::IndexEntry.new(index, offset)
+ Rugged::IndexEntry.new(index, offset)
str = ientry.path
time = ientry.ctime
time = ientry.mtime
@@ -167,7 +175,8 @@ We can inspect and manipulate the Git Index as well.
int = ientry.flags # (what flags are available?)
int = ientry.flags_extended # (what flags are available?)
-=== Index Status # TODO
+Index Status # TODO
+-------------------
#TODO index.status # how does the index differ from the work tree and the last commit
@@ -179,12 +188,14 @@ We can inspect and manipulate the Git Index as well.
# ['file4', :unmerged],
# ]
-=== Ref Management # TODO
+
+Ref Management # TODO
+-------------------
The RefList class allows you to list, create and delete packed and loose refs.
list =
- Ribbit::RefList.new(repo)
+ Rugged::RefList.new(repo)
ref = list.head # can retrieve and set HEAD with this - returns ref obj or commit obj if detatched
array = list.list([type]) # type is 'heads', 'tags', 'remotes', 'notes', et
list.add(oref)
@@ -192,7 +203,7 @@ The RefList class allows you to list, create and delete packed and loose refs.
list.unpack
oref =
- Ribbit::Ref.new(ref, sha)
+ Rugged::Ref.new(ref, sha)
br.name # master
br.ref # refs/heads/master
br.type # heads
@@ -201,32 +212,37 @@ The RefList class allows you to list, create and delete packed and loose refs.
br.delete
br.save
-=== Config Management # TODO
+
+Config Management # TODO
+------------------------
conf =
- Ribbit::Config.new(repo)
+ Rugged::Config.new(repo)
hash = conf.list([section])
val = conf.get(key, [scope])
bool = conf.set(key, value, [scope]) # scope is 'local'(default), 'global', 'system'
-=== Client Transport # TODO
+Client Transport # TODO
+-----------------------
client =
- Ribbit::Client.new(repo)
+ Rugged::Client.new(repo)
summry = client.fetch(url, [refs])
summry = client.push(url, refs)
refs = client.refs(url) # ls-remote
-=== Remote Management # TODO
+
+Remote Management # TODO
+------------------------
remlist =
- Ribbit::RemoteList.new(repo)
+ Rugged::RemoteList.new(repo)
array = remlist.list
rem = remlist.add(alias, url)
rem =
- Ribbit::Remote.new(repo)
+ Rugged::Remote.new(repo)
summry = rem.fetch([refs])
summry = rem.push(refs)
summry = rem.remove(refs)
@@ -234,6 +250,16 @@ The RefList class allows you to list, create and delete packed and loose refs.
heads = rem.heads
+Server Transport # TODO
+------------------------
+
+ server =
+ Rugged::Server.new
+ server.listen(port = 8080, ip = 0.0.0.0)
+ server.export_repo(path/repo)
+ server.export_path(path)
+
+
TODO
==============
@@ -246,7 +272,7 @@ be listed in the LIBGIT2_VERSION file.
CONTRIBUTING
==============
-Fork libgit2/ribbit on GitHub, make it awesomer (preferably in a branch named
+Fork libgit2/rugged on GitHub, make it awesomer (preferably in a branch named
for the topic), send a pull request.
View
10 Rakefile
@@ -3,8 +3,8 @@ require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/extensiontask'
-Rake::ExtensionTask.new('ribbit') do |r|
- r.lib_dir = 'lib/ribbit'
+Rake::ExtensionTask.new('rugged') do |r|
+ r.lib_dir = 'lib/rugged'
end
#
@@ -66,7 +66,7 @@ if command? :ronn
desc "Build the manual"
task "man:build" do
- sh "ronn -br5 --organization=SCHACON --manual='Ribbit Manual' man/*.ron"
+ sh "ronn -br5 --organization=SCHACON --manual='Rugged Manual' man/*.ron"
end
end
@@ -77,13 +77,13 @@ end
begin
require 'mg'
- MG.new("ribbit.gemspec")
+ MG.new("rugged.gemspec")
desc "Push a new version to Gemcutter and publish docs."
task :publish => "gem:publish" do
require File.dirname(__FILE__) + '/lib/mustache/version'
- system "git tag v#{Ribbit::Version}"
+ system "git tag v#{Rugged::Version}"
sh "git push origin master --tags"
sh "git clean -fd"
exec "rake pages"
View
2  TODO.txt
@@ -1,4 +1,4 @@
-## Ribbit TODO ##
+## Rugged TODO ##
* get basic object stuff working again
* commit parsing
View
8 USAGE.rb
@@ -1,5 +1,5 @@
#
-# Some example proposed usages of Ribbit
+# Some example proposed usages of Rugged
# so we can make sure the API design is OK
#
@@ -7,7 +7,7 @@
# low level reading and writing
#
-repo = Ribbit::Repository.new(path_to_repo)
+repo = Rugged::Repository.new(path_to_repo)
if repo.exists(blob_sha)
# reading
blob_data, type = repo.read(blob_sha)
@@ -92,8 +92,8 @@ def ls_tree(tree_sha)
tree.add(entry.sha(bsha))
tsha = tree.write
-new_commit = Ribbit::Commit.new
-person = Ribbit::Person.new("Scott", "scott@github.com", Time.now)
+new_commit = Rugged::Commit.new
+person = Rugged::Person.new("Scott", "scott@github.com", Time.now)
commit.author(person)
commit.message("updated file.txt")
commit.parents([head_sha])
View
4 ext/ribbit/extconf.rb → ext/rugged/extconf.rb
@@ -1,9 +1,9 @@
require 'mkmf'
-dir_config("ribbit")
+dir_config("rugged")
have_library("git2")
have_library('z')
-create_makefile("ribbit")
+create_makefile("rugged")
View
302 ext/ribbit/ribbit.c → ext/rugged/rugged.c
@@ -14,21 +14,21 @@
static VALUE rb_git_createobject(git_object *object);
-static VALUE rb_cRibbit;
-static VALUE rb_cRibbitLib;
-static VALUE rb_cRibbitRepo;
-static VALUE rb_cRibbitObject;
-static VALUE rb_cRibbitCommit;
-static VALUE rb_cRibbitTag;
-static VALUE rb_cRibbitTree;
-static VALUE rb_cRibbitTreeEntry;
-static VALUE rb_cRibbitWalker;
-static VALUE rb_cRibbitIndex;
-static VALUE rb_cRibbitIndexEntry;
+static VALUE rb_cRugged;
+static VALUE rb_cRuggedLib;
+static VALUE rb_cRuggedRepo;
+static VALUE rb_cRuggedObject;
+static VALUE rb_cRuggedCommit;
+static VALUE rb_cRuggedTag;
+static VALUE rb_cRuggedTree;
+static VALUE rb_cRuggedTreeEntry;
+static VALUE rb_cRuggedWalker;
+static VALUE rb_cRuggedIndex;
+static VALUE rb_cRuggedIndexEntry;
/*
- * Ribbit Lib
+ * Rugged Lib
*/
@@ -69,7 +69,7 @@ static VALUE rb_git_string_to_type(VALUE self, VALUE string_type)
/*
- * Ribbit Object Database
+ * Rugged Object Database
*/
static VALUE rb_git_repo_allocate(VALUE klass)
{
@@ -100,7 +100,7 @@ static VALUE rb_git_repo_index(VALUE self)
if ((index = git_repository_index(repo)) == NULL)
rb_raise(rb_eRuntimeError, "failed to open Index file");
- return Data_Wrap_Struct(rb_cRibbitIndex, NULL, NULL, index);
+ return Data_Wrap_Struct(rb_cRuggedIndex, NULL, NULL, index);
}
static VALUE rb_git_repo_exists(VALUE self, VALUE hex)
@@ -226,7 +226,7 @@ static VALUE rb_git_repo_lookup(int argc, VALUE *argv, VALUE self)
}
/*
- * Ribbit Object
+ * Rugged Object
*/
static git_object *rb_git_get_C_object(git_repository *repo, VALUE object_value, git_otype type)
{
@@ -242,7 +242,7 @@ static git_object *rb_git_get_C_object(git_repository *repo, VALUE object_value,
if (error < 0)
rb_raise(rb_eRuntimeError, git_strerror(error));
- } else if (rb_obj_is_kind_of(object_value, rb_cRibbitObject)) {
+ } else if (rb_obj_is_kind_of(object_value, rb_cRuggedObject)) {
Data_Get_Struct(object_value, git_object, object);
if (type != GIT_OBJ_ANY && git_object_type(object) != type)
@@ -266,20 +266,20 @@ static VALUE rb_git_createobject(git_object *object)
switch (type)
{
case GIT_OBJ_COMMIT:
- klass = rb_cRibbitCommit;
+ klass = rb_cRuggedCommit;
break;
case GIT_OBJ_TAG:
- klass = rb_cRibbitTag;
+ klass = rb_cRuggedTag;
break;
case GIT_OBJ_TREE:
- klass = rb_cRibbitTree;
+ klass = rb_cRuggedTree;
break;
case GIT_OBJ_BLOB:
default:
- klass = rb_cRibbitObject;
+ klass = rb_cRuggedObject;
break;
}
@@ -300,7 +300,7 @@ static VALUE rb_git_object_equal(VALUE self, VALUE other)
{
git_object *a, *b;
- if (!rb_obj_is_kind_of(other, rb_cRibbitObject))
+ if (!rb_obj_is_kind_of(other, rb_cRuggedObject))
return Qfalse;
Data_Get_Struct(self, git_object, a);
@@ -385,7 +385,7 @@ static VALUE rb_git_object_write(VALUE self)
}
/*
- * Ribbit Commit
+ * Rugged Commit
*/
static VALUE rb_git_commit_allocate(VALUE klass)
{
@@ -513,7 +513,7 @@ static VALUE rb_git_commit_tree_SET(VALUE self, VALUE val)
/*
- * Ribbit Tag
+ * Rugged Tag
*/
static VALUE rb_git_tag_allocate(VALUE klass)
{
@@ -614,7 +614,7 @@ static VALUE rb_git_tag_message_SET(VALUE self, VALUE val)
/*
- * Ribbit Tree
+ * Rugged Tree
*/
static VALUE rb_git_treeentry_allocate(VALUE klass)
{
@@ -634,7 +634,7 @@ static VALUE rb_git_createentry(git_tree_entry *entry)
if (entry == NULL)
return Qnil;
- obj = Data_Wrap_Struct(rb_cRibbitTreeEntry, NULL, NULL, entry);
+ obj = Data_Wrap_Struct(rb_cRuggedTreeEntry, NULL, NULL, entry);
/* TODO: attributes? */
return obj;
@@ -716,7 +716,7 @@ static VALUE rb_git_tree_entry_2object(VALUE self)
/*
- * Ribbit Tree
+ * Rugged Tree
*/
static VALUE rb_git_tree_allocate(VALUE klass)
{
@@ -754,7 +754,7 @@ static VALUE rb_git_tree_get_entry(VALUE self, VALUE entry_id)
/*
- * Ribbit Revwalking
+ * Rugged Revwalking
*/
static VALUE rb_git_walker_allocate(VALUE klass)
@@ -892,7 +892,7 @@ static VALUE rb_git_indexentry_new(git_index_entry *entry)
if (entry == NULL)
return Qnil;
- return Data_Wrap_Struct(rb_cRibbitIndexEntry, NULL, NULL, entry);
+ return Data_Wrap_Struct(rb_cRuggedIndexEntry, NULL, NULL, entry);
}
static VALUE rb_git_index_get_entry_count(VALUE self)
@@ -940,7 +940,7 @@ static VALUE rb_git_index_add(VALUE self, VALUE rb_entry)
Data_Get_Struct(self, git_index, index);
- if (rb_obj_is_kind_of(rb_entry, rb_cRibbitIndexEntry)) {
+ if (rb_obj_is_kind_of(rb_entry, rb_cRuggedIndexEntry)) {
Data_Get_Struct(rb_entry, git_index_entry, entry);
error = git_index_insert(index, entry);
} else if (TYPE(rb_entry) == T_STRING) {
@@ -1088,207 +1088,207 @@ static VALUE rb_git_indexentry_ctime_SET(VALUE self, VALUE v)
}
/*
- * Ribbit Init Call
+ * Rugged Init Call
*/
-void Init_ribbit()
+void Init_rugged()
{
- rb_cRibbit = rb_define_class("Ribbit", rb_cObject);
- rb_cRibbitLib = rb_define_class_under(rb_cRibbit, "Lib", rb_cObject);
+ rb_cRugged = rb_define_class("Rugged", rb_cObject);
+ rb_cRuggedLib = rb_define_class_under(rb_cRugged, "Lib", rb_cObject);
- rb_define_module_function(rb_cRibbitLib, "hex_to_raw", rb_git_hex_to_raw, 1);
- rb_define_module_function(rb_cRibbitLib, "raw_to_hex", rb_git_raw_to_hex, 1);
- rb_define_module_function(rb_cRibbitLib, "type_to_string", rb_git_type_to_string, 1);
- rb_define_module_function(rb_cRibbitLib, "string_to_type", rb_git_string_to_type, 1);
+ rb_define_module_function(rb_cRuggedLib, "hex_to_raw", rb_git_hex_to_raw, 1);
+ rb_define_module_function(rb_cRuggedLib, "raw_to_hex", rb_git_raw_to_hex, 1);
+ rb_define_module_function(rb_cRuggedLib, "type_to_string", rb_git_type_to_string, 1);
+ rb_define_module_function(rb_cRuggedLib, "string_to_type", rb_git_string_to_type, 1);
/*
* Repository
*/
- rb_cRibbitRepo = rb_define_class_under(rb_cRibbit, "Repository", rb_cObject);
- rb_define_alloc_func(rb_cRibbitRepo, rb_git_repo_allocate);
- rb_define_method(rb_cRibbitRepo, "initialize", rb_git_repo_init, 1);
- rb_define_method(rb_cRibbitRepo, "exists", rb_git_repo_exists, 1);
- rb_define_method(rb_cRibbitRepo, "hash", rb_git_repo_obj_hash, 2);
- rb_define_method(rb_cRibbitRepo, "read", rb_git_repo_read, 1);
- rb_define_method(rb_cRibbitRepo, "write", rb_git_repo_write, 2);
- rb_define_method(rb_cRibbitRepo, "lookup", rb_git_repo_lookup, -1);
- rb_define_method(rb_cRibbitRepo, "index", rb_git_repo_index, 0);
+ rb_cRuggedRepo = rb_define_class_under(rb_cRugged, "Repository", rb_cObject);
+ rb_define_alloc_func(rb_cRuggedRepo, rb_git_repo_allocate);
+ rb_define_method(rb_cRuggedRepo, "initialize", rb_git_repo_init, 1);
+ rb_define_method(rb_cRuggedRepo, "exists", rb_git_repo_exists, 1);
+ rb_define_method(rb_cRuggedRepo, "hash", rb_git_repo_obj_hash, 2);
+ rb_define_method(rb_cRuggedRepo, "read", rb_git_repo_read, 1);
+ rb_define_method(rb_cRuggedRepo, "write", rb_git_repo_write, 2);
+ rb_define_method(rb_cRuggedRepo, "lookup", rb_git_repo_lookup, -1);
+ rb_define_method(rb_cRuggedRepo, "index", rb_git_repo_index, 0);
/*
* Object
*/
- rb_cRibbitObject = rb_define_class_under(rb_cRibbit, "Object", rb_cObject);
- rb_define_alloc_func(rb_cRibbitObject, rb_git_object_allocate);
- rb_define_method(rb_cRibbitObject, "read_raw", rb_git_object_read_raw, 0);
- rb_define_method(rb_cRibbitObject, "write", rb_git_object_write, 0);
- rb_define_method(rb_cRibbitObject, "==", rb_git_object_equal, 1);
- rb_define_method(rb_cRibbitObject, "sha", rb_git_object_sha_GET, 0);
- rb_define_method(rb_cRibbitObject, "type", rb_git_object_type_GET, 0);
+ rb_cRuggedObject = rb_define_class_under(rb_cRugged, "Object", rb_cObject);
+ rb_define_alloc_func(rb_cRuggedObject, rb_git_object_allocate);
+ rb_define_method(rb_cRuggedObject, "read_raw", rb_git_object_read_raw, 0);
+ rb_define_method(rb_cRuggedObject, "write", rb_git_object_write, 0);
+ rb_define_method(rb_cRuggedObject, "==", rb_git_object_equal, 1);
+ rb_define_method(rb_cRuggedObject, "sha", rb_git_object_sha_GET, 0);
+ rb_define_method(rb_cRuggedObject, "type", rb_git_object_type_GET, 0);
/*
* Commit
*/
- rb_cRibbitCommit = rb_define_class_under(rb_cRibbit, "Commit", rb_cRibbitObject);
- rb_define_alloc_func(rb_cRibbitCommit, rb_git_commit_allocate);
- rb_define_method(rb_cRibbitCommit, "initialize", rb_git_commit_init, -1);
+ rb_cRuggedCommit = rb_define_class_under(rb_cRugged, "Commit", rb_cRuggedObject);
+ rb_define_alloc_func(rb_cRuggedCommit, rb_git_commit_allocate);
+ rb_define_method(rb_cRuggedCommit, "initialize", rb_git_commit_init, -1);
- rb_define_method(rb_cRibbitCommit, "message", rb_git_commit_message_GET, 0);
- rb_define_method(rb_cRibbitCommit, "message=", rb_git_commit_message_SET, 1);
+ rb_define_method(rb_cRuggedCommit, "message", rb_git_commit_message_GET, 0);
+ rb_define_method(rb_cRuggedCommit, "message=", rb_git_commit_message_SET, 1);
/* Read only */
- rb_define_method(rb_cRibbitCommit, "message_short", rb_git_commit_message_short_GET, 0);
+ rb_define_method(rb_cRuggedCommit, "message_short", rb_git_commit_message_short_GET, 0);
/* Read only */
- rb_define_method(rb_cRibbitCommit, "time", rb_git_commit_time_GET, 0); /* READ ONLY */
+ rb_define_method(rb_cRuggedCommit, "time", rb_git_commit_time_GET, 0); /* READ ONLY */
- rb_define_method(rb_cRibbitCommit, "committer", rb_git_commit_committer_GET, 0);
- rb_define_method(rb_cRibbitCommit, "committer=", rb_git_commit_committer_SET, 3);
+ rb_define_method(rb_cRuggedCommit, "committer", rb_git_commit_committer_GET, 0);
+ rb_define_method(rb_cRuggedCommit, "committer=", rb_git_commit_committer_SET, 3);
- rb_define_method(rb_cRibbitCommit, "author", rb_git_commit_author_GET, 0);
- rb_define_method(rb_cRibbitCommit, "author=", rb_git_commit_author_SET, 3);
+ rb_define_method(rb_cRuggedCommit, "author", rb_git_commit_author_GET, 0);
+ rb_define_method(rb_cRuggedCommit, "author=", rb_git_commit_author_SET, 3);
- rb_define_method(rb_cRibbitCommit, "tree", rb_git_commit_tree_GET, 0);
- rb_define_method(rb_cRibbitCommit, "tree=", rb_git_commit_tree_SET, 1);
+ rb_define_method(rb_cRuggedCommit, "tree", rb_git_commit_tree_GET, 0);
+ rb_define_method(rb_cRuggedCommit, "tree=", rb_git_commit_tree_SET, 1);
/*
* Tag
*/
- rb_cRibbitTag = rb_define_class_under(rb_cRibbit, "Tag", rb_cRibbitObject);
- rb_define_alloc_func(rb_cRibbitTag, rb_git_tag_allocate);
- rb_define_method(rb_cRibbitTag, "initialize", rb_git_tag_init, -1);
+ rb_cRuggedTag = rb_define_class_under(rb_cRugged, "Tag", rb_cRuggedObject);
+ rb_define_alloc_func(rb_cRuggedTag, rb_git_tag_allocate);
+ rb_define_method(rb_cRuggedTag, "initialize", rb_git_tag_init, -1);
- rb_define_method(rb_cRibbitTag, "message", rb_git_tag_message_GET, 0);
- rb_define_method(rb_cRibbitTag, "message=", rb_git_tag_message_SET, 1);
+ rb_define_method(rb_cRuggedTag, "message", rb_git_tag_message_GET, 0);
+ rb_define_method(rb_cRuggedTag, "message=", rb_git_tag_message_SET, 1);
- rb_define_method(rb_cRibbitTag, "name", rb_git_tag_name_GET, 0);
- rb_define_method(rb_cRibbitTag, "name=", rb_git_tag_name_SET, 1);
+ rb_define_method(rb_cRuggedTag, "name", rb_git_tag_name_GET, 0);
+ rb_define_method(rb_cRuggedTag, "name=", rb_git_tag_name_SET, 1);
- rb_define_method(rb_cRibbitTag, "target", rb_git_tag_target_GET, 0);
- rb_define_method(rb_cRibbitTag, "target=", rb_git_tag_target_SET, 1);
+ rb_define_method(rb_cRuggedTag, "target", rb_git_tag_target_GET, 0);
+ rb_define_method(rb_cRuggedTag, "target=", rb_git_tag_target_SET, 1);
/* Read only */
- rb_define_method(rb_cRibbitTag, "target_type", rb_git_tag_target_type_GET, 0);
+ rb_define_method(rb_cRuggedTag, "target_type", rb_git_tag_target_type_GET, 0);
- rb_define_method(rb_cRibbitTag, "tagger", rb_git_tag_tagger_GET, 0);
- rb_define_method(rb_cRibbitTag, "tagger=", rb_git_tag_tagger_SET, 3);
+ rb_define_method(rb_cRuggedTag, "tagger", rb_git_tag_tagger_GET, 0);
+ rb_define_method(rb_cRuggedTag, "tagger=", rb_git_tag_tagger_SET, 3);
/*
* Tree entry
*/
- rb_cRibbitTreeEntry = rb_define_class_under(rb_cRibbit, "TreeEntry", rb_cObject);
- rb_define_alloc_func(rb_cRibbitTreeEntry, rb_git_treeentry_allocate);
- // rb_define_method(rb_cRibbitTreeEntry, "initialize", rb_git_treeentry_allocate, -1);
- rb_define_method(rb_cRibbitTreeEntry, "to_object", rb_git_tree_entry_2object, 0);
+ rb_cRuggedTreeEntry = rb_define_class_under(rb_cRugged, "TreeEntry", rb_cObject);
+ rb_define_alloc_func(rb_cRuggedTreeEntry, rb_git_treeentry_allocate);
+ // rb_define_method(rb_cRuggedTreeEntry, "initialize", rb_git_treeentry_allocate, -1);
+ rb_define_method(rb_cRuggedTreeEntry, "to_object", rb_git_tree_entry_2object, 0);
- rb_define_method(rb_cRibbitTreeEntry, "name", rb_git_tree_entry_name_GET, 0);
- rb_define_method(rb_cRibbitTreeEntry, "name=", rb_git_tree_entry_name_SET, 1);
+ rb_define_method(rb_cRuggedTreeEntry, "name", rb_git_tree_entry_name_GET, 0);
+ rb_define_method(rb_cRuggedTreeEntry, "name=", rb_git_tree_entry_name_SET, 1);
- rb_define_method(rb_cRibbitTreeEntry, "attributes", rb_git_tree_entry_attributes_GET, 0);
- rb_define_method(rb_cRibbitTreeEntry, "attributes=", rb_git_tree_entry_attributes_SET, 1);
+ rb_define_method(rb_cRuggedTreeEntry, "attributes", rb_git_tree_entry_attributes_GET, 0);
+ rb_define_method(rb_cRuggedTreeEntry, "attributes=", rb_git_tree_entry_attributes_SET, 1);
- rb_define_method(rb_cRibbitTreeEntry, "sha", rb_git_tree_entry_sha_GET, 0);
- rb_define_method(rb_cRibbitTreeEntry, "sha=", rb_git_tree_entry_sha_SET, 1);
+ rb_define_method(rb_cRuggedTreeEntry, "sha", rb_git_tree_entry_sha_GET, 0);
+ rb_define_method(rb_cRuggedTreeEntry, "sha=", rb_git_tree_entry_sha_SET, 1);
/*
* Tree
*/
- rb_cRibbitTree = rb_define_class_under(rb_cRibbit, "Tree", rb_cRibbitObject);
- rb_define_alloc_func(rb_cRibbitTree, rb_git_tree_allocate);
- rb_define_method(rb_cRibbitTree, "initialize", rb_git_tree_init, -1);
- rb_define_method(rb_cRibbitTree, "entry_count", rb_git_tree_entrycount, 0);
- rb_define_method(rb_cRibbitTree, "get_entry", rb_git_tree_get_entry, 1);
- rb_define_method(rb_cRibbitTree, "[]", rb_git_tree_get_entry, 1);
+ rb_cRuggedTree = rb_define_class_under(rb_cRugged, "Tree", rb_cRuggedObject);
+ rb_define_alloc_func(rb_cRuggedTree, rb_git_tree_allocate);
+ rb_define_method(rb_cRuggedTree, "initialize", rb_git_tree_init, -1);
+ rb_define_method(rb_cRuggedTree, "entry_count", rb_git_tree_entrycount, 0);
+ rb_define_method(rb_cRuggedTree, "get_entry", rb_git_tree_get_entry, 1);
+ rb_define_method(rb_cRuggedTree, "[]", rb_git_tree_get_entry, 1);
/*
* Walker
*/
- rb_cRibbitWalker = rb_define_class_under(rb_cRibbit, "Walker", rb_cObject);
- rb_define_alloc_func(rb_cRibbitWalker, rb_git_walker_allocate);
- rb_define_method(rb_cRibbitWalker, "initialize", rb_git_walker_init, 1);
- rb_define_method(rb_cRibbitWalker, "push", rb_git_walker_push, 1);
- rb_define_method(rb_cRibbitWalker, "next", rb_git_walker_next, 0);
- rb_define_method(rb_cRibbitWalker, "hide", rb_git_walker_hide, 1);
- rb_define_method(rb_cRibbitWalker, "reset", rb_git_walker_reset, 0);
- rb_define_method(rb_cRibbitWalker, "sorting", rb_git_walker_sorting, 1);
+ rb_cRuggedWalker = rb_define_class_under(rb_cRugged, "Walker", rb_cObject);
+ rb_define_alloc_func(rb_cRuggedWalker, rb_git_walker_allocate);
+ rb_define_method(rb_cRuggedWalker, "initialize", rb_git_walker_init, 1);
+ rb_define_method(rb_cRuggedWalker, "push", rb_git_walker_push, 1);
+ rb_define_method(rb_cRuggedWalker, "next", rb_git_walker_next, 0);
+ rb_define_method(rb_cRuggedWalker, "hide", rb_git_walker_hide, 1);
+ rb_define_method(rb_cRuggedWalker, "reset", rb_git_walker_reset, 0);
+ rb_define_method(rb_cRuggedWalker, "sorting", rb_git_walker_sorting, 1);
/*
* Index
*/
- rb_cRibbitIndex = rb_define_class_under(rb_cRibbit, "Index", rb_cObject);
- rb_define_alloc_func(rb_cRibbitIndex, rb_git_index_allocate);
- rb_define_method(rb_cRibbitIndex, "initialize", rb_git_index_init, 1);
- rb_define_method(rb_cRibbitIndex, "entry_count", rb_git_index_get_entry_count, 0);
- rb_define_method(rb_cRibbitIndex, "refresh", rb_git_index_read, 0);
- rb_define_method(rb_cRibbitIndex, "clear", rb_git_index_clear, 0);
- rb_define_method(rb_cRibbitIndex, "write", rb_git_index_write, 0);
- rb_define_method(rb_cRibbitIndex, "get_entry", rb_git_index_get, 1);
- rb_define_method(rb_cRibbitIndex, "[]", rb_git_index_get, 1);
- rb_define_method(rb_cRibbitIndex, "add", rb_git_index_add, 1);
- rb_define_method(rb_cRibbitIndex, "remove", rb_git_index_remove, 1);
+ rb_cRuggedIndex = rb_define_class_under(rb_cRugged, "Index", rb_cObject);
+ rb_define_alloc_func(rb_cRuggedIndex, rb_git_index_allocate);
+ rb_define_method(rb_cRuggedIndex, "initialize", rb_git_index_init, 1);
+ rb_define_method(rb_cRuggedIndex, "entry_count", rb_git_index_get_entry_count, 0);
+ rb_define_method(rb_cRuggedIndex, "refresh", rb_git_index_read, 0);
+ rb_define_method(rb_cRuggedIndex, "clear", rb_git_index_clear, 0);
+ rb_define_method(rb_cRuggedIndex, "write", rb_git_index_write, 0);
+ rb_define_method(rb_cRuggedIndex, "get_entry", rb_git_index_get, 1);
+ rb_define_method(rb_cRuggedIndex, "[]", rb_git_index_get, 1);
+ rb_define_method(rb_cRuggedIndex, "add", rb_git_index_add, 1);
+ rb_define_method(rb_cRuggedIndex, "remove", rb_git_index_remove, 1);
/*
* Index Entry
*/
- rb_cRibbitIndexEntry = rb_define_class_under(rb_cRibbit, "IndexEntry", rb_cObject);
- rb_define_alloc_func(rb_cRibbitIndexEntry, rb_git_indexentry_allocate);
- rb_define_method(rb_cRibbitIndexEntry, "initialize", rb_git_indexentry_init, 0);
+ rb_cRuggedIndexEntry = rb_define_class_under(rb_cRugged, "IndexEntry", rb_cObject);
+ rb_define_alloc_func(rb_cRuggedIndexEntry, rb_git_indexentry_allocate);
+ rb_define_method(rb_cRuggedIndexEntry, "initialize", rb_git_indexentry_init, 0);
- rb_define_method(rb_cRibbitIndexEntry, "path", rb_git_indexentry_path_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "path=", rb_git_indexentry_path_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "path", rb_git_indexentry_path_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "path=", rb_git_indexentry_path_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "sha", rb_git_indexentry_oid_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "sha=", rb_git_indexentry_oid_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "sha", rb_git_indexentry_oid_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "sha=", rb_git_indexentry_oid_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "mtime", rb_git_indexentry_mtime_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "mtime=", rb_git_indexentry_mtime_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "mtime", rb_git_indexentry_mtime_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "mtime=", rb_git_indexentry_mtime_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "ctime", rb_git_indexentry_ctime_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "ctime=", rb_git_indexentry_ctime_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "ctime", rb_git_indexentry_ctime_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "ctime=", rb_git_indexentry_ctime_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "dev", rb_git_indexentry_dev_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "dev=", rb_git_indexentry_dev_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "dev", rb_git_indexentry_dev_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "dev=", rb_git_indexentry_dev_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "ino", rb_git_indexentry_ino_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "ino=", rb_git_indexentry_ino_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "ino", rb_git_indexentry_ino_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "ino=", rb_git_indexentry_ino_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "mode", rb_git_indexentry_mode_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "mode=", rb_git_indexentry_mode_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "mode", rb_git_indexentry_mode_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "mode=", rb_git_indexentry_mode_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "uid", rb_git_indexentry_uid_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "uid=", rb_git_indexentry_uid_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "uid", rb_git_indexentry_uid_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "uid=", rb_git_indexentry_uid_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "gid", rb_git_indexentry_gid_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "gid=", rb_git_indexentry_gid_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "gid", rb_git_indexentry_gid_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "gid=", rb_git_indexentry_gid_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "file_size", rb_git_indexentry_file_size_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "file_size=", rb_git_indexentry_file_size_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "file_size", rb_git_indexentry_file_size_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "file_size=", rb_git_indexentry_file_size_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "flags", rb_git_indexentry_flags_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "flags=", rb_git_indexentry_flags_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "flags", rb_git_indexentry_flags_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "flags=", rb_git_indexentry_flags_SET, 1);
- rb_define_method(rb_cRibbitIndexEntry, "flags_extended", rb_git_indexentry_flags_extended_GET, 0);
- rb_define_method(rb_cRibbitIndexEntry, "flags_extended=", rb_git_indexentry_flags_extended_SET, 1);
+ rb_define_method(rb_cRuggedIndexEntry, "flags_extended", rb_git_indexentry_flags_extended_GET, 0);
+ rb_define_method(rb_cRuggedIndexEntry, "flags_extended=", rb_git_indexentry_flags_extended_SET, 1);
/*
* Constants
*/
- rb_define_const(rb_cRibbit, "SORT_NONE", INT2FIX(0));
- rb_define_const(rb_cRibbit, "SORT_TOPO", INT2FIX(1));
- rb_define_const(rb_cRibbit, "SORT_DATE", INT2FIX(2));
- rb_define_const(rb_cRibbit, "SORT_REVERSE", INT2FIX(4));
-
- rb_define_const(rb_cRibbit, "OBJ_ANY", INT2FIX(GIT_OBJ_ANY));
- rb_define_const(rb_cRibbit, "OBJ_BAD", INT2FIX(GIT_OBJ_BAD));
- rb_define_const(rb_cRibbit, "OBJ_COMMIT", INT2FIX(GIT_OBJ_COMMIT));
- rb_define_const(rb_cRibbit, "OBJ_TREE", INT2FIX(GIT_OBJ_TREE));
- rb_define_const(rb_cRibbit, "OBJ_BLOB", INT2FIX(GIT_OBJ_BLOB));
- rb_define_const(rb_cRibbit, "OBJ_TAG", INT2FIX(GIT_OBJ_TAG));
+ rb_define_const(rb_cRugged, "SORT_NONE", INT2FIX(0));
+ rb_define_const(rb_cRugged, "SORT_TOPO", INT2FIX(1));
+ rb_define_const(rb_cRugged, "SORT_DATE", INT2FIX(2));
+ rb_define_const(rb_cRugged, "SORT_REVERSE", INT2FIX(4));
+
+ rb_define_const(rb_cRugged, "OBJ_ANY", INT2FIX(GIT_OBJ_ANY));
+ rb_define_const(rb_cRugged, "OBJ_BAD", INT2FIX(GIT_OBJ_BAD));
+ rb_define_const(rb_cRugged, "OBJ_COMMIT", INT2FIX(GIT_OBJ_COMMIT));
+ rb_define_const(rb_cRugged, "OBJ_TREE", INT2FIX(GIT_OBJ_TREE));
+ rb_define_const(rb_cRugged, "OBJ_BLOB", INT2FIX(GIT_OBJ_BLOB));
+ rb_define_const(rb_cRugged, "OBJ_TAG", INT2FIX(GIT_OBJ_TAG));
}
View
5 lib/ribbit.rb
@@ -1,5 +0,0 @@
-require 'ribbit/ribbit'
-require 'ribbit/index'
-require 'ribbit/tree'
-require 'ribbit/tree_entry'
-require 'ribbit/version'
View
5 lib/rugged.rb
@@ -0,0 +1,5 @@
+require 'rugged/rugged'
+require 'rugged/index'
+require 'rugged/tree'
+require 'rugged/tree_entry'
+require 'rugged/version'
View
2  lib/ribbit/index.rb → lib/rugged/index.rb
@@ -1,4 +1,4 @@
-class Ribbit
+class Rugged
class Index
include Enumerable
View
2  lib/ribbit/tree.rb → lib/rugged/tree.rb
@@ -1,4 +1,4 @@
-class Ribbit
+class Rugged
class Tree
include Enumerable
View
2  lib/ribbit/tree_entry.rb → lib/rugged/tree_entry.rb
@@ -1,4 +1,4 @@
-class Ribbit
+class Rugged
class TreeEntry
def <=>(a)
View
2  lib/ribbit/version.rb → lib/rugged/version.rb
@@ -1,3 +1,3 @@
-class Ribbit
+class Rugged
Version = VERSION = '0.0.1'
end
View
16 ribbit.gemspec → rugged.gemspec
@@ -1,20 +1,20 @@
-require 'lib/ribbit/version'
+require 'lib/rugged/version'
Gem::Specification.new do |s|
- s.name = "ribbit"
- s.version = Ribbit::Version
+ s.name = "rugged"
+ s.version = Rugged::Version
s.date = Time.now.strftime('%Y-%m-%d')
- s.summary = "Ribbit is a Ruby binding to the libgit2 linkable library"
- s.homepage = "http://github.com/schacon/ribbit"
+ s.summary = "Rugged is a Ruby binding to the libgit2 linkable library"
+ s.homepage = "http://github.com/libgit2/rugged"
s.email = "schacon@gmail.com"
- s.authors = [ "Scott Chacon" ]
+ s.authors = [ "Scott Chacon", "Vicent Marti" ]
s.files = %w( README API Rakefile LICENSE )
s.files += Dir.glob("lib/**/*")
s.files += Dir.glob("man/**/*")
s.files += Dir.glob("test/**/*")
- s.extensions = ['ext/ribbit/extconf.rb']
+ s.extensions = ['ext/rugged/extconf.rb']
s.description = <<desc
-Ribbit is a Ruby bindings to the libgit2 linkable C Git library. This is
+Rugged is a Ruby bindings to the libgit2 linkable C Git library. This is
for testing and using the libgit2 library in a language that is awesome.
desc
end
View
4 test/commit_test.rb
@@ -1,9 +1,9 @@
require File.dirname(__FILE__) + '/test_helper'
-context "Ribbit::Commit tests" do
+context "Rugged::Commit tests" do
setup do
path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Ribbit::Repository.new(path)
+ @repo = Rugged::Repository.new(path)
end
test "can read the commit data" do
View
18 test/index_test.rb
@@ -5,7 +5,7 @@
def new_index_entry
now = Time.now
- e = Ribbit::IndexEntry.new
+ e = Rugged::IndexEntry.new
e.path = "new_path"
e.sha = "d385f264afb75a56a5bec74243be9b367ba4ca08"
e.mtime = now
@@ -21,10 +21,10 @@ def new_index_entry
e
end
-context "Ribbit::Index reading stuff" do
+context "Rugged::Index reading stuff" do
setup do
path = File.dirname(__FILE__) + '/fixtures/testrepo.git/index'
- @index = Ribbit::Index.new(path)
+ @index = Rugged::Index.new(path)
@index.refresh
end
@@ -104,12 +104,12 @@ def new_index_entry
end
-context "Ribbit::Index writing stuff" do
+context "Rugged::Index writing stuff" do
setup do
path = File.dirname(__FILE__) + '/fixtures/testrepo.git/index'
@tmppath = Tempfile.new('index').path
FileUtils.copy(path, @tmppath)
- @index = Ribbit::Index.new(@tmppath)
+ @index = Rugged::Index.new(@tmppath)
@index.refresh
end
@@ -126,7 +126,7 @@ def new_index_entry
@index.add(e)
@index.write
- index2 = Ribbit::Index.new(@tmppath)
+ index2 = Rugged::Index.new(@tmppath)
index2.refresh
itr_test = index2.sort { |a, b| a.sha <=> b.sha }.map { |e| e.path }.join(':')
@@ -135,14 +135,14 @@ def new_index_entry
end
end
-context "Ribbit::Index with working directory" do
+context "Rugged::Index with working directory" do
setup do
@tmppath = Tempfile.new('index').path + '_dir'
FileUtils.mkdir(@tmppath)
Dir.chdir(@tmppath) do
`git init`
end
- @repo = Ribbit::Repository.new(@tmppath + '/.git')
+ @repo = Rugged::Repository.new(@tmppath + '/.git')
@index = @repo.index
end
@@ -153,7 +153,7 @@ def new_index_entry
@index.add('test.txt')
@index.write
- index2 = Ribbit::Index.new(@tmppath + '/.git/index')
+ index2 = Rugged::Index.new(@tmppath + '/.git/index')
index2.refresh
assert_equal index2.get_entry(0).path, 'test.txt'
View
12 test/lib_test.rb
@@ -1,32 +1,32 @@
require File.dirname(__FILE__) + '/test_helper'
require 'base64'
-context "Ribbit::Lib stuff" do
+context "Rugged::Lib stuff" do
setup do
end
test "can convert hex into raw sha" do
- raw = Ribbit::Lib.hex_to_raw("ce08fe4884650f067bd5703b6a59a8b3b3c99a09")
+ raw = Rugged::Lib.hex_to_raw("ce08fe4884650f067bd5703b6a59a8b3b3c99a09")
b64raw = Base64.encode64(raw).strip
assert_equal "zgj+SIRlDwZ71XA7almos7PJmgk=", b64raw
end
test "converts hex into raw sha correctly" do
hex = "ce08fe4884650f067bd5703b6a59a8b3b3c99a09"
- raw1 = Ribbit::Lib.hex_to_raw(hex)
+ raw1 = Rugged::Lib.hex_to_raw(hex)
raw2 = [hex].pack("H*")
assert_equal raw1, raw2
end
test "can convert raw sha into hex" do
raw = Base64.decode64("FqASNFZ4mrze9Ld1ITwjqL109eA=")
- hex = Ribbit::Lib.raw_to_hex(raw)
+ hex = Rugged::Lib.raw_to_hex(raw)
assert_equal "16a0123456789abcdef4b775213c23a8bd74f5e0", hex
end
test "converts raw into hex sha correctly" do
- raw = Ribbit::Lib.hex_to_raw("ce08fe4884650f067bd5703b6a59a8b3b3c99a09")
- hex1 = Ribbit::Lib.raw_to_hex(raw)
+ raw = Rugged::Lib.hex_to_raw("ce08fe4884650f067bd5703b6a59a8b3b3c99a09")
+ hex1 = Rugged::Lib.raw_to_hex(raw)
hex2 = raw.unpack("H*")[0]
assert_equal hex1, hex2
end
View
4 test/object_test.rb
@@ -1,10 +1,10 @@
require File.dirname(__FILE__) + '/test_helper'
require 'base64'
-context "Ribbit::Object stuff" do
+context "Rugged::Object stuff" do
setup do
@path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Ribbit::Repository.new(@path)
+ @repo = Rugged::Repository.new(@path)
end
test "cannot lookup a non-existant object" do
View
4 test/repo_pack_test.rb
@@ -1,10 +1,10 @@
require File.dirname(__FILE__) + '/test_helper'
require 'base64'
-context "Ribbit::Repository packed stuff" do
+context "Rugged::Repository packed stuff" do
setup do
path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Ribbit::Repository.new(path)
+ @repo = Rugged::Repository.new(path)
end
test "can tell if a packed object exists" do
View
4 test/repo_test.rb
@@ -1,10 +1,10 @@
require File.dirname(__FILE__) + '/test_helper'
require 'base64'
-context "Ribbit::Repository stuff" do
+context "Rugged::Repository stuff" do
setup do
@path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Ribbit::Repository.new(@path)
+ @repo = Rugged::Repository.new(@path)
end
test "can tell if an object exists or not" do
View
4 test/tag_test.rb
@@ -1,9 +1,9 @@
require File.dirname(__FILE__) + '/test_helper'
-context "Ribbit::Tag tests" do
+context "Rugged::Tag tests" do
setup do
@path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Ribbit::Repository.new(@path)
+ @repo = Rugged::Repository.new(@path)
end
test "can read the tag data" do
View
2  test/test_helper.rb
@@ -3,7 +3,7 @@
$TESTING = true
require 'test/unit'
require 'rubygems'
-require 'ribbit'
+require 'rugged'
require 'pp'
##
View
4 test/tree_test.rb
@@ -1,9 +1,9 @@
require File.dirname(__FILE__) + '/test_helper'
-context "Ribbit::Tree tests" do
+context "Rugged::Tree tests" do
setup do
path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Ribbit::Repository.new(path)
+ @repo = Rugged::Repository.new(path)
@sha = "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"
@tree = @repo.lookup(@sha)
end
View
14 test/walker_test.rb
@@ -1,11 +1,11 @@
require File.dirname(__FILE__) + '/test_helper'
require 'base64'
-context "Ribbit::Walker stuff" do
+context "Rugged::Walker stuff" do
setup do
@path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Ribbit::Repository.new(@path)
- @walker = Ribbit::Walker.new(@repo)
+ @repo = Rugged::Repository.new(@path)
+ @walker = Rugged::Walker.new(@repo)
end
test "can walk a simple revlist" do
@@ -57,22 +57,22 @@ def revlist_with_sorting(sorting)
end
test "can sort order by date" do
- time = revlist_with_sorting(Ribbit::SORT_DATE)
+ time = revlist_with_sorting(Rugged::SORT_DATE)
assert_equal "a4a7d.c4780.9fd73.4a202.5b5b0.84960", time
end
test "can sort order by topo" do
- topo = revlist_with_sorting(Ribbit::SORT_TOPO)
+ topo = revlist_with_sorting(Rugged::SORT_TOPO)
assert_equal "a4a7d.c4780.9fd73.4a202.5b5b0.84960", topo
end
test "can sort order by date reversed" do
- time = revlist_with_sorting(Ribbit::SORT_DATE | Ribbit::SORT_REVERSE)
+ time = revlist_with_sorting(Rugged::SORT_DATE | Rugged::SORT_REVERSE)
assert_equal "84960.5b5b0.4a202.9fd73.c4780.a4a7d", time
end
test "can sort order by topo reversed" do
- topo_rev = revlist_with_sorting(Ribbit::SORT_TOPO | Ribbit::SORT_REVERSE)
+ topo_rev = revlist_with_sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE)
assert_equal "84960.5b5b0.4a202.9fd73.c4780.a4a7d", topo_rev
end
Please sign in to comment.
Something went wrong with that request. Please try again.