libgit2/rugged — pull request #140 by nvloff (2012-12-16 15:35:36+00:00)
Title: Notes v2.0

An updated version of #118 with the suggested API changes from @vmg

* Rebased on latest development - migration to MiniTest::Unit:TestCase, license date bump
* default_ref returns String instead of Rugged::Reference, since the reference may be missing
* fixed several bugs related to missing note reference on note lookup and removal
* updated the each callback to libgit2's new API

Also the rdocs for the notes are practically useless, rdoc doesn't handle this kind of method definitions in C extensions and can't find the added methods or the docs.

```
repo.default_notes_ref #=> "refs/notes/commits"
```
```
obj.remove_notes(
:author => author,
:committer => author,
:ref => 'refs/notes/builds'
)
```
```
obj.create_notes(
:author => author,
:committer => author,
:message => "Hello world\n\n",
:ref => 'refs/notes/builds'
)
```

```
repo.each_note do { |note_blob, annotated_object| block }
```

```
obj.notes #=> {:message=>"note text\n", :oid=>"94eca2de348d5f672faf56b0decafa5937e3235e"}
````