From: cedlemo <nu...@co...> - 2017-12-06 13:57:31
|
cedlemo 2017-12-06 22:56:59 +0900 (Wed, 06 Dec 2017) New Revision: faec3e7956a461163e50f1be322ab565a8eaa63d https://github.com/ruby-gnome2/ggit/commit/faec3e7956a461163e50f1be322ab565a8eaa63d Message: Improve README Modified files: README.md Modified: README.md (+33 -2) =================================================================== --- README.md 2017-12-06 22:35:23 +0900 (b498eaf) +++ README.md 2017-12-06 22:56:59 +0900 (1ce0475) @@ -3,7 +3,8 @@ Ruby loader for [libgit2-glib](https://git.gnome.org/browse/libgit2-glib) based on the ruby gobject-introspection gem from the [ruby-GNOME2](https://github.com/ruby-gnome2/ruby-gnome2) project. -Documentation for libgit2-glib can be found [here](https://developer.gnome.org/libgit2-glib/). +Documentation for libgit2-glib can be found [here](https://developer.gnome.org/libgit2-glib/) and +documentation for libgit2 can be found [here](https://libgit2.github.com/libgit2/#HEAD). ## Requirements @@ -11,9 +12,39 @@ Documentation for libgit2-glib can be found [here](https://developer.gnome.org/l * [GObject Introspection](http://live.gnome.org/GObjectIntrospection) * [libgit2-glib](https://git.gnome.org/browse/libgit2-glib) +## Examples +From https://libgit2.github.com/docs/guides/101-samples/ + +### Using the library + +```ruby +require "ggit" +``` + +### Repositories + +#### Init + +```ruby +# initialize with working directory (create and fill .git/) +dir = Gio::File.open(:path => "#{@path}/non_bare_repo/test") +Ggit::Repository.init_repository(dir, false) +# bare +dir = Gio::File.open(:path => "#{@path}/bare_repo/test/.git") +repo = Ggit::Repository.init_repository(dir, true) +``` + +### Clone + +```ruby +url = "https://github.com/ruby-gnome2/ggit.git" +destination = Gio::File.open(:path => "#{@path}/ggit-clone") +Ggit::Repository.clone(url, destination) +``` + ## License -Copyright (c) 2016 Ruby-GNOME2 Project Team +Copyright (c) 2016-2017 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. |