Permalink
Browse files

renamed everything to Rugged from Ribbit

  • Loading branch information...
1 parent 5a977b9 commit b6eac62956c82115ba3a4b5af3e5b0b3285afa5c @schacon schacon committed Nov 17, 2010
View
@@ -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,51 +102,55 @@ 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
prsn = gobtg.tagger
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
gobj = ent.to_object
// * 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
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,20 +188,22 @@ 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)
list.pack
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,39 +212,54 @@ 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)
bool = rem.delete
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
@@ -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
@@ -1,4 +1,4 @@
-## Ribbit TODO ##
+## Rugged TODO ##
* get basic object stuff working again
* commit parsing
View
@@ -1,13 +1,13 @@
#
-# Some example proposed usages of Ribbit
+# Some example proposed usages of Rugged
# so we can make sure the API design is OK
#
#
# 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])
@@ -1,9 +1,9 @@
require 'mkmf'
-dir_config("ribbit")
+dir_config("rugged")
have_library("git2")
have_library('z')
-create_makefile("ribbit")
+create_makefile("rugged")
Oops, something went wrong.

0 comments on commit b6eac62

Please sign in to comment.