From 646304a6e7c3b2c442a0a7db995629e7009c3a14 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Sun, 11 Nov 2007 17:59:18 -0800 Subject: [PATCH] added documentation and a license file --- EXAMPLES | 262 ++--- LICENSE | 21 + README | 72 +- Rakefile | 7 +- TODO | 30 + doc/classes/Git.html | 284 +++++ doc/classes/Git.src/M000001.html | 18 + doc/classes/Git.src/M000002.html | 18 + doc/classes/Git.src/M000003.html | 18 + doc/classes/Git.src/M000004.html | 18 + doc/classes/Git/Base.html | 1180 ++++++++++++++++++++ doc/classes/Git/Base.src/M000076.html | 18 + doc/classes/Git/Base.src/M000077.html | 21 + doc/classes/Git/Base.src/M000078.html | 30 + doc/classes/Git/Base.src/M000079.html | 19 + doc/classes/Git/Base.src/M000080.html | 25 + doc/classes/Git/Base.src/M000081.html | 18 + doc/classes/Git/Base.src/M000082.html | 18 + doc/classes/Git/Base.src/M000083.html | 18 + doc/classes/Git/Base.src/M000084.html | 20 + doc/classes/Git/Base.src/M000085.html | 22 + doc/classes/Git/Base.src/M000086.html | 27 + doc/classes/Git/Base.src/M000087.html | 18 + doc/classes/Git/Base.src/M000091.html | 18 + doc/classes/Git/Base.src/M000092.html | 18 + doc/classes/Git/Base.src/M000093.html | 18 + doc/classes/Git/Base.src/M000094.html | 18 + doc/classes/Git/Base.src/M000095.html | 18 + doc/classes/Git/Base.src/M000096.html | 18 + doc/classes/Git/Base.src/M000097.html | 18 + doc/classes/Git/Base.src/M000098.html | 18 + doc/classes/Git/Base.src/M000099.html | 18 + doc/classes/Git/Base.src/M000100.html | 18 + doc/classes/Git/Base.src/M000101.html | 18 + doc/classes/Git/Base.src/M000102.html | 19 + doc/classes/Git/Base.src/M000103.html | 18 + doc/classes/Git/Base.src/M000104.html | 19 + doc/classes/Git/Base.src/M000105.html | 18 + doc/classes/Git/Base.src/M000106.html | 18 + doc/classes/Git/Base.src/M000107.html | 18 + doc/classes/Git/Base.src/M000108.html | 19 + doc/classes/Git/Base.src/M000109.html | 18 + doc/classes/Git/Base.src/M000110.html | 22 + doc/classes/Git/Base.src/M000111.html | 18 + doc/classes/Git/Base.src/M000112.html | 18 + doc/classes/Git/Base.src/M000113.html | 19 + doc/classes/Git/Base.src/M000114.html | 18 + doc/classes/Git/Base.src/M000115.html | 18 + doc/classes/Git/Base.src/M000116.html | 18 + doc/classes/Git/Branch.html | 429 +++++++ doc/classes/Git/Branch.src/M000066.html | 28 + doc/classes/Git/Branch.src/M000067.html | 19 + doc/classes/Git/Branch.src/M000068.html | 19 + doc/classes/Git/Branch.src/M000069.html | 25 + doc/classes/Git/Branch.src/M000070.html | 18 + doc/classes/Git/Branch.src/M000071.html | 18 + doc/classes/Git/Branch.src/M000072.html | 18 + doc/classes/Git/Branch.src/M000073.html | 27 + doc/classes/Git/Branch.src/M000074.html | 18 + doc/classes/Git/Branch.src/M000075.html | 18 + doc/classes/Git/Branches.html | 294 +++++ doc/classes/Git/Branches.src/M000060.html | 24 + doc/classes/Git/Branches.src/M000061.html | 18 + doc/classes/Git/Branches.src/M000062.html | 18 + doc/classes/Git/Branches.src/M000063.html | 18 + doc/classes/Git/Branches.src/M000064.html | 20 + doc/classes/Git/Branches.src/M000065.html | 18 + doc/classes/Git/Diff.html | 419 +++++++ doc/classes/Git/Diff.src/M000134.html | 20 + doc/classes/Git/Diff.src/M000135.html | 19 + doc/classes/Git/Diff.src/M000136.html | 19 + doc/classes/Git/Diff.src/M000137.html | 19 + doc/classes/Git/Diff.src/M000138.html | 19 + doc/classes/Git/Diff.src/M000139.html | 19 + doc/classes/Git/Diff.src/M000140.html | 19 + doc/classes/Git/Diff.src/M000141.html | 19 + doc/classes/Git/Diff.src/M000143.html | 19 + doc/classes/Git/Diff.src/M000144.html | 21 + doc/classes/Git/Diff/DiffFile.html | 220 ++++ doc/classes/Git/Diff/DiffFile.src/M000145.html | 24 + doc/classes/Git/Diff/DiffFile.src/M000146.html | 22 + doc/classes/Git/GitExecuteError.html | 111 ++ doc/classes/Git/GitTagNameDoesNotExist.html | 111 ++ doc/classes/Git/Index.html | 113 ++ doc/classes/Git/Lib.html | 1158 +++++++++++++++++++ doc/classes/Git/Lib.src/M000024.html | 26 + doc/classes/Git/Lib.src/M000025.html | 18 + doc/classes/Git/Lib.src/M000026.html | 29 + doc/classes/Git/Lib.src/M000027.html | 25 + doc/classes/Git/Lib.src/M000028.html | 18 + doc/classes/Git/Lib.src/M000029.html | 18 + doc/classes/Git/Lib.src/M000030.html | 18 + doc/classes/Git/Lib.src/M000031.html | 18 + doc/classes/Git/Lib.src/M000032.html | 24 + doc/classes/Git/Lib.src/M000033.html | 18 + doc/classes/Git/Lib.src/M000034.html | 33 + doc/classes/Git/Lib.src/M000035.html | 23 + doc/classes/Git/Lib.src/M000036.html | 34 + doc/classes/Git/Lib.src/M000037.html | 25 + doc/classes/Git/Lib.src/M000038.html | 25 + doc/classes/Git/Lib.src/M000039.html | 24 + doc/classes/Git/Lib.src/M000040.html | 23 + doc/classes/Git/Lib.src/M000041.html | 18 + doc/classes/Git/Lib.src/M000042.html | 23 + doc/classes/Git/Lib.src/M000043.html | 18 + doc/classes/Git/Lib.src/M000044.html | 19 + doc/classes/Git/Lib.src/M000045.html | 24 + doc/classes/Git/Lib.src/M000046.html | 20 + doc/classes/Git/Lib.src/M000047.html | 21 + doc/classes/Git/Lib.src/M000048.html | 18 + doc/classes/Git/Lib.src/M000049.html | 18 + doc/classes/Git/Lib.src/M000050.html | 22 + doc/classes/Git/Lib.src/M000051.html | 21 + doc/classes/Git/Lib.src/M000052.html | 23 + doc/classes/Git/Lib.src/M000053.html | 18 + doc/classes/Git/Lib.src/M000054.html | 18 + doc/classes/Git/Lib.src/M000055.html | 18 + doc/classes/Git/Lib.src/M000056.html | 18 + doc/classes/Git/Lib.src/M000057.html | 18 + doc/classes/Git/Lib.src/M000058.html | 18 + doc/classes/Git/Lib.src/M000059.html | 18 + doc/classes/Git/Log.html | 373 +++++++ doc/classes/Git/Log.src/M000015.html | 20 + doc/classes/Git/Log.src/M000016.html | 20 + doc/classes/Git/Log.src/M000017.html | 20 + doc/classes/Git/Log.src/M000018.html | 20 + doc/classes/Git/Log.src/M000019.html | 20 + doc/classes/Git/Log.src/M000020.html | 18 + doc/classes/Git/Log.src/M000021.html | 19 + doc/classes/Git/Log.src/M000022.html | 21 + doc/classes/Git/Log.src/M000023.html | 19 + doc/classes/Git/Object.html | 179 +++ doc/classes/Git/Object.src/M000120.html | 35 + doc/classes/Git/Object/AbstractObject.html | 349 ++++++ .../Git/Object/AbstractObject.src/M000122.html | 21 + .../Git/Object/AbstractObject.src/M000123.html | 18 + .../Git/Object/AbstractObject.src/M000124.html | 18 + .../Git/Object/AbstractObject.src/M000125.html | 18 + .../Git/Object/AbstractObject.src/M000126.html | 18 + .../Git/Object/AbstractObject.src/M000127.html | 20 + .../Git/Object/AbstractObject.src/M000128.html | 18 + .../Git/Object/AbstractObject.src/M000129.html | 18 + doc/classes/Git/Object/Blob.html | 148 +++ doc/classes/Git/Object/Blob.src/M000132.html | 18 + doc/classes/Git/Object/Commit.html | 148 +++ doc/classes/Git/Object/Commit.src/M000121.html | 18 + doc/classes/Git/Object/Tag.html | 188 ++++ doc/classes/Git/Object/Tag.src/M000130.html | 19 + doc/classes/Git/Object/Tag.src/M000131.html | 18 + doc/classes/Git/Object/Tree.html | 148 +++ doc/classes/Git/Object/Tree.src/M000133.html | 18 + doc/classes/Git/Path.html | 215 ++++ doc/classes/Git/Path.src/M000117.html | 22 + doc/classes/Git/Path.src/M000118.html | 18 + doc/classes/Git/Path.src/M000119.html | 18 + doc/classes/Git/Remote.html | 324 ++++++ doc/classes/Git/Remote.src/M000147.html | 22 + doc/classes/Git/Remote.src/M000148.html | 18 + doc/classes/Git/Remote.src/M000149.html | 18 + doc/classes/Git/Remote.src/M000150.html | 18 + doc/classes/Git/Remote.src/M000151.html | 18 + doc/classes/Git/Remote.src/M000152.html | 18 + doc/classes/Git/Remote.src/M000153.html | 18 + doc/classes/Git/Repository.html | 113 ++ doc/classes/Git/Status.html | 348 ++++++ doc/classes/Git/Status.src/M000005.html | 19 + doc/classes/Git/Status.src/M000006.html | 18 + doc/classes/Git/Status.src/M000007.html | 18 + doc/classes/Git/Status.src/M000008.html | 18 + doc/classes/Git/Status.src/M000009.html | 18 + doc/classes/Git/Status.src/M000010.html | 29 + doc/classes/Git/Status.src/M000011.html | 18 + doc/classes/Git/Status.src/M000012.html | 20 + doc/classes/Git/Status/StatusFile.html | 232 ++++ doc/classes/Git/Status/StatusFile.src/M000013.html | 26 + doc/classes/Git/Status/StatusFile.src/M000014.html | 22 + doc/classes/Git/WorkingDirectory.html | 113 ++ doc/created.rid | 1 + doc/files/EXAMPLES.html | 268 +++++ doc/files/README.html | 119 ++ doc/files/lib/git/base_rb.html | 101 ++ doc/files/lib/git/branch_rb.html | 101 ++ doc/files/lib/git/branches_rb.html | 101 ++ doc/files/lib/git/diff_rb.html | 101 ++ doc/files/lib/git/index_rb.html | 101 ++ doc/files/lib/git/lib_rb.html | 101 ++ doc/files/lib/git/log_rb.html | 101 ++ doc/files/lib/git/object_rb.html | 101 ++ doc/files/lib/git/path_rb.html | 101 ++ doc/files/lib/git/remote_rb.html | 101 ++ doc/files/lib/git/repository_rb.html | 101 ++ doc/files/lib/git/status_rb.html | 101 ++ doc/files/lib/git/working_directory_rb.html | 101 ++ doc/files/lib/git_rb.html | 127 +++ doc/fr_class_index.html | 49 + doc/fr_file_index.html | 42 + doc/fr_method_index.html | 179 +++ doc/index.html | 24 + doc/rdoc-style.css | 208 ++++ lib/git/branch.rb | 4 + lib/git/lib.rb | 4 +- 201 files changed, 12718 insertions(+), 190 deletions(-) rewrite EXAMPLES (100%) create mode 100644 LICENSE rewrite README (66%) create mode 100644 doc/classes/Git.html create mode 100644 doc/classes/Git.src/M000001.html create mode 100644 doc/classes/Git.src/M000002.html create mode 100644 doc/classes/Git.src/M000003.html create mode 100644 doc/classes/Git.src/M000004.html create mode 100644 doc/classes/Git/Base.html create mode 100644 doc/classes/Git/Base.src/M000076.html create mode 100644 doc/classes/Git/Base.src/M000077.html create mode 100644 doc/classes/Git/Base.src/M000078.html create mode 100644 doc/classes/Git/Base.src/M000079.html create mode 100644 doc/classes/Git/Base.src/M000080.html create mode 100644 doc/classes/Git/Base.src/M000081.html create mode 100644 doc/classes/Git/Base.src/M000082.html create mode 100644 doc/classes/Git/Base.src/M000083.html create mode 100644 doc/classes/Git/Base.src/M000084.html create mode 100644 doc/classes/Git/Base.src/M000085.html create mode 100644 doc/classes/Git/Base.src/M000086.html create mode 100644 doc/classes/Git/Base.src/M000087.html create mode 100644 doc/classes/Git/Base.src/M000091.html create mode 100644 doc/classes/Git/Base.src/M000092.html create mode 100644 doc/classes/Git/Base.src/M000093.html create mode 100644 doc/classes/Git/Base.src/M000094.html create mode 100644 doc/classes/Git/Base.src/M000095.html create mode 100644 doc/classes/Git/Base.src/M000096.html create mode 100644 doc/classes/Git/Base.src/M000097.html create mode 100644 doc/classes/Git/Base.src/M000098.html create mode 100644 doc/classes/Git/Base.src/M000099.html create mode 100644 doc/classes/Git/Base.src/M000100.html create mode 100644 doc/classes/Git/Base.src/M000101.html create mode 100644 doc/classes/Git/Base.src/M000102.html create mode 100644 doc/classes/Git/Base.src/M000103.html create mode 100644 doc/classes/Git/Base.src/M000104.html create mode 100644 doc/classes/Git/Base.src/M000105.html create mode 100644 doc/classes/Git/Base.src/M000106.html create mode 100644 doc/classes/Git/Base.src/M000107.html create mode 100644 doc/classes/Git/Base.src/M000108.html create mode 100644 doc/classes/Git/Base.src/M000109.html create mode 100644 doc/classes/Git/Base.src/M000110.html create mode 100644 doc/classes/Git/Base.src/M000111.html create mode 100644 doc/classes/Git/Base.src/M000112.html create mode 100644 doc/classes/Git/Base.src/M000113.html create mode 100644 doc/classes/Git/Base.src/M000114.html create mode 100644 doc/classes/Git/Base.src/M000115.html create mode 100644 doc/classes/Git/Base.src/M000116.html create mode 100644 doc/classes/Git/Branch.html create mode 100644 doc/classes/Git/Branch.src/M000066.html create mode 100644 doc/classes/Git/Branch.src/M000067.html create mode 100644 doc/classes/Git/Branch.src/M000068.html create mode 100644 doc/classes/Git/Branch.src/M000069.html create mode 100644 doc/classes/Git/Branch.src/M000070.html create mode 100644 doc/classes/Git/Branch.src/M000071.html create mode 100644 doc/classes/Git/Branch.src/M000072.html create mode 100644 doc/classes/Git/Branch.src/M000073.html create mode 100644 doc/classes/Git/Branch.src/M000074.html create mode 100644 doc/classes/Git/Branch.src/M000075.html create mode 100644 doc/classes/Git/Branches.html create mode 100644 doc/classes/Git/Branches.src/M000060.html create mode 100644 doc/classes/Git/Branches.src/M000061.html create mode 100644 doc/classes/Git/Branches.src/M000062.html create mode 100644 doc/classes/Git/Branches.src/M000063.html create mode 100644 doc/classes/Git/Branches.src/M000064.html create mode 100644 doc/classes/Git/Branches.src/M000065.html create mode 100644 doc/classes/Git/Diff.html create mode 100644 doc/classes/Git/Diff.src/M000134.html create mode 100644 doc/classes/Git/Diff.src/M000135.html create mode 100644 doc/classes/Git/Diff.src/M000136.html create mode 100644 doc/classes/Git/Diff.src/M000137.html create mode 100644 doc/classes/Git/Diff.src/M000138.html create mode 100644 doc/classes/Git/Diff.src/M000139.html create mode 100644 doc/classes/Git/Diff.src/M000140.html create mode 100644 doc/classes/Git/Diff.src/M000141.html create mode 100644 doc/classes/Git/Diff.src/M000143.html create mode 100644 doc/classes/Git/Diff.src/M000144.html create mode 100644 doc/classes/Git/Diff/DiffFile.html create mode 100644 doc/classes/Git/Diff/DiffFile.src/M000145.html create mode 100644 doc/classes/Git/Diff/DiffFile.src/M000146.html create mode 100644 doc/classes/Git/GitExecuteError.html create mode 100644 doc/classes/Git/GitTagNameDoesNotExist.html create mode 100644 doc/classes/Git/Index.html create mode 100644 doc/classes/Git/Lib.html create mode 100644 doc/classes/Git/Lib.src/M000024.html create mode 100644 doc/classes/Git/Lib.src/M000025.html create mode 100644 doc/classes/Git/Lib.src/M000026.html create mode 100644 doc/classes/Git/Lib.src/M000027.html create mode 100644 doc/classes/Git/Lib.src/M000028.html create mode 100644 doc/classes/Git/Lib.src/M000029.html create mode 100644 doc/classes/Git/Lib.src/M000030.html create mode 100644 doc/classes/Git/Lib.src/M000031.html create mode 100644 doc/classes/Git/Lib.src/M000032.html create mode 100644 doc/classes/Git/Lib.src/M000033.html create mode 100644 doc/classes/Git/Lib.src/M000034.html create mode 100644 doc/classes/Git/Lib.src/M000035.html create mode 100644 doc/classes/Git/Lib.src/M000036.html create mode 100644 doc/classes/Git/Lib.src/M000037.html create mode 100644 doc/classes/Git/Lib.src/M000038.html create mode 100644 doc/classes/Git/Lib.src/M000039.html create mode 100644 doc/classes/Git/Lib.src/M000040.html create mode 100644 doc/classes/Git/Lib.src/M000041.html create mode 100644 doc/classes/Git/Lib.src/M000042.html create mode 100644 doc/classes/Git/Lib.src/M000043.html create mode 100644 doc/classes/Git/Lib.src/M000044.html create mode 100644 doc/classes/Git/Lib.src/M000045.html create mode 100644 doc/classes/Git/Lib.src/M000046.html create mode 100644 doc/classes/Git/Lib.src/M000047.html create mode 100644 doc/classes/Git/Lib.src/M000048.html create mode 100644 doc/classes/Git/Lib.src/M000049.html create mode 100644 doc/classes/Git/Lib.src/M000050.html create mode 100644 doc/classes/Git/Lib.src/M000051.html create mode 100644 doc/classes/Git/Lib.src/M000052.html create mode 100644 doc/classes/Git/Lib.src/M000053.html create mode 100644 doc/classes/Git/Lib.src/M000054.html create mode 100644 doc/classes/Git/Lib.src/M000055.html create mode 100644 doc/classes/Git/Lib.src/M000056.html create mode 100644 doc/classes/Git/Lib.src/M000057.html create mode 100644 doc/classes/Git/Lib.src/M000058.html create mode 100644 doc/classes/Git/Lib.src/M000059.html create mode 100644 doc/classes/Git/Log.html create mode 100644 doc/classes/Git/Log.src/M000015.html create mode 100644 doc/classes/Git/Log.src/M000016.html create mode 100644 doc/classes/Git/Log.src/M000017.html create mode 100644 doc/classes/Git/Log.src/M000018.html create mode 100644 doc/classes/Git/Log.src/M000019.html create mode 100644 doc/classes/Git/Log.src/M000020.html create mode 100644 doc/classes/Git/Log.src/M000021.html create mode 100644 doc/classes/Git/Log.src/M000022.html create mode 100644 doc/classes/Git/Log.src/M000023.html create mode 100644 doc/classes/Git/Object.html create mode 100644 doc/classes/Git/Object.src/M000120.html create mode 100644 doc/classes/Git/Object/AbstractObject.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000122.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000123.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000124.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000125.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000126.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000127.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000128.html create mode 100644 doc/classes/Git/Object/AbstractObject.src/M000129.html create mode 100644 doc/classes/Git/Object/Blob.html create mode 100644 doc/classes/Git/Object/Blob.src/M000132.html create mode 100644 doc/classes/Git/Object/Commit.html create mode 100644 doc/classes/Git/Object/Commit.src/M000121.html create mode 100644 doc/classes/Git/Object/Tag.html create mode 100644 doc/classes/Git/Object/Tag.src/M000130.html create mode 100644 doc/classes/Git/Object/Tag.src/M000131.html create mode 100644 doc/classes/Git/Object/Tree.html create mode 100644 doc/classes/Git/Object/Tree.src/M000133.html create mode 100644 doc/classes/Git/Path.html create mode 100644 doc/classes/Git/Path.src/M000117.html create mode 100644 doc/classes/Git/Path.src/M000118.html create mode 100644 doc/classes/Git/Path.src/M000119.html create mode 100644 doc/classes/Git/Remote.html create mode 100644 doc/classes/Git/Remote.src/M000147.html create mode 100644 doc/classes/Git/Remote.src/M000148.html create mode 100644 doc/classes/Git/Remote.src/M000149.html create mode 100644 doc/classes/Git/Remote.src/M000150.html create mode 100644 doc/classes/Git/Remote.src/M000151.html create mode 100644 doc/classes/Git/Remote.src/M000152.html create mode 100644 doc/classes/Git/Remote.src/M000153.html create mode 100644 doc/classes/Git/Repository.html create mode 100644 doc/classes/Git/Status.html create mode 100644 doc/classes/Git/Status.src/M000005.html create mode 100644 doc/classes/Git/Status.src/M000006.html create mode 100644 doc/classes/Git/Status.src/M000007.html create mode 100644 doc/classes/Git/Status.src/M000008.html create mode 100644 doc/classes/Git/Status.src/M000009.html create mode 100644 doc/classes/Git/Status.src/M000010.html create mode 100644 doc/classes/Git/Status.src/M000011.html create mode 100644 doc/classes/Git/Status.src/M000012.html create mode 100644 doc/classes/Git/Status/StatusFile.html create mode 100644 doc/classes/Git/Status/StatusFile.src/M000013.html create mode 100644 doc/classes/Git/Status/StatusFile.src/M000014.html create mode 100644 doc/classes/Git/WorkingDirectory.html create mode 100644 doc/created.rid create mode 100644 doc/files/EXAMPLES.html create mode 100644 doc/files/README.html create mode 100644 doc/files/lib/git/base_rb.html create mode 100644 doc/files/lib/git/branch_rb.html create mode 100644 doc/files/lib/git/branches_rb.html create mode 100644 doc/files/lib/git/diff_rb.html create mode 100644 doc/files/lib/git/index_rb.html create mode 100644 doc/files/lib/git/lib_rb.html create mode 100644 doc/files/lib/git/log_rb.html create mode 100644 doc/files/lib/git/object_rb.html create mode 100644 doc/files/lib/git/path_rb.html create mode 100644 doc/files/lib/git/remote_rb.html create mode 100644 doc/files/lib/git/repository_rb.html create mode 100644 doc/files/lib/git/status_rb.html create mode 100644 doc/files/lib/git/working_directory_rb.html create mode 100644 doc/files/lib/git_rb.html create mode 100644 doc/fr_class_index.html create mode 100644 doc/fr_file_index.html create mode 100644 doc/fr_method_index.html create mode 100644 doc/index.html create mode 100644 doc/rdoc-style.css diff --git a/EXAMPLES b/EXAMPLES dissimilarity index 100% index 61f7236..c0d32c5 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -1,131 +1,131 @@ -require 'git' - -# needs read permission only - -g = Git.open (working_dir = '.') - (git_dir, index_file) - -g.index -g.index.readable? -g.index.writable? -g.repo -g.dir - -g.log # returns array of Git::Commit objects -g.log.since('2 weeks ago') -g.log.between('v2.5', 'v2.6') -g.log.each {|l| puts l.sha } -g.gblob('v2.5:Makefile').log.since('2 weeks ago') - -g.object('HEAD^').to_s # git show / git rev-parse -g.object('HEAD^').contents -g.object('v2.5:Makefile').size -g.object('v2.5:Makefile').sha - -g.gtree(treeish) -g.gblob(treeish) -g.gcommit(treeish) - -g.revparse('v2.5:Makefile') - -g.branches # returns Git::Branch objects -g.branches.local -g.branches.remote -g.branches[:master].gcommit -g.branches['origin/master'].gcommit - -g.grep('hello') # implies HEAD -g.blob('v2.5:Makefile').grep('hello') -g.tag('v2.5').grep('hello', 'docs/') - -g.diff(commit1, commit2).size -g.diff(commit1, commit2).stats -g.gtree('v2.5').diff('v2.6').insertions -g.diff('gitsearch1', 'v2.5').path('lib/') -g.diff('gitsearch1', @git.gtree('v2.5')) -g.diff('gitsearch1', 'v2.5').path('docs/').patch -g.gtree('v2.5').diff('v2.6').patch - -g.gtree('v2.5').diff('v2.6').each do |file_diff| - puts file_diff.path - puts file_diff.patch - puts file_diff.blob(:src).contents -end - -g.config('user.name') # returns 'Scott Chacon' -g.config # returns whole config hash - -g.tag # returns array of Git::Tag objects - - - -# needs write permission - - -g = Git.init - Git.init('project') - Git.init('/home/schacon/proj', - { :git_dir => '/opt/git/proj.git', - :index_file => '/tmp/index'} ) - -g = Git.clone(URI, :name => 'name', :path => '/tmp/checkout' - (git_dir, index_file) - -g.config('user.name', 'Scott Chacon') -g.config('user.email', 'email@email.com') - -g.add('.') -g.add([file1, file2]) - -g.remove('file.txt') -g.remove(['file.txt', 'file2.txt']) - -g.commit('message') -g.commit_all('message') - -g = Git.clone(repo, 'myrepo') -Dir.chdir('myrepo') do - new_file('test-file', 'blahblahblah') - g.status.untracked.each do |file| - puts file.blob(:index).contents - end -end - -g.reset # defaults to HEAD -g.reset_hard(Git::Commit) - -g.branch('new_branch') # creates new or fetches existing -g.branch('new_branch').checkout -g.branch('new_branch').delete -g.branch('existing_branch').checkout - -g.checkout('new_branch') -g.checkout(g.branch('new_branch')) - -g.branch(name).merge(branch2) -g.branch(branch2).merge # merges HEAD with branch2 - -g.branch(name).in_branch(message) { # add files } # auto-commits -g.merge('new_branch') -g.merge('origin/remote_branch') -g.merge(b.branch('master')) -g.merge([branch1, branch2]) - -r = g.add_remote(name, uri) # Git::Remote -r = g.add_remote(name, Git::Base) # Git::Remote - -g.remotes # array of Git::Remotes -g.remote(name).fetch -g.remote(name).remove -g.remote(name).merge -g.remote(name).merge(branch) - -g.fetch -g.fetch(g.remotes.first) - -g.pull -g.pull(Git::Repo, Git::Branch) # fetch and a merge - -g.add_tag('tag_name') # returns Git::Tag - -g.repack + require 'git' + + # needs read permission only + + g = Git.open (working_dir = '.') + (git_dir, index_file) + + g.index + g.index.readable? + g.index.writable? + g.repo + g.dir + + g.log # returns array of Git::Commit objects + g.log.since('2 weeks ago') + g.log.between('v2.5', 'v2.6') + g.log.each {|l| puts l.sha } + g.gblob('v2.5:Makefile').log.since('2 weeks ago') + + g.object('HEAD^').to_s # git show / git rev-parse + g.object('HEAD^').contents + g.object('v2.5:Makefile').size + g.object('v2.5:Makefile').sha + + g.gtree(treeish) + g.gblob(treeish) + g.gcommit(treeish) + + g.revparse('v2.5:Makefile') + + g.branches # returns Git::Branch objects + g.branches.local + g.branches.remote + g.branches[:master].gcommit + g.branches['origin/master'].gcommit + + g.grep('hello') # implies HEAD + g.blob('v2.5:Makefile').grep('hello') + g.tag('v2.5').grep('hello', 'docs/') + + g.diff(commit1, commit2).size + g.diff(commit1, commit2).stats + g.gtree('v2.5').diff('v2.6').insertions + g.diff('gitsearch1', 'v2.5').path('lib/') + g.diff('gitsearch1', @git.gtree('v2.5')) + g.diff('gitsearch1', 'v2.5').path('docs/').patch + g.gtree('v2.5').diff('v2.6').patch + + g.gtree('v2.5').diff('v2.6').each do |file_diff| + puts file_diff.path + puts file_diff.patch + puts file_diff.blob(:src).contents + end + + g.config('user.name') # returns 'Scott Chacon' + g.config # returns whole config hash + + g.tag # returns array of Git::Tag objects + + + + # needs write permission + + + g = Git.init + Git.init('project') + Git.init('/home/schacon/proj', + { :git_dir => '/opt/git/proj.git', + :index_file => '/tmp/index'} ) + + g = Git.clone(URI, :name => 'name', :path => '/tmp/checkout' + (git_dir, index_file) + + g.config('user.name', 'Scott Chacon') + g.config('user.email', 'email@email.com') + + g.add('.') + g.add([file1, file2]) + + g.remove('file.txt') + g.remove(['file.txt', 'file2.txt']) + + g.commit('message') + g.commit_all('message') + + g = Git.clone(repo, 'myrepo') + Dir.chdir('myrepo') do + new_file('test-file', 'blahblahblah') + g.status.untracked.each do |file| + puts file.blob(:index).contents + end + end + + g.reset # defaults to HEAD + g.reset_hard(Git::Commit) + + g.branch('new_branch') # creates new or fetches existing + g.branch('new_branch').checkout + g.branch('new_branch').delete + g.branch('existing_branch').checkout + + g.checkout('new_branch') + g.checkout(g.branch('new_branch')) + + g.branch(name).merge(branch2) + g.branch(branch2).merge # merges HEAD with branch2 + + g.branch(name).in_branch(message) { # add files } # auto-commits + g.merge('new_branch') + g.merge('origin/remote_branch') + g.merge(b.branch('master')) + g.merge([branch1, branch2]) + + r = g.add_remote(name, uri) # Git::Remote + r = g.add_remote(name, Git::Base) # Git::Remote + + g.remotes # array of Git::Remotes + g.remote(name).fetch + g.remote(name).remove + g.remote(name).merge + g.remote(name).merge(branch) + + g.fetch + g.fetch(g.remotes.first) + + g.pull + g.pull(Git::Repo, Git::Branch) # fetch and a merge + + g.add_tag('tag_name') # returns Git::Tag + + g.repack diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7029925 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README b/README dissimilarity index 66% index 5f9c69a..5e80466 100644 --- a/README +++ b/README @@ -1,56 +1,16 @@ -Git Library for Ruby ------------------------------ - -Library for using Git in Ruby. - -Right now I'm forking calls to the 'git' binary, -but eventually I'll replace that with either C bindings -to libgit or libgit-thin, or I'll write pure ruby -handlers for at least some of the Git stuff. - -See EXAMPLES file for, well, examples. - - - -Git::Object - - sha - - type - - cat_file - - raw - -Git::Commit - - tree - - parent - - author # git author - - author_date - - committer # git author - - committer_date / date - - message - -Git::Tree - - children - - blobs/files - - subtrees/subdirs - -Git::Blob << File - - size - - permissions - -Git::Tag - -Git::Hash - - abbrev/short - -Git::Repository - - heads - - refs - - branches - -Git::WorkingDirectory - - foreach - - glob # returns Git::Files - -Git::File << File - - log - - tags - +== Git Library for Ruby + += What it is + +Library for using Git in Ruby. + += Roadmap + +Right now I'm forking calls to the 'git' binary, +but eventually I'll replace that with either C bindings +to libgit or libgit-thin, or I'll write pure ruby +handlers for at least some of the Git stuff. + +See EXAMPLES file for, well, examples. + + diff --git a/Rakefile b/Rakefile index 20aa494..fd93a28 100644 --- a/Rakefile +++ b/Rakefile @@ -5,7 +5,7 @@ require 'rake/gempackagetask' spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "git" - s.version = "0.1.1" + s.version = "1.0.0" s.author = "Scott Chacon" s.email = "schacon@gmail.com" s.summary = "A package for using Git in Ruby code." @@ -25,6 +25,11 @@ task :default => "pkg/#{spec.name}-#{spec.version}.gem" do puts "generated latest version" end +desc "Regenerate Documentation" +task :doc do |t| + system('rdoc lib/ README EXAMPLES --main README --inline-source') +end + desc "Run Unit Tests" task :test do |t| require File.dirname(__FILE__) + '/tests/all_tests.rb' diff --git a/TODO b/TODO index af82535..883ec7e 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,34 @@ +* Git::Object methods + - tree recursion + - commit information + + Git::Object + - sha + - type + - cat_file + - raw + + Git::Commit + - tree + - parent + - author # git author + - author_date + - committer # git author + - committer_date / date + - message + + Git::Tree + - children + - blobs/files + - subtrees/subdirs + + Git::Blob << File + - size + - permissions + +* pushing + * More Error Examples * More Git::Status methods diff --git a/doc/classes/Git.html b/doc/classes/Git.html new file mode 100644 index 0000000..3ddaacf --- /dev/null +++ b/doc/classes/Git.html @@ -0,0 +1,284 @@ + + + + + + Module: Git + + + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ bare   + clone   + init   + open   +
+
+ +
+ + + + +
+ +
+

Classes and Modules

+ + Class Git::Base
+Class Git::Branch
+Class Git::Branches
+Class Git::Diff
+Class Git::GitExecuteError
+Class Git::GitTagNameDoesNotExist
+Class Git::Index
+Class Git::Lib
+Class Git::Log
+Class Git::Object
+Class Git::Path
+Class Git::Remote
+Class Git::Repository
+Class Git::Status
+Class Git::WorkingDirectory
+ +
+ + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git.rb, line 34
+  def self.bare(git_dir)
+    Base.bare(git_dir)
+  end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git.rb, line 46
+  def self.clone(repository, name, options = {})
+    Base.clone(repository, name, options)
+  end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git.rb, line 42
+  def self.init(working_dir = '.', options = {})
+    Base.init(working_dir, options)
+  end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git.rb, line 38
+  def self.open(working_dir, options = {})
+    Base.open(working_dir, options)
+  end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git.src/M000001.html b/doc/classes/Git.src/M000001.html new file mode 100644 index 0000000..9930200 --- /dev/null +++ b/doc/classes/Git.src/M000001.html @@ -0,0 +1,18 @@ + + + + + + bare (Git) + + + + +
# File lib/git.rb, line 34
+  def self.bare(git_dir)
+    Base.bare(git_dir)
+  end
+ + \ No newline at end of file diff --git a/doc/classes/Git.src/M000002.html b/doc/classes/Git.src/M000002.html new file mode 100644 index 0000000..bacfcef --- /dev/null +++ b/doc/classes/Git.src/M000002.html @@ -0,0 +1,18 @@ + + + + + + open (Git) + + + + +
# File lib/git.rb, line 38
+  def self.open(working_dir, options = {})
+    Base.open(working_dir, options)
+  end
+ + \ No newline at end of file diff --git a/doc/classes/Git.src/M000003.html b/doc/classes/Git.src/M000003.html new file mode 100644 index 0000000..3558d68 --- /dev/null +++ b/doc/classes/Git.src/M000003.html @@ -0,0 +1,18 @@ + + + + + + init (Git) + + + + +
# File lib/git.rb, line 42
+  def self.init(working_dir = '.', options = {})
+    Base.init(working_dir, options)
+  end
+ + \ No newline at end of file diff --git a/doc/classes/Git.src/M000004.html b/doc/classes/Git.src/M000004.html new file mode 100644 index 0000000..b8bafbb --- /dev/null +++ b/doc/classes/Git.src/M000004.html @@ -0,0 +1,18 @@ + + + + + + clone (Git) + + + + +
# File lib/git.rb, line 46
+  def self.clone(repository, name, options = {})
+    Base.clone(repository, name, options)
+  end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.html b/doc/classes/Git/Base.html new file mode 100644 index 0000000..7f4f2c1 --- /dev/null +++ b/doc/classes/Git/Base.html @@ -0,0 +1,1180 @@ + + + + + + Class: Git::Base + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Base
In: + + lib/git/base.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ add   + add_remote   + add_tag   + bare   + branch   + branches   + chdir   + checkout   + clone   + commit   + commit_all   + config   + current_branch   + diff   + dir   + fetch   + gblob   + gcommit   + grep   + gtree   + index   + init   + lib   + log   + merge   + new   + object   + open   + pull   + remote   + remotes   + remove   + repack   + repo   + repo_size   + reset   + reset_hard   + revparse   + status   + tag   + tags   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

+opens a bare Git Repository - no working directory options +

+

[Source]

+
+
+# File lib/git/base.rb, line 10
+    def self.bare(git_dir)
+      self.new :repository => git_dir
+    end
+
+
+
+
+ +
+ + + + +
+

+clones a git repository locally +

+
+ repository - http://repo.or.cz/w/sinatra.git
+ name - sinatra
+
+

+options: +

+
+  :repository
+
+   :bare
+  or
+   :working_directory
+   :index_file
+
+

[Source]

+
+
+# File lib/git/base.rb, line 58
+    def self.clone(repository, name, opts = {})
+      # run git-clone 
+      self.new(Git::Lib.new.clone(repository, name, opts))
+    end
+
+
+
+
+ +
+ + + + +
+

+initializes a git repository +

+

+options: +

+
+ :repository
+ :index_file
+
+

[Source]

+
+
+# File lib/git/base.rb, line 29
+    def self.init(working_dir, opts = {})
+      default = {:working_directory => working_dir,
+                 :repository => File.join(working_dir, '.git')}
+      git_options = default.merge(opts)
+      
+      if git_options[:working_directory]
+        # if !working_dir, make it
+        FileUtils.mkdir_p(git_options[:working_directory]) if !File.directory?(git_options[:working_directory])
+      end
+      
+      # run git_init there
+      Git::Lib.new(git_options).init
+       
+      self.new(git_options)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 63
+    def initialize(options = {})
+      if working_dir = options[:working_directory]
+        options[:repository] = File.join(working_dir, '.git') if !options[:repository]
+        options[:index] = File.join(working_dir, '.git', 'index') if !options[:index]
+      end
+      
+      @working_directory = Git::WorkingDirectory.new(options[:working_directory]) if options[:working_directory]
+      @repository = Git::Repository.new(options[:repository]) if options[:repository]
+      @index = Git::Index.new(options[:index], false) if options[:index]
+    end
+
+
+
+
+ +
+ + + + +
+

+opens a new Git Project from a working directory +you can specify non-standard git_dir and index file in the options +

+

[Source]

+
+
+# File lib/git/base.rb, line 16
+    def self.open(working_dir, opts={})    
+      default = {:working_directory => working_dir}
+      git_options = default.merge(opts)
+      
+      self.new(git_options)
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

+adds files from the working directory to the git repository +

+

[Source]

+
+
+# File lib/git/base.rb, line 162
+    def add(path = '.')
+      self.lib.add(path)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 209
+    def add_remote(name, url, opts = {})
+      if url.is_a?(Git::Base)
+        url = url.repo.path
+      end
+      self.lib.remote_add(name, url, opts)
+      Git::Remote.new(self, name)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 225
+    def add_tag(tag_name)
+      self.lib.tag(tag_name)
+      tag(tag_name)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 140
+    def branch(branch_name = 'master')
+      Git::Branch.new(self, branch_name)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 136
+    def branches
+      Git::Branches.new(self)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 87
+    def chdir
+      Dir.chdir(dir.path) do
+        yield dir.path
+      end
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 188
+    def checkout(branch, opts = {})
+      self.lib.checkout(branch, opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 179
+    def commit(message, opts = {})
+      self.lib.commit(message, opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 183
+    def commit_all(message, opts = {})
+      opts = {:add_all => true}.merge(opts)
+      self.lib.commit(message, opts)
+    end
+
+
+
+
+ +
+ + + + +
+

+g.config(‘user.name’, ‘Scott Chacon’) # sets value +g.config(‘user.email’, ‘email@email.com’) # sets +value g.config(‘user.name’) # returns ‘Scott +Chacon’ g.config # returns whole config hash +

+

[Source]

+
+
+# File lib/git/base.rb, line 105
+    def config(name = nil, value = nil)
+      if(name && value)
+        # set value
+        lib.config_set(name, value)
+      elsif (name)
+        # return value
+        lib.config_get(name)
+      else
+        # return hash
+        lib.config_list
+      end
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 240
+    def current_branch
+      self.lib.branch_current
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 157
+    def diff(objectish = 'HEAD', obj2 = nil)
+      Git::Diff.new(self, objectish, obj2)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 75
+    def dir
+      @working_directory
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 192
+    def fetch(remote = 'origin')
+      self.lib.fetch(remote)
+    end
+
+
+
+
+ +
+ + +
+ gblob(objectish) +
+ +
+

+Alias for object +

+
+
+ +
+ + +
+ gcommit(objectish) +
+ +
+

+Alias for object +

+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 153
+    def grep(string)
+      self.object('HEAD').grep(string)
+    end
+
+
+
+
+ +
+ + +
+ gtree(objectish) +
+ +
+

+Alias for object +

+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 83
+    def index
+      @index
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 149
+    def lib
+      Git::Lib.new(self)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 128
+    def log(count = 30)
+      Git::Log.new(self, count)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 196
+    def merge(branch, message = 'merge')
+      self.lib.merge(branch, message)
+    end
+
+
+
+
+ +
+ + + + +
+

+factory methods +

+

[Source]

+
+
+# File lib/git/base.rb, line 120
+    def object(objectish)
+      Git::Object.new(self, objectish)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 200
+    def pull(remote = 'origin', branch = 'master', message = 'origin pull')
+      fetch(remote)
+      merge(branch, message)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 144
+    def remote(remote_name = 'origin')
+      Git::Remote.new(self, remote_name)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 205
+    def remotes
+      self.lib.remotes.map { |r| Git::Remote.new(self, r) }
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 166
+    def remove(path = '.', opts = {})
+      self.lib.remove(path, opts)
+    end
+
+
+
+
+ +
+ + + + +
+

+convenience methods +

+

[Source]

+
+
+# File lib/git/base.rb, line 232
+    def repack
+      self.lib.repack
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 79
+    def repo
+      @repository
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 93
+    def repo_size
+      size = 0
+      Dir.chdir(repo.path) do
+        (size, dot) = `du -d0`.chomp.split
+      end
+      size.to_i
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 170
+    def reset(commitish = nil, opts = {})
+      self.lib.reset(commitish, opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 174
+    def reset_hard(commitish = nil, opts = {})
+      opts = {:hard => true}.merge(opts)
+      self.lib.reset(commitish, opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 236
+    def revparse(objectish)
+      self.lib.revparse(objectish)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 132
+    def status
+      Git::Status.new(self)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 221
+    def tag(tag_name)
+      Git::Object.new(self, tag_name, true)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 217
+    def tags
+      self.lib.tags.map { |r| tag(r) }
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000076.html b/doc/classes/Git/Base.src/M000076.html new file mode 100644 index 0000000..6d2c44c --- /dev/null +++ b/doc/classes/Git/Base.src/M000076.html @@ -0,0 +1,18 @@ + + + + + + bare (Git::Base) + + + + +
# File lib/git/base.rb, line 10
+    def self.bare(git_dir)
+      self.new :repository => git_dir
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000077.html b/doc/classes/Git/Base.src/M000077.html new file mode 100644 index 0000000..829a57a --- /dev/null +++ b/doc/classes/Git/Base.src/M000077.html @@ -0,0 +1,21 @@ + + + + + + open (Git::Base) + + + + +
# File lib/git/base.rb, line 16
+    def self.open(working_dir, opts={})    
+      default = {:working_directory => working_dir}
+      git_options = default.merge(opts)
+      
+      self.new(git_options)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000078.html b/doc/classes/Git/Base.src/M000078.html new file mode 100644 index 0000000..d819238 --- /dev/null +++ b/doc/classes/Git/Base.src/M000078.html @@ -0,0 +1,30 @@ + + + + + + init (Git::Base) + + + + +
# File lib/git/base.rb, line 29
+    def self.init(working_dir, opts = {})
+      default = {:working_directory => working_dir,
+                 :repository => File.join(working_dir, '.git')}
+      git_options = default.merge(opts)
+      
+      if git_options[:working_directory]
+        # if !working_dir, make it
+        FileUtils.mkdir_p(git_options[:working_directory]) if !File.directory?(git_options[:working_directory])
+      end
+      
+      # run git_init there
+      Git::Lib.new(git_options).init
+       
+      self.new(git_options)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000079.html b/doc/classes/Git/Base.src/M000079.html new file mode 100644 index 0000000..0e7cd9e --- /dev/null +++ b/doc/classes/Git/Base.src/M000079.html @@ -0,0 +1,19 @@ + + + + + + clone (Git::Base) + + + + +
# File lib/git/base.rb, line 58
+    def self.clone(repository, name, opts = {})
+      # run git-clone 
+      self.new(Git::Lib.new.clone(repository, name, opts))
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000080.html b/doc/classes/Git/Base.src/M000080.html new file mode 100644 index 0000000..9e4101b --- /dev/null +++ b/doc/classes/Git/Base.src/M000080.html @@ -0,0 +1,25 @@ + + + + + + new (Git::Base) + + + + +
# File lib/git/base.rb, line 63
+    def initialize(options = {})
+      if working_dir = options[:working_directory]
+        options[:repository] = File.join(working_dir, '.git') if !options[:repository]
+        options[:index] = File.join(working_dir, '.git', 'index') if !options[:index]
+      end
+      
+      @working_directory = Git::WorkingDirectory.new(options[:working_directory]) if options[:working_directory]
+      @repository = Git::Repository.new(options[:repository]) if options[:repository]
+      @index = Git::Index.new(options[:index], false) if options[:index]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000081.html b/doc/classes/Git/Base.src/M000081.html new file mode 100644 index 0000000..af48b9f --- /dev/null +++ b/doc/classes/Git/Base.src/M000081.html @@ -0,0 +1,18 @@ + + + + + + dir (Git::Base) + + + + +
# File lib/git/base.rb, line 75
+    def dir
+      @working_directory
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000082.html b/doc/classes/Git/Base.src/M000082.html new file mode 100644 index 0000000..508e31b --- /dev/null +++ b/doc/classes/Git/Base.src/M000082.html @@ -0,0 +1,18 @@ + + + + + + repo (Git::Base) + + + + +
# File lib/git/base.rb, line 79
+    def repo
+      @repository
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000083.html b/doc/classes/Git/Base.src/M000083.html new file mode 100644 index 0000000..59c45ad --- /dev/null +++ b/doc/classes/Git/Base.src/M000083.html @@ -0,0 +1,18 @@ + + + + + + index (Git::Base) + + + + +
# File lib/git/base.rb, line 83
+    def index
+      @index
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000084.html b/doc/classes/Git/Base.src/M000084.html new file mode 100644 index 0000000..08b3b4a --- /dev/null +++ b/doc/classes/Git/Base.src/M000084.html @@ -0,0 +1,20 @@ + + + + + + chdir (Git::Base) + + + + +
# File lib/git/base.rb, line 87
+    def chdir
+      Dir.chdir(dir.path) do
+        yield dir.path
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000085.html b/doc/classes/Git/Base.src/M000085.html new file mode 100644 index 0000000..328cc26 --- /dev/null +++ b/doc/classes/Git/Base.src/M000085.html @@ -0,0 +1,22 @@ + + + + + + repo_size (Git::Base) + + + + +
# File lib/git/base.rb, line 93
+    def repo_size
+      size = 0
+      Dir.chdir(repo.path) do
+        (size, dot) = `du -d0`.chomp.split
+      end
+      size.to_i
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000086.html b/doc/classes/Git/Base.src/M000086.html new file mode 100644 index 0000000..681b967 --- /dev/null +++ b/doc/classes/Git/Base.src/M000086.html @@ -0,0 +1,27 @@ + + + + + + config (Git::Base) + + + + +
# File lib/git/base.rb, line 105
+    def config(name = nil, value = nil)
+      if(name && value)
+        # set value
+        lib.config_set(name, value)
+      elsif (name)
+        # return value
+        lib.config_get(name)
+      else
+        # return hash
+        lib.config_list
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000087.html b/doc/classes/Git/Base.src/M000087.html new file mode 100644 index 0000000..acf9352 --- /dev/null +++ b/doc/classes/Git/Base.src/M000087.html @@ -0,0 +1,18 @@ + + + + + + object (Git::Base) + + + + +
# File lib/git/base.rb, line 120
+    def object(objectish)
+      Git::Object.new(self, objectish)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000091.html b/doc/classes/Git/Base.src/M000091.html new file mode 100644 index 0000000..3871e7f --- /dev/null +++ b/doc/classes/Git/Base.src/M000091.html @@ -0,0 +1,18 @@ + + + + + + log (Git::Base) + + + + +
# File lib/git/base.rb, line 128
+    def log(count = 30)
+      Git::Log.new(self, count)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000092.html b/doc/classes/Git/Base.src/M000092.html new file mode 100644 index 0000000..a64f5ef --- /dev/null +++ b/doc/classes/Git/Base.src/M000092.html @@ -0,0 +1,18 @@ + + + + + + status (Git::Base) + + + + +
# File lib/git/base.rb, line 132
+    def status
+      Git::Status.new(self)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000093.html b/doc/classes/Git/Base.src/M000093.html new file mode 100644 index 0000000..977b9a9 --- /dev/null +++ b/doc/classes/Git/Base.src/M000093.html @@ -0,0 +1,18 @@ + + + + + + branches (Git::Base) + + + + +
# File lib/git/base.rb, line 136
+    def branches
+      Git::Branches.new(self)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000094.html b/doc/classes/Git/Base.src/M000094.html new file mode 100644 index 0000000..303818a --- /dev/null +++ b/doc/classes/Git/Base.src/M000094.html @@ -0,0 +1,18 @@ + + + + + + branch (Git::Base) + + + + +
# File lib/git/base.rb, line 140
+    def branch(branch_name = 'master')
+      Git::Branch.new(self, branch_name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000095.html b/doc/classes/Git/Base.src/M000095.html new file mode 100644 index 0000000..5fb3dcd --- /dev/null +++ b/doc/classes/Git/Base.src/M000095.html @@ -0,0 +1,18 @@ + + + + + + remote (Git::Base) + + + + +
# File lib/git/base.rb, line 144
+    def remote(remote_name = 'origin')
+      Git::Remote.new(self, remote_name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000096.html b/doc/classes/Git/Base.src/M000096.html new file mode 100644 index 0000000..be6fedd --- /dev/null +++ b/doc/classes/Git/Base.src/M000096.html @@ -0,0 +1,18 @@ + + + + + + lib (Git::Base) + + + + +
# File lib/git/base.rb, line 149
+    def lib
+      Git::Lib.new(self)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000097.html b/doc/classes/Git/Base.src/M000097.html new file mode 100644 index 0000000..ae8babb --- /dev/null +++ b/doc/classes/Git/Base.src/M000097.html @@ -0,0 +1,18 @@ + + + + + + grep (Git::Base) + + + + +
# File lib/git/base.rb, line 153
+    def grep(string)
+      self.object('HEAD').grep(string)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000098.html b/doc/classes/Git/Base.src/M000098.html new file mode 100644 index 0000000..1da549e --- /dev/null +++ b/doc/classes/Git/Base.src/M000098.html @@ -0,0 +1,18 @@ + + + + + + diff (Git::Base) + + + + +
# File lib/git/base.rb, line 157
+    def diff(objectish = 'HEAD', obj2 = nil)
+      Git::Diff.new(self, objectish, obj2)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000099.html b/doc/classes/Git/Base.src/M000099.html new file mode 100644 index 0000000..4a476c6 --- /dev/null +++ b/doc/classes/Git/Base.src/M000099.html @@ -0,0 +1,18 @@ + + + + + + add (Git::Base) + + + + +
# File lib/git/base.rb, line 162
+    def add(path = '.')
+      self.lib.add(path)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000100.html b/doc/classes/Git/Base.src/M000100.html new file mode 100644 index 0000000..1c3e24a --- /dev/null +++ b/doc/classes/Git/Base.src/M000100.html @@ -0,0 +1,18 @@ + + + + + + remove (Git::Base) + + + + +
# File lib/git/base.rb, line 166
+    def remove(path = '.', opts = {})
+      self.lib.remove(path, opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000101.html b/doc/classes/Git/Base.src/M000101.html new file mode 100644 index 0000000..c665284 --- /dev/null +++ b/doc/classes/Git/Base.src/M000101.html @@ -0,0 +1,18 @@ + + + + + + reset (Git::Base) + + + + +
# File lib/git/base.rb, line 170
+    def reset(commitish = nil, opts = {})
+      self.lib.reset(commitish, opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000102.html b/doc/classes/Git/Base.src/M000102.html new file mode 100644 index 0000000..5c93ac6 --- /dev/null +++ b/doc/classes/Git/Base.src/M000102.html @@ -0,0 +1,19 @@ + + + + + + reset_hard (Git::Base) + + + + +
# File lib/git/base.rb, line 174
+    def reset_hard(commitish = nil, opts = {})
+      opts = {:hard => true}.merge(opts)
+      self.lib.reset(commitish, opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000103.html b/doc/classes/Git/Base.src/M000103.html new file mode 100644 index 0000000..c96c8ce --- /dev/null +++ b/doc/classes/Git/Base.src/M000103.html @@ -0,0 +1,18 @@ + + + + + + commit (Git::Base) + + + + +
# File lib/git/base.rb, line 179
+    def commit(message, opts = {})
+      self.lib.commit(message, opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000104.html b/doc/classes/Git/Base.src/M000104.html new file mode 100644 index 0000000..36ccb9e --- /dev/null +++ b/doc/classes/Git/Base.src/M000104.html @@ -0,0 +1,19 @@ + + + + + + commit_all (Git::Base) + + + + +
# File lib/git/base.rb, line 183
+    def commit_all(message, opts = {})
+      opts = {:add_all => true}.merge(opts)
+      self.lib.commit(message, opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000105.html b/doc/classes/Git/Base.src/M000105.html new file mode 100644 index 0000000..cc9ee48 --- /dev/null +++ b/doc/classes/Git/Base.src/M000105.html @@ -0,0 +1,18 @@ + + + + + + checkout (Git::Base) + + + + +
# File lib/git/base.rb, line 188
+    def checkout(branch, opts = {})
+      self.lib.checkout(branch, opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000106.html b/doc/classes/Git/Base.src/M000106.html new file mode 100644 index 0000000..9624ceb --- /dev/null +++ b/doc/classes/Git/Base.src/M000106.html @@ -0,0 +1,18 @@ + + + + + + fetch (Git::Base) + + + + +
# File lib/git/base.rb, line 192
+    def fetch(remote = 'origin')
+      self.lib.fetch(remote)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000107.html b/doc/classes/Git/Base.src/M000107.html new file mode 100644 index 0000000..f4ae943 --- /dev/null +++ b/doc/classes/Git/Base.src/M000107.html @@ -0,0 +1,18 @@ + + + + + + merge (Git::Base) + + + + +
# File lib/git/base.rb, line 196
+    def merge(branch, message = 'merge')
+      self.lib.merge(branch, message)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000108.html b/doc/classes/Git/Base.src/M000108.html new file mode 100644 index 0000000..7a9effb --- /dev/null +++ b/doc/classes/Git/Base.src/M000108.html @@ -0,0 +1,19 @@ + + + + + + pull (Git::Base) + + + + +
# File lib/git/base.rb, line 200
+    def pull(remote = 'origin', branch = 'master', message = 'origin pull')
+      fetch(remote)
+      merge(branch, message)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000109.html b/doc/classes/Git/Base.src/M000109.html new file mode 100644 index 0000000..d95f289 --- /dev/null +++ b/doc/classes/Git/Base.src/M000109.html @@ -0,0 +1,18 @@ + + + + + + remotes (Git::Base) + + + + +
# File lib/git/base.rb, line 205
+    def remotes
+      self.lib.remotes.map { |r| Git::Remote.new(self, r) }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000110.html b/doc/classes/Git/Base.src/M000110.html new file mode 100644 index 0000000..b2d3347 --- /dev/null +++ b/doc/classes/Git/Base.src/M000110.html @@ -0,0 +1,22 @@ + + + + + + add_remote (Git::Base) + + + + +
# File lib/git/base.rb, line 209
+    def add_remote(name, url, opts = {})
+      if url.is_a?(Git::Base)
+        url = url.repo.path
+      end
+      self.lib.remote_add(name, url, opts)
+      Git::Remote.new(self, name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000111.html b/doc/classes/Git/Base.src/M000111.html new file mode 100644 index 0000000..2565603 --- /dev/null +++ b/doc/classes/Git/Base.src/M000111.html @@ -0,0 +1,18 @@ + + + + + + tags (Git::Base) + + + + +
# File lib/git/base.rb, line 217
+    def tags
+      self.lib.tags.map { |r| tag(r) }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000112.html b/doc/classes/Git/Base.src/M000112.html new file mode 100644 index 0000000..f98043f --- /dev/null +++ b/doc/classes/Git/Base.src/M000112.html @@ -0,0 +1,18 @@ + + + + + + tag (Git::Base) + + + + +
# File lib/git/base.rb, line 221
+    def tag(tag_name)
+      Git::Object.new(self, tag_name, true)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000113.html b/doc/classes/Git/Base.src/M000113.html new file mode 100644 index 0000000..01e0856 --- /dev/null +++ b/doc/classes/Git/Base.src/M000113.html @@ -0,0 +1,19 @@ + + + + + + add_tag (Git::Base) + + + + +
# File lib/git/base.rb, line 225
+    def add_tag(tag_name)
+      self.lib.tag(tag_name)
+      tag(tag_name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000114.html b/doc/classes/Git/Base.src/M000114.html new file mode 100644 index 0000000..123b131 --- /dev/null +++ b/doc/classes/Git/Base.src/M000114.html @@ -0,0 +1,18 @@ + + + + + + repack (Git::Base) + + + + +
# File lib/git/base.rb, line 232
+    def repack
+      self.lib.repack
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000115.html b/doc/classes/Git/Base.src/M000115.html new file mode 100644 index 0000000..676c923 --- /dev/null +++ b/doc/classes/Git/Base.src/M000115.html @@ -0,0 +1,18 @@ + + + + + + revparse (Git::Base) + + + + +
# File lib/git/base.rb, line 236
+    def revparse(objectish)
+      self.lib.revparse(objectish)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Base.src/M000116.html b/doc/classes/Git/Base.src/M000116.html new file mode 100644 index 0000000..6b6f91d --- /dev/null +++ b/doc/classes/Git/Base.src/M000116.html @@ -0,0 +1,18 @@ + + + + + + current_branch (Git::Base) + + + + +
# File lib/git/base.rb, line 240
+    def current_branch
+      self.lib.branch_current
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.html b/doc/classes/Git/Branch.html new file mode 100644 index 0000000..aa97d6b --- /dev/null +++ b/doc/classes/Git/Branch.html @@ -0,0 +1,429 @@ + + + + + + Class: Git::Branch + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Branch
In: + + lib/git/branch.rb + +
+
Parent: + + Path + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ checkout   + create   + current   + delete   + gcommit   + in_branch   + merge   + new   + to_a   + to_s   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + + + + + + + + + + + +
full [RW] 
name [RW] 
remote [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 9
+    def initialize(base, name)
+      @remote = nil
+      @full = name
+      @base = base
+      
+      parts = name.split('/')
+      if parts[1]
+        @remote = Git::Remote.new(@base, parts[0])
+        @name = parts[1]
+      else
+        @name = parts[0]
+      end
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 28
+    def checkout
+      check_if_create
+      @base.checkout(@name)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 50
+    def create
+      check_if_create
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 58
+    def current
+      determine_current
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 54
+    def delete
+      @base.lib.branch_delete(@name)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 23
+    def gcommit
+      @gcommit = @base.object(name) if !@gcommit
+      @gcommit
+    end
+
+
+
+
+ +
+ + + + +
+

+g.branch(‘new_branch’).in_branch do +

+
+  # create new file
+  # do other stuff
+  return true # auto commits and switches back
+
+

+end +

+

[Source]

+
+
+# File lib/git/branch.rb, line 39
+    def in_branch (message = 'in branch work')
+      old_current = @base.lib.branch_current
+      checkout
+      if yield
+        @base.commit_all(message)
+      else
+        @base.reset_hard
+      end
+      @base.checkout(old_current)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 62
+    def merge(branch = nil, message = nil)
+      if branch
+        in_branch do 
+          @base.merge(branch, message)
+          false
+        end
+        # merge a branch into this one
+      else
+        # merge this branch into the current one
+        @base.merge(@name)
+      end
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 75
+    def to_a
+      [@full]
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 79
+    def to_s
+      @full
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000066.html b/doc/classes/Git/Branch.src/M000066.html new file mode 100644 index 0000000..ebee250 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000066.html @@ -0,0 +1,28 @@ + + + + + + new (Git::Branch) + + + + +
# File lib/git/branch.rb, line 9
+    def initialize(base, name)
+      @remote = nil
+      @full = name
+      @base = base
+      
+      parts = name.split('/')
+      if parts[1]
+        @remote = Git::Remote.new(@base, parts[0])
+        @name = parts[1]
+      else
+        @name = parts[0]
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000067.html b/doc/classes/Git/Branch.src/M000067.html new file mode 100644 index 0000000..181adce --- /dev/null +++ b/doc/classes/Git/Branch.src/M000067.html @@ -0,0 +1,19 @@ + + + + + + gcommit (Git::Branch) + + + + +
# File lib/git/branch.rb, line 23
+    def gcommit
+      @gcommit = @base.object(name) if !@gcommit
+      @gcommit
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000068.html b/doc/classes/Git/Branch.src/M000068.html new file mode 100644 index 0000000..30ef49c --- /dev/null +++ b/doc/classes/Git/Branch.src/M000068.html @@ -0,0 +1,19 @@ + + + + + + checkout (Git::Branch) + + + + +
# File lib/git/branch.rb, line 28
+    def checkout
+      check_if_create
+      @base.checkout(@name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000069.html b/doc/classes/Git/Branch.src/M000069.html new file mode 100644 index 0000000..b435312 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000069.html @@ -0,0 +1,25 @@ + + + + + + in_branch (Git::Branch) + + + + +
# File lib/git/branch.rb, line 39
+    def in_branch (message = 'in branch work')
+      old_current = @base.lib.branch_current
+      checkout
+      if yield
+        @base.commit_all(message)
+      else
+        @base.reset_hard
+      end
+      @base.checkout(old_current)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000070.html b/doc/classes/Git/Branch.src/M000070.html new file mode 100644 index 0000000..9aadb89 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000070.html @@ -0,0 +1,18 @@ + + + + + + create (Git::Branch) + + + + +
# File lib/git/branch.rb, line 50
+    def create
+      check_if_create
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000071.html b/doc/classes/Git/Branch.src/M000071.html new file mode 100644 index 0000000..9c00966 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000071.html @@ -0,0 +1,18 @@ + + + + + + delete (Git::Branch) + + + + +
# File lib/git/branch.rb, line 54
+    def delete
+      @base.lib.branch_delete(@name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000072.html b/doc/classes/Git/Branch.src/M000072.html new file mode 100644 index 0000000..13ca381 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000072.html @@ -0,0 +1,18 @@ + + + + + + current (Git::Branch) + + + + +
# File lib/git/branch.rb, line 58
+    def current
+      determine_current
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000073.html b/doc/classes/Git/Branch.src/M000073.html new file mode 100644 index 0000000..98cc459 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000073.html @@ -0,0 +1,27 @@ + + + + + + merge (Git::Branch) + + + + +
# File lib/git/branch.rb, line 62
+    def merge(branch = nil, message = nil)
+      if branch
+        in_branch do 
+          @base.merge(branch, message)
+          false
+        end
+        # merge a branch into this one
+      else
+        # merge this branch into the current one
+        @base.merge(@name)
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000074.html b/doc/classes/Git/Branch.src/M000074.html new file mode 100644 index 0000000..c807946 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000074.html @@ -0,0 +1,18 @@ + + + + + + to_a (Git::Branch) + + + + +
# File lib/git/branch.rb, line 75
+    def to_a
+      [@full]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branch.src/M000075.html b/doc/classes/Git/Branch.src/M000075.html new file mode 100644 index 0000000..8261f51 --- /dev/null +++ b/doc/classes/Git/Branch.src/M000075.html @@ -0,0 +1,18 @@ + + + + + + to_s (Git::Branch) + + + + +
# File lib/git/branch.rb, line 79
+    def to_s
+      @full
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branches.html b/doc/classes/Git/Branches.html new file mode 100644 index 0000000..1069f77 --- /dev/null +++ b/doc/classes/Git/Branches.html @@ -0,0 +1,294 @@ + + + + + + Class: Git::Branches + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Branches
In: + + lib/git/branches.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ +
+

+object that holds all the available branches +

+ +
+ + +
+ +
+

Methods

+ +
+ []   + each   + local   + new   + remote   + size   +
+
+ +
+ + + +
+

Included Modules

+ +
+ Enumerable +
+
+ +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branches.rb, line 10
+    def initialize(base)
+      @branches = {}
+      
+      @base = base
+            
+      @base.lib.branches_all.each do |b|
+        @branches[b[0]] = Git::Branch.new(@base, b[0])
+      end
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branches.rb, line 40
+    def [](symbol)
+      @branches[symbol.to_s]
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branches.rb, line 34
+    def each
+      @branches.each do |k, b|
+        yield b
+      end
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branches.rb, line 20
+    def local
+      self.select { |b| !b.remote }
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/branches.rb, line 24
+    def remote
+      self.select { |b| b.remote }
+    end
+
+
+
+
+ +
+ + + + +
+

+array like methods +

+

[Source]

+
+
+# File lib/git/branches.rb, line 30
+    def size
+      @branches.size
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Branches.src/M000060.html b/doc/classes/Git/Branches.src/M000060.html new file mode 100644 index 0000000..e2cf582 --- /dev/null +++ b/doc/classes/Git/Branches.src/M000060.html @@ -0,0 +1,24 @@ + + + + + + new (Git::Branches) + + + + +
# File lib/git/branches.rb, line 10
+    def initialize(base)
+      @branches = {}
+      
+      @base = base
+            
+      @base.lib.branches_all.each do |b|
+        @branches[b[0]] = Git::Branch.new(@base, b[0])
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branches.src/M000061.html b/doc/classes/Git/Branches.src/M000061.html new file mode 100644 index 0000000..631c52c --- /dev/null +++ b/doc/classes/Git/Branches.src/M000061.html @@ -0,0 +1,18 @@ + + + + + + local (Git::Branches) + + + + +
# File lib/git/branches.rb, line 20
+    def local
+      self.select { |b| !b.remote }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branches.src/M000062.html b/doc/classes/Git/Branches.src/M000062.html new file mode 100644 index 0000000..61ca127 --- /dev/null +++ b/doc/classes/Git/Branches.src/M000062.html @@ -0,0 +1,18 @@ + + + + + + remote (Git::Branches) + + + + +
# File lib/git/branches.rb, line 24
+    def remote
+      self.select { |b| b.remote }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branches.src/M000063.html b/doc/classes/Git/Branches.src/M000063.html new file mode 100644 index 0000000..56e3d66 --- /dev/null +++ b/doc/classes/Git/Branches.src/M000063.html @@ -0,0 +1,18 @@ + + + + + + size (Git::Branches) + + + + +
# File lib/git/branches.rb, line 30
+    def size
+      @branches.size
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branches.src/M000064.html b/doc/classes/Git/Branches.src/M000064.html new file mode 100644 index 0000000..54f1b5d --- /dev/null +++ b/doc/classes/Git/Branches.src/M000064.html @@ -0,0 +1,20 @@ + + + + + + each (Git::Branches) + + + + +
# File lib/git/branches.rb, line 34
+    def each
+      @branches.each do |k, b|
+        yield b
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Branches.src/M000065.html b/doc/classes/Git/Branches.src/M000065.html new file mode 100644 index 0000000..fa48d64 --- /dev/null +++ b/doc/classes/Git/Branches.src/M000065.html @@ -0,0 +1,18 @@ + + + + + + [] (Git::Branches) + + + + +
# File lib/git/branches.rb, line 40
+    def [](symbol)
+      @branches[symbol.to_s]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.html b/doc/classes/Git/Diff.html new file mode 100644 index 0000000..a1d441e --- /dev/null +++ b/doc/classes/Git/Diff.html @@ -0,0 +1,419 @@ + + + + + + Class: Git::Diff + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Diff
In: + + lib/git/diff.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ +
+

+object that holds the last X commits on given branch +

+ +
+ + +
+ +
+

Methods

+ +
+ []   + deletions   + each   + insertions   + lines   + new   + patch   + path   + size   + stats   + to_s   +
+
+ +
+ + + +
+

Included Modules

+ +
+ Enumerable +
+
+ +
+ +
+

Classes and Modules

+ + Class Git::Diff::DiffFile
+ +
+ + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 16
+    def initialize(base, from = nil, to = nil)
+      @base = base
+      @from = from.to_s
+      @to = to.to_s
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

+enumerable methods +

+

[Source]

+
+
+# File lib/git/diff.rb, line 61
+    def [](key)
+      process_full
+      @full_diff_files.assoc(key)[1]
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 37
+    def deletions
+      cache_stats
+      @stats[:total][:deletions]
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 66
+    def each
+      process_full
+      @full_diff_files.each do |file|
+        yield file[1]
+      end
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 42
+    def insertions
+      cache_stats
+      @stats[:total][:insertions]
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 32
+    def lines
+      cache_stats
+      @stats[:total][:lines]
+    end
+
+
+
+
+ +
+ + + + +
+

+if file is provided and is writable, it will write the patch into the file +

+

[Source]

+
+
+# File lib/git/diff.rb, line 53
+    def patch(file = nil)
+      cache_full
+      @full_diff
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 22
+    def path(path)
+      @path = path
+      return self
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 27
+    def size
+      cache_stats
+      @stats[:total][:files]
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 47
+    def stats
+      cache_stats
+      @stats
+    end
+
+
+
+
+ +
+ + +
+ to_s(file = nil) +
+ +
+

+Alias for patch +

+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000134.html b/doc/classes/Git/Diff.src/M000134.html new file mode 100644 index 0000000..2b604fe --- /dev/null +++ b/doc/classes/Git/Diff.src/M000134.html @@ -0,0 +1,20 @@ + + + + + + new (Git::Diff) + + + + +
# File lib/git/diff.rb, line 16
+    def initialize(base, from = nil, to = nil)
+      @base = base
+      @from = from.to_s
+      @to = to.to_s
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000135.html b/doc/classes/Git/Diff.src/M000135.html new file mode 100644 index 0000000..345dea9 --- /dev/null +++ b/doc/classes/Git/Diff.src/M000135.html @@ -0,0 +1,19 @@ + + + + + + path (Git::Diff) + + + + +
# File lib/git/diff.rb, line 22
+    def path(path)
+      @path = path
+      return self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000136.html b/doc/classes/Git/Diff.src/M000136.html new file mode 100644 index 0000000..130e4ec --- /dev/null +++ b/doc/classes/Git/Diff.src/M000136.html @@ -0,0 +1,19 @@ + + + + + + size (Git::Diff) + + + + +
# File lib/git/diff.rb, line 27
+    def size
+      cache_stats
+      @stats[:total][:files]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000137.html b/doc/classes/Git/Diff.src/M000137.html new file mode 100644 index 0000000..dc4e5ca --- /dev/null +++ b/doc/classes/Git/Diff.src/M000137.html @@ -0,0 +1,19 @@ + + + + + + lines (Git::Diff) + + + + +
# File lib/git/diff.rb, line 32
+    def lines
+      cache_stats
+      @stats[:total][:lines]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000138.html b/doc/classes/Git/Diff.src/M000138.html new file mode 100644 index 0000000..8a0096a --- /dev/null +++ b/doc/classes/Git/Diff.src/M000138.html @@ -0,0 +1,19 @@ + + + + + + deletions (Git::Diff) + + + + +
# File lib/git/diff.rb, line 37
+    def deletions
+      cache_stats
+      @stats[:total][:deletions]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000139.html b/doc/classes/Git/Diff.src/M000139.html new file mode 100644 index 0000000..b9d6a7b --- /dev/null +++ b/doc/classes/Git/Diff.src/M000139.html @@ -0,0 +1,19 @@ + + + + + + insertions (Git::Diff) + + + + +
# File lib/git/diff.rb, line 42
+    def insertions
+      cache_stats
+      @stats[:total][:insertions]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000140.html b/doc/classes/Git/Diff.src/M000140.html new file mode 100644 index 0000000..4be3161 --- /dev/null +++ b/doc/classes/Git/Diff.src/M000140.html @@ -0,0 +1,19 @@ + + + + + + stats (Git::Diff) + + + + +
# File lib/git/diff.rb, line 47
+    def stats
+      cache_stats
+      @stats
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000141.html b/doc/classes/Git/Diff.src/M000141.html new file mode 100644 index 0000000..83c90bc --- /dev/null +++ b/doc/classes/Git/Diff.src/M000141.html @@ -0,0 +1,19 @@ + + + + + + patch (Git::Diff) + + + + +
# File lib/git/diff.rb, line 53
+    def patch(file = nil)
+      cache_full
+      @full_diff
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000143.html b/doc/classes/Git/Diff.src/M000143.html new file mode 100644 index 0000000..25c3530 --- /dev/null +++ b/doc/classes/Git/Diff.src/M000143.html @@ -0,0 +1,19 @@ + + + + + + [] (Git::Diff) + + + + +
# File lib/git/diff.rb, line 61
+    def [](key)
+      process_full
+      @full_diff_files.assoc(key)[1]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff.src/M000144.html b/doc/classes/Git/Diff.src/M000144.html new file mode 100644 index 0000000..6e5b6b0 --- /dev/null +++ b/doc/classes/Git/Diff.src/M000144.html @@ -0,0 +1,21 @@ + + + + + + each (Git::Diff) + + + + +
# File lib/git/diff.rb, line 66
+    def each
+      process_full
+      @full_diff_files.each do |file|
+        yield file[1]
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff/DiffFile.html b/doc/classes/Git/Diff/DiffFile.html new file mode 100644 index 0000000..ec349f8 --- /dev/null +++ b/doc/classes/Git/Diff/DiffFile.html @@ -0,0 +1,220 @@ + + + + + + Class: Git::Diff::DiffFile + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Diff::DiffFile
In: + + lib/git/diff.rb + +
+
Parent: + Object +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ blob   + new   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
dst [RW] 
mode [RW] 
patch [RW] 
path [RW] 
src [RW] 
type [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 77
+      def initialize(base, hash)
+        @base = base
+        @patch = hash[:patch]
+        @path = hash[:path]
+        @mode = hash[:mode]
+        @src = hash[:src]
+        @dst = hash[:dst]
+        @type = hash[:type]
+      end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/diff.rb, line 87
+      def blob(type = :dst)
+        if type == :src
+          @base.object(@src) if @src != '0000000'
+        else
+          @base.object(@dst) if @dst != '0000000'
+        end
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Diff/DiffFile.src/M000145.html b/doc/classes/Git/Diff/DiffFile.src/M000145.html new file mode 100644 index 0000000..28a82af --- /dev/null +++ b/doc/classes/Git/Diff/DiffFile.src/M000145.html @@ -0,0 +1,24 @@ + + + + + + new (Git::Diff::DiffFile) + + + + +
# File lib/git/diff.rb, line 77
+      def initialize(base, hash)
+        @base = base
+        @patch = hash[:patch]
+        @path = hash[:path]
+        @mode = hash[:mode]
+        @src = hash[:src]
+        @dst = hash[:dst]
+        @type = hash[:type]
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Diff/DiffFile.src/M000146.html b/doc/classes/Git/Diff/DiffFile.src/M000146.html new file mode 100644 index 0000000..46e7228 --- /dev/null +++ b/doc/classes/Git/Diff/DiffFile.src/M000146.html @@ -0,0 +1,22 @@ + + + + + + blob (Git::Diff::DiffFile) + + + + +
# File lib/git/diff.rb, line 87
+      def blob(type = :dst)
+        if type == :src
+          @base.object(@src) if @src != '0000000'
+        else
+          @base.object(@dst) if @dst != '0000000'
+        end
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/GitExecuteError.html b/doc/classes/Git/GitExecuteError.html new file mode 100644 index 0000000..6236a26 --- /dev/null +++ b/doc/classes/Git/GitExecuteError.html @@ -0,0 +1,111 @@ + + + + + + Class: Git::GitExecuteError + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::GitExecuteError
In: + + lib/git/lib.rb + +
+
Parent: + StandardError +
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/GitTagNameDoesNotExist.html b/doc/classes/Git/GitTagNameDoesNotExist.html new file mode 100644 index 0000000..fea5604 --- /dev/null +++ b/doc/classes/Git/GitTagNameDoesNotExist.html @@ -0,0 +1,111 @@ + + + + + + Class: Git::GitTagNameDoesNotExist + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::GitTagNameDoesNotExist
In: + + lib/git/object.rb + +
+
Parent: + StandardError +
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Index.html b/doc/classes/Git/Index.html new file mode 100644 index 0000000..2240422 --- /dev/null +++ b/doc/classes/Git/Index.html @@ -0,0 +1,113 @@ + + + + + + Class: Git::Index + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Index
In: + + lib/git/index.rb + +
+
Parent: + + Git::Path + +
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Lib.html b/doc/classes/Git/Lib.html new file mode 100644 index 0000000..fd3c7b0 --- /dev/null +++ b/doc/classes/Git/Lib.html @@ -0,0 +1,1158 @@ + + + + + + Class: Git::Lib + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Lib
In: + + lib/git/lib.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ add   + branch_current   + branch_delete   + branch_new   + branches_all   + checkout   + clone   + commit   + config_get   + config_list   + config_remote   + config_set   + diff_files   + diff_full   + diff_index   + diff_stats   + fetch   + grep   + init   + log_commits   + ls_files   + merge   + new   + object_contents   + object_size   + object_type   + remote_add   + remote_remove   + remotes   + remove   + repack   + reset   + revparse   + tag   + tag_sha   + tags   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 13
+    def initialize(base = nil)
+      if base.is_a?(Git::Base)
+        @git_dir = base.repo.path
+        @git_index_file = base.index.path   
+        @git_work_dir = base.dir.path
+      elsif base.is_a?(Hash)
+        @git_dir = base[:repository]
+        @git_index_file = base[:index] 
+        @git_work_dir = base[:working_directory]
+      end
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 215
+    def add(path = '.')
+      path = path.join(' ') if path.is_a?(Array)
+      command('add', path)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 96
+    def branch_current
+      branches_all.select { |b| b[1] }.first[0] rescue nil
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 248
+    def branch_delete(branch)
+      command('branch', ['-d', branch])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 244
+    def branch_new(branch)
+      command('branch', branch)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 86
+    def branches_all
+      arr = []
+      command_lines('branch', '-a').each do |b| 
+        current = false
+        current = true if b[0, 2] == '* '
+        arr << [b.gsub('* ', '').strip, current]
+      end
+      arr
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 252
+    def checkout(branch, opts = {})
+      arr_opts = []
+      arr_opts << '-f' if opts[:force]
+      arr_opts << branch.to_s
+      
+      command('checkout', arr_opts)
+    end
+
+
+
+
+ +
+ + + + +
+

+tries to clone the given repo +

+

+returns {:repository} (if bare) +

+
+        {:working_directory} otherwise
+
+

+accepts options: +

+
+ :remote - name of remote (rather than 'origin')
+ :bare   - no working directory
+
+

+TODO - make this work with SSH password or auth_key +

+

[Source]

+
+
+# File lib/git/lib.rb, line 40
+    def clone(repository, name, opts = {})
+      @path = opts[:path] || '.'
+      opts[:path] ? clone_dir = File.join(@path, name) : clone_dir = name
+      
+      arr_opts = []
+      arr_opts << "--bare" if opts[:bare]
+      arr_opts << "-o #{opts[:remote]}" if opts[:remote]
+      arr_opts << repository
+      arr_opts << clone_dir
+      
+      command('clone', arr_opts)
+      
+      opts[:bare] ? {:repository => clone_dir} : {:working_directory => clone_dir}
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 230
+    def commit(message, opts = {})
+      arr_opts = ["-m '#{message}'"]
+      arr_opts << '-a' if opts[:add_all]
+      command('commit', arr_opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 196
+    def config_get(name)
+      command('config', ['--get', name])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 200
+    def config_list
+      hsh = {}
+      command_lines('config', ['--list']).each do |line|
+        (key, value) = line.split('=')
+        hsh[key] = value
+      end
+      hsh
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 187
+    def config_remote(name)
+      hsh = {}
+      command_lines('config', ['--get-regexp', "remote.#{name}"]).each do |line|
+        (key, value) = line.split
+        hsh[key.gsub("remote.#{name}.", '')] = value
+      end
+      hsh
+    end
+
+
+
+
+ +
+ + + + +
+

+WRITE COMMANDS ## +

+

[Source]

+
+
+# File lib/git/lib.rb, line 211
+    def config_set(name, value)
+      command('config', [name, "'#{value}'"])
+    end
+
+
+
+
+ +
+ + + + +
+

+compares the index and the working directory +

+

[Source]

+
+
+# File lib/git/lib.rb, line 153
+    def diff_files
+      hsh = {}
+      command_lines('diff-files').each do |line|
+        (info, file) = line.split("\t")
+        (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
+        hsh[file] = {:path => file, :mode_file => mode_src.to_s[1, 7], :mode_index => mode_dest, 
+                      :sha_file => sha_src, :sha_index => sha_dest, :type => type}
+      end
+      hsh
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 123
+    def diff_full(obj1 = 'HEAD', obj2 = nil, opts = {})
+      diff_opts = ['-p']
+      diff_opts << obj1
+      diff_opts << obj2 if obj2.is_a?(String)
+      diff_opts << ('-- ' + opts[:path_limiter]) if opts[:path_limiter].is_a? String
+      
+      command('diff', diff_opts)
+    end
+
+
+
+
+ +
+ + + + +
+

+compares the index and the repository +

+

[Source]

+
+
+# File lib/git/lib.rb, line 165
+    def diff_index(treeish)
+      hsh = {}
+      command_lines('diff-index', treeish).each do |line|
+        (info, file) = line.split("\t")
+        (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
+        hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest, 
+                      :sha_repo => sha_src, :sha_index => sha_dest, :type => type}
+      end
+      hsh
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 132
+    def diff_stats(obj1 = 'HEAD', obj2 = nil, opts = {})
+      diff_opts = ['--numstat']
+      diff_opts << obj1
+      diff_opts << obj2 if obj2.is_a?(String)
+      diff_opts << ('-- ' + opts[:path_limiter]) if opts[:path_limiter].is_a? String
+      
+      hsh = {:total => {:insertions => 0, :deletions => 0, :lines => 0, :files => 0}, :files => {}}
+      
+      command_lines('diff', diff_opts).each do |file|
+        (insertions, deletions, filename) = file.split("\t")
+        hsh[:total][:insertions] += insertions.to_i
+        hsh[:total][:deletions] += deletions.to_i
+        hsh[:total][:lines] = (hsh[:total][:deletions] + hsh[:total][:insertions])
+        hsh[:total][:files] += 1
+        hsh[:files][filename] = {:insertions => insertions.to_i, :deletions => deletions.to_i}
+      end
+            
+      hsh
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 295
+    def fetch(remote)
+      command('fetch', remote.to_s)
+    end
+
+
+
+
+ +
+ + + + +
+

+returns hash +

+
+
tree-ish
= [[line_no, match], [line_no, match2]] + +
+
tree-ish
= [[line_no, match], [line_no, match2]] + +
+
+

[Source]

+
+
+# File lib/git/lib.rb, line 104
+    def grep(string, opts = {})
+      opts[:object] = 'HEAD' if !opts[:object]
+
+      grep_opts = ['-n']
+      grep_opts << '-i' if opts[:ignore_case]
+      grep_opts << '-v' if opts[:invert_match]
+      grep_opts << "-e '#{string}'"
+      grep_opts << opts[:object] if opts[:object].is_a?(String)
+      grep_opts << ('-- ' + opts[:path_limiter]) if opts[:path_limiter].is_a? String
+      hsh = {}
+      command_lines('grep', grep_opts).each do |line|
+        if m = /(.*)\:(\d+)\:(.*)/.match(line)        
+          hsh[m[1]] ||= []
+          hsh[m[1]] << [m[2].to_i, m[3]] 
+        end
+      end
+      hsh
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 25
+    def init
+      command('init')
+    end
+
+
+
+
+ +
+ + + + +
+

+READ COMMANDS ## +

+

[Source]

+
+
+# File lib/git/lib.rb, line 59
+    def log_commits(opts = {})
+      arr_opts = ['--pretty=oneline']
+      arr_opts << "-#{opts[:count]}" if opts[:count]
+      arr_opts << "--since=\"#{opts[:since]}\"" if opts[:since].is_a? String
+      arr_opts << "#{opts[:between][0]}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
+      arr_opts << opts[:object] if opts[:object].is_a? String
+      arr_opts << '-- ' + opts[:path_limiter] if opts[:path_limiter].is_a? String
+      
+      command_lines('log', arr_opts).map { |l| l.split.first }
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 176
+    def ls_files
+      hsh = {}
+      command_lines('ls-files', '--stage').each do |line|
+        (info, file) = line.split("\t")
+        (mode, sha, stage) = info.split
+        hsh[file] = {:path => file, :mode_index => mode, :sha_index => sha, :stage => stage}
+      end
+      hsh
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 260
+    def merge(branch, message = nil)      
+      arr_opts = []
+      arr_opts << ["-m '#{message}'"] if message
+      arr_opts << branch.to_a.join(' ')
+      command('merge', arr_opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 82
+    def object_contents(sha)
+      command('cat-file', ['-p', sha])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 78
+    def object_size(sha)
+      command('cat-file', ['-s', sha]).to_i
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 74
+    def object_type(sha)
+      command('cat-file', ['-t', sha])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 267
+    def remote_add(name, url, opts = {})
+      arr_opts = ['add']
+      arr_opts << '-f' if opts[:with_fetch]
+      arr_opts << name
+      arr_opts << url
+      
+      command('remote', arr_opts)
+    end
+
+
+
+
+ +
+ + + + +
+

+this is documented as such, but seems broken for some reason i’ll try +to get around it some other way later +

+

[Source]

+
+
+# File lib/git/lib.rb, line 278
+    def remote_remove(name)
+      command('remote', ['rm', name])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 282
+    def remotes
+      command_lines('remote')
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 220
+    def remove(path = '.', opts = {})
+      path = path.join(' ') if path.is_a?(Array)
+
+      arr_opts = ['-f']  # overrides the up-to-date check by default
+      arr_opts << ['-r'] if opts[:recursive]
+      arr_opts << path
+
+      command('rm', arr_opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 303
+    def repack
+      command('repack', ['-a', '-d'])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 236
+    def reset(commit, opts = {})
+      arr_opts = []
+      arr_opts << '--hard' if opts[:hard]
+      arr_opts << commit.to_s if commit
+      command('reset', arr_opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 70
+    def revparse(string)
+      command('rev-parse', string)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 290
+    def tag(tag)
+      command('tag', tag)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 299
+    def tag_sha(tag_name)
+      command('show-ref',  ['--tags', '-s', tag_name])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 286
+    def tags
+      command_lines('tag')
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000024.html b/doc/classes/Git/Lib.src/M000024.html new file mode 100644 index 0000000..ba00001 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000024.html @@ -0,0 +1,26 @@ + + + + + + new (Git::Lib) + + + + +
# File lib/git/lib.rb, line 13
+    def initialize(base = nil)
+      if base.is_a?(Git::Base)
+        @git_dir = base.repo.path
+        @git_index_file = base.index.path   
+        @git_work_dir = base.dir.path
+      elsif base.is_a?(Hash)
+        @git_dir = base[:repository]
+        @git_index_file = base[:index] 
+        @git_work_dir = base[:working_directory]
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000025.html b/doc/classes/Git/Lib.src/M000025.html new file mode 100644 index 0000000..f132706 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000025.html @@ -0,0 +1,18 @@ + + + + + + init (Git::Lib) + + + + +
# File lib/git/lib.rb, line 25
+    def init
+      command('init')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000026.html b/doc/classes/Git/Lib.src/M000026.html new file mode 100644 index 0000000..195e6aa --- /dev/null +++ b/doc/classes/Git/Lib.src/M000026.html @@ -0,0 +1,29 @@ + + + + + + clone (Git::Lib) + + + + +
# File lib/git/lib.rb, line 40
+    def clone(repository, name, opts = {})
+      @path = opts[:path] || '.'
+      opts[:path] ? clone_dir = File.join(@path, name) : clone_dir = name
+      
+      arr_opts = []
+      arr_opts << "--bare" if opts[:bare]
+      arr_opts << "-o #{opts[:remote]}" if opts[:remote]
+      arr_opts << repository
+      arr_opts << clone_dir
+      
+      command('clone', arr_opts)
+      
+      opts[:bare] ? {:repository => clone_dir} : {:working_directory => clone_dir}
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000027.html b/doc/classes/Git/Lib.src/M000027.html new file mode 100644 index 0000000..603256b --- /dev/null +++ b/doc/classes/Git/Lib.src/M000027.html @@ -0,0 +1,25 @@ + + + + + + log_commits (Git::Lib) + + + + +
# File lib/git/lib.rb, line 59
+    def log_commits(opts = {})
+      arr_opts = ['--pretty=oneline']
+      arr_opts << "-#{opts[:count]}" if opts[:count]
+      arr_opts << "--since=\"#{opts[:since]}\"" if opts[:since].is_a? String
+      arr_opts << "#{opts[:between][0]}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
+      arr_opts << opts[:object] if opts[:object].is_a? String
+      arr_opts << '-- ' + opts[:path_limiter] if opts[:path_limiter].is_a? String
+      
+      command_lines('log', arr_opts).map { |l| l.split.first }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000028.html b/doc/classes/Git/Lib.src/M000028.html new file mode 100644 index 0000000..708f1f6 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000028.html @@ -0,0 +1,18 @@ + + + + + + revparse (Git::Lib) + + + + +
# File lib/git/lib.rb, line 70
+    def revparse(string)
+      command('rev-parse', string)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000029.html b/doc/classes/Git/Lib.src/M000029.html new file mode 100644 index 0000000..19ef656 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000029.html @@ -0,0 +1,18 @@ + + + + + + object_type (Git::Lib) + + + + +
# File lib/git/lib.rb, line 74
+    def object_type(sha)
+      command('cat-file', ['-t', sha])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000030.html b/doc/classes/Git/Lib.src/M000030.html new file mode 100644 index 0000000..68a9d40 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000030.html @@ -0,0 +1,18 @@ + + + + + + object_size (Git::Lib) + + + + +
# File lib/git/lib.rb, line 78
+    def object_size(sha)
+      command('cat-file', ['-s', sha]).to_i
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000031.html b/doc/classes/Git/Lib.src/M000031.html new file mode 100644 index 0000000..b821baa --- /dev/null +++ b/doc/classes/Git/Lib.src/M000031.html @@ -0,0 +1,18 @@ + + + + + + object_contents (Git::Lib) + + + + +
# File lib/git/lib.rb, line 82
+    def object_contents(sha)
+      command('cat-file', ['-p', sha])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000032.html b/doc/classes/Git/Lib.src/M000032.html new file mode 100644 index 0000000..7818e4c --- /dev/null +++ b/doc/classes/Git/Lib.src/M000032.html @@ -0,0 +1,24 @@ + + + + + + branches_all (Git::Lib) + + + + +
# File lib/git/lib.rb, line 86
+    def branches_all
+      arr = []
+      command_lines('branch', '-a').each do |b| 
+        current = false
+        current = true if b[0, 2] == '* '
+        arr << [b.gsub('* ', '').strip, current]
+      end
+      arr
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000033.html b/doc/classes/Git/Lib.src/M000033.html new file mode 100644 index 0000000..d10ebc0 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000033.html @@ -0,0 +1,18 @@ + + + + + + branch_current (Git::Lib) + + + + +
# File lib/git/lib.rb, line 96
+    def branch_current
+      branches_all.select { |b| b[1] }.first[0] rescue nil
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000034.html b/doc/classes/Git/Lib.src/M000034.html new file mode 100644 index 0000000..0547151 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000034.html @@ -0,0 +1,33 @@ + + + + + + grep (Git::Lib) + + + + +
# File lib/git/lib.rb, line 104
+    def grep(string, opts = {})
+      opts[:object] = 'HEAD' if !opts[:object]
+
+      grep_opts = ['-n']
+      grep_opts << '-i' if opts[:ignore_case]
+      grep_opts << '-v' if opts[:invert_match]
+      grep_opts << "-e '#{string}'"
+      grep_opts << opts[:object] if opts[:object].is_a?(String)
+      grep_opts << ('-- ' + opts[:path_limiter]) if opts[:path_limiter].is_a? String
+      hsh = {}
+      command_lines('grep', grep_opts).each do |line|
+        if m = /(.*)\:(\d+)\:(.*)/.match(line)        
+          hsh[m[1]] ||= []
+          hsh[m[1]] << [m[2].to_i, m[3]] 
+        end
+      end
+      hsh
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000035.html b/doc/classes/Git/Lib.src/M000035.html new file mode 100644 index 0000000..1fa9b8a --- /dev/null +++ b/doc/classes/Git/Lib.src/M000035.html @@ -0,0 +1,23 @@ + + + + + + diff_full (Git::Lib) + + + + +
# File lib/git/lib.rb, line 123
+    def diff_full(obj1 = 'HEAD', obj2 = nil, opts = {})
+      diff_opts = ['-p']
+      diff_opts << obj1
+      diff_opts << obj2 if obj2.is_a?(String)
+      diff_opts << ('-- ' + opts[:path_limiter]) if opts[:path_limiter].is_a? String
+      
+      command('diff', diff_opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000036.html b/doc/classes/Git/Lib.src/M000036.html new file mode 100644 index 0000000..4f5044b --- /dev/null +++ b/doc/classes/Git/Lib.src/M000036.html @@ -0,0 +1,34 @@ + + + + + + diff_stats (Git::Lib) + + + + +
# File lib/git/lib.rb, line 132
+    def diff_stats(obj1 = 'HEAD', obj2 = nil, opts = {})
+      diff_opts = ['--numstat']
+      diff_opts << obj1
+      diff_opts << obj2 if obj2.is_a?(String)
+      diff_opts << ('-- ' + opts[:path_limiter]) if opts[:path_limiter].is_a? String
+      
+      hsh = {:total => {:insertions => 0, :deletions => 0, :lines => 0, :files => 0}, :files => {}}
+      
+      command_lines('diff', diff_opts).each do |file|
+        (insertions, deletions, filename) = file.split("\t")
+        hsh[:total][:insertions] += insertions.to_i
+        hsh[:total][:deletions] += deletions.to_i
+        hsh[:total][:lines] = (hsh[:total][:deletions] + hsh[:total][:insertions])
+        hsh[:total][:files] += 1
+        hsh[:files][filename] = {:insertions => insertions.to_i, :deletions => deletions.to_i}
+      end
+            
+      hsh
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000037.html b/doc/classes/Git/Lib.src/M000037.html new file mode 100644 index 0000000..aada203 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000037.html @@ -0,0 +1,25 @@ + + + + + + diff_files (Git::Lib) + + + + +
# File lib/git/lib.rb, line 153
+    def diff_files
+      hsh = {}
+      command_lines('diff-files').each do |line|
+        (info, file) = line.split("\t")
+        (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
+        hsh[file] = {:path => file, :mode_file => mode_src.to_s[1, 7], :mode_index => mode_dest, 
+                      :sha_file => sha_src, :sha_index => sha_dest, :type => type}
+      end
+      hsh
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000038.html b/doc/classes/Git/Lib.src/M000038.html new file mode 100644 index 0000000..2460d42 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000038.html @@ -0,0 +1,25 @@ + + + + + + diff_index (Git::Lib) + + + + +
# File lib/git/lib.rb, line 165
+    def diff_index(treeish)
+      hsh = {}
+      command_lines('diff-index', treeish).each do |line|
+        (info, file) = line.split("\t")
+        (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
+        hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest, 
+                      :sha_repo => sha_src, :sha_index => sha_dest, :type => type}
+      end
+      hsh
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000039.html b/doc/classes/Git/Lib.src/M000039.html new file mode 100644 index 0000000..34a272c --- /dev/null +++ b/doc/classes/Git/Lib.src/M000039.html @@ -0,0 +1,24 @@ + + + + + + ls_files (Git::Lib) + + + + +
# File lib/git/lib.rb, line 176
+    def ls_files
+      hsh = {}
+      command_lines('ls-files', '--stage').each do |line|
+        (info, file) = line.split("\t")
+        (mode, sha, stage) = info.split
+        hsh[file] = {:path => file, :mode_index => mode, :sha_index => sha, :stage => stage}
+      end
+      hsh
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000040.html b/doc/classes/Git/Lib.src/M000040.html new file mode 100644 index 0000000..9eeed74 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000040.html @@ -0,0 +1,23 @@ + + + + + + config_remote (Git::Lib) + + + + +
# File lib/git/lib.rb, line 187
+    def config_remote(name)
+      hsh = {}
+      command_lines('config', ['--get-regexp', "remote.#{name}"]).each do |line|
+        (key, value) = line.split
+        hsh[key.gsub("remote.#{name}.", '')] = value
+      end
+      hsh
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000041.html b/doc/classes/Git/Lib.src/M000041.html new file mode 100644 index 0000000..05b40e2 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000041.html @@ -0,0 +1,18 @@ + + + + + + config_get (Git::Lib) + + + + +
# File lib/git/lib.rb, line 196
+    def config_get(name)
+      command('config', ['--get', name])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000042.html b/doc/classes/Git/Lib.src/M000042.html new file mode 100644 index 0000000..d1c0fdd --- /dev/null +++ b/doc/classes/Git/Lib.src/M000042.html @@ -0,0 +1,23 @@ + + + + + + config_list (Git::Lib) + + + + +
# File lib/git/lib.rb, line 200
+    def config_list
+      hsh = {}
+      command_lines('config', ['--list']).each do |line|
+        (key, value) = line.split('=')
+        hsh[key] = value
+      end
+      hsh
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000043.html b/doc/classes/Git/Lib.src/M000043.html new file mode 100644 index 0000000..c9eb5b3 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000043.html @@ -0,0 +1,18 @@ + + + + + + config_set (Git::Lib) + + + + +
# File lib/git/lib.rb, line 211
+    def config_set(name, value)
+      command('config', [name, "'#{value}'"])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000044.html b/doc/classes/Git/Lib.src/M000044.html new file mode 100644 index 0000000..47a4a41 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000044.html @@ -0,0 +1,19 @@ + + + + + + add (Git::Lib) + + + + +
# File lib/git/lib.rb, line 215
+    def add(path = '.')
+      path = path.join(' ') if path.is_a?(Array)
+      command('add', path)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000045.html b/doc/classes/Git/Lib.src/M000045.html new file mode 100644 index 0000000..9de6f9e --- /dev/null +++ b/doc/classes/Git/Lib.src/M000045.html @@ -0,0 +1,24 @@ + + + + + + remove (Git::Lib) + + + + +
# File lib/git/lib.rb, line 220
+    def remove(path = '.', opts = {})
+      path = path.join(' ') if path.is_a?(Array)
+
+      arr_opts = ['-f']  # overrides the up-to-date check by default
+      arr_opts << ['-r'] if opts[:recursive]
+      arr_opts << path
+
+      command('rm', arr_opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000046.html b/doc/classes/Git/Lib.src/M000046.html new file mode 100644 index 0000000..22bbb94 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000046.html @@ -0,0 +1,20 @@ + + + + + + commit (Git::Lib) + + + + +
# File lib/git/lib.rb, line 230
+    def commit(message, opts = {})
+      arr_opts = ["-m '#{message}'"]
+      arr_opts << '-a' if opts[:add_all]
+      command('commit', arr_opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000047.html b/doc/classes/Git/Lib.src/M000047.html new file mode 100644 index 0000000..03f68f1 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000047.html @@ -0,0 +1,21 @@ + + + + + + reset (Git::Lib) + + + + +
# File lib/git/lib.rb, line 236
+    def reset(commit, opts = {})
+      arr_opts = []
+      arr_opts << '--hard' if opts[:hard]
+      arr_opts << commit.to_s if commit
+      command('reset', arr_opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000048.html b/doc/classes/Git/Lib.src/M000048.html new file mode 100644 index 0000000..b33f1ce --- /dev/null +++ b/doc/classes/Git/Lib.src/M000048.html @@ -0,0 +1,18 @@ + + + + + + branch_new (Git::Lib) + + + + +
# File lib/git/lib.rb, line 244
+    def branch_new(branch)
+      command('branch', branch)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000049.html b/doc/classes/Git/Lib.src/M000049.html new file mode 100644 index 0000000..5910442 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000049.html @@ -0,0 +1,18 @@ + + + + + + branch_delete (Git::Lib) + + + + +
# File lib/git/lib.rb, line 248
+    def branch_delete(branch)
+      command('branch', ['-d', branch])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000050.html b/doc/classes/Git/Lib.src/M000050.html new file mode 100644 index 0000000..cb3c14e --- /dev/null +++ b/doc/classes/Git/Lib.src/M000050.html @@ -0,0 +1,22 @@ + + + + + + checkout (Git::Lib) + + + + +
# File lib/git/lib.rb, line 252
+    def checkout(branch, opts = {})
+      arr_opts = []
+      arr_opts << '-f' if opts[:force]
+      arr_opts << branch.to_s
+      
+      command('checkout', arr_opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000051.html b/doc/classes/Git/Lib.src/M000051.html new file mode 100644 index 0000000..6df355b --- /dev/null +++ b/doc/classes/Git/Lib.src/M000051.html @@ -0,0 +1,21 @@ + + + + + + merge (Git::Lib) + + + + +
# File lib/git/lib.rb, line 260
+    def merge(branch, message = nil)      
+      arr_opts = []
+      arr_opts << ["-m '#{message}'"] if message
+      arr_opts << branch.to_a.join(' ')
+      command('merge', arr_opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000052.html b/doc/classes/Git/Lib.src/M000052.html new file mode 100644 index 0000000..275232d --- /dev/null +++ b/doc/classes/Git/Lib.src/M000052.html @@ -0,0 +1,23 @@ + + + + + + remote_add (Git::Lib) + + + + +
# File lib/git/lib.rb, line 267
+    def remote_add(name, url, opts = {})
+      arr_opts = ['add']
+      arr_opts << '-f' if opts[:with_fetch]
+      arr_opts << name
+      arr_opts << url
+      
+      command('remote', arr_opts)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000053.html b/doc/classes/Git/Lib.src/M000053.html new file mode 100644 index 0000000..14665fa --- /dev/null +++ b/doc/classes/Git/Lib.src/M000053.html @@ -0,0 +1,18 @@ + + + + + + remote_remove (Git::Lib) + + + + +
# File lib/git/lib.rb, line 278
+    def remote_remove(name)
+      command('remote', ['rm', name])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000054.html b/doc/classes/Git/Lib.src/M000054.html new file mode 100644 index 0000000..12b9aa6 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000054.html @@ -0,0 +1,18 @@ + + + + + + remotes (Git::Lib) + + + + +
# File lib/git/lib.rb, line 282
+    def remotes
+      command_lines('remote')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000055.html b/doc/classes/Git/Lib.src/M000055.html new file mode 100644 index 0000000..b8ee19c --- /dev/null +++ b/doc/classes/Git/Lib.src/M000055.html @@ -0,0 +1,18 @@ + + + + + + tags (Git::Lib) + + + + +
# File lib/git/lib.rb, line 286
+    def tags
+      command_lines('tag')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000056.html b/doc/classes/Git/Lib.src/M000056.html new file mode 100644 index 0000000..341892d --- /dev/null +++ b/doc/classes/Git/Lib.src/M000056.html @@ -0,0 +1,18 @@ + + + + + + tag (Git::Lib) + + + + +
# File lib/git/lib.rb, line 290
+    def tag(tag)
+      command('tag', tag)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000057.html b/doc/classes/Git/Lib.src/M000057.html new file mode 100644 index 0000000..26bb882 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000057.html @@ -0,0 +1,18 @@ + + + + + + fetch (Git::Lib) + + + + +
# File lib/git/lib.rb, line 295
+    def fetch(remote)
+      command('fetch', remote.to_s)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000058.html b/doc/classes/Git/Lib.src/M000058.html new file mode 100644 index 0000000..8bea02a --- /dev/null +++ b/doc/classes/Git/Lib.src/M000058.html @@ -0,0 +1,18 @@ + + + + + + tag_sha (Git::Lib) + + + + +
# File lib/git/lib.rb, line 299
+    def tag_sha(tag_name)
+      command('show-ref',  ['--tags', '-s', tag_name])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Lib.src/M000059.html b/doc/classes/Git/Lib.src/M000059.html new file mode 100644 index 0000000..7a16479 --- /dev/null +++ b/doc/classes/Git/Lib.src/M000059.html @@ -0,0 +1,18 @@ + + + + + + repack (Git::Lib) + + + + +
# File lib/git/lib.rb, line 303
+    def repack
+      command('repack', ['-a', '-d'])
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.html b/doc/classes/Git/Log.html new file mode 100644 index 0000000..08fff11 --- /dev/null +++ b/doc/classes/Git/Log.html @@ -0,0 +1,373 @@ + + + + + + Class: Git::Log + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Log
In: + + lib/git/log.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ +
+

+object that holds the last X commits on given branch +

+ +
+ + +
+ +
+

Methods

+ +
+ between   + each   + first   + new   + object   + path   + since   + size   + to_s   +
+
+ +
+ + + +
+

Included Modules

+ +
+ Enumerable +
+
+ +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 18
+    def initialize(base, count = 30)
+      dirty_log
+      @base = base
+      @count = count
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 42
+    def between(sha1, sha2 = nil)
+      dirty_log
+      @between = [@base.lib.revparse(sha1), @base.lib.revparse(sha2)]
+      return self
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 60
+    def each
+      check_log
+      @commits.each do |c|
+        yield c
+      end
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 67
+    def first
+      check_log
+      @commits.first rescue nil
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 24
+    def object(objectish)
+      dirty_log
+      @object = objectish
+      return self
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 30
+    def path(path)
+      dirty_log
+      @path = path
+      return self
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 36
+    def since(date)
+      dirty_log
+      @since = date
+      return self
+    end
+
+
+
+
+ +
+ + + + +
+

+forces git log to run +

+

[Source]

+
+
+# File lib/git/log.rb, line 55
+    def size
+      check_log
+      @commits.size rescue nil
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/log.rb, line 48
+    def to_s
+      self.map { |c| c.sha }.join("\n")
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000015.html b/doc/classes/Git/Log.src/M000015.html new file mode 100644 index 0000000..b271cff --- /dev/null +++ b/doc/classes/Git/Log.src/M000015.html @@ -0,0 +1,20 @@ + + + + + + new (Git::Log) + + + + +
# File lib/git/log.rb, line 18
+    def initialize(base, count = 30)
+      dirty_log
+      @base = base
+      @count = count
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000016.html b/doc/classes/Git/Log.src/M000016.html new file mode 100644 index 0000000..cfa23ec --- /dev/null +++ b/doc/classes/Git/Log.src/M000016.html @@ -0,0 +1,20 @@ + + + + + + object (Git::Log) + + + + +
# File lib/git/log.rb, line 24
+    def object(objectish)
+      dirty_log
+      @object = objectish
+      return self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000017.html b/doc/classes/Git/Log.src/M000017.html new file mode 100644 index 0000000..f23edde --- /dev/null +++ b/doc/classes/Git/Log.src/M000017.html @@ -0,0 +1,20 @@ + + + + + + path (Git::Log) + + + + +
# File lib/git/log.rb, line 30
+    def path(path)
+      dirty_log
+      @path = path
+      return self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000018.html b/doc/classes/Git/Log.src/M000018.html new file mode 100644 index 0000000..a246fa9 --- /dev/null +++ b/doc/classes/Git/Log.src/M000018.html @@ -0,0 +1,20 @@ + + + + + + since (Git::Log) + + + + +
# File lib/git/log.rb, line 36
+    def since(date)
+      dirty_log
+      @since = date
+      return self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000019.html b/doc/classes/Git/Log.src/M000019.html new file mode 100644 index 0000000..ca0e931 --- /dev/null +++ b/doc/classes/Git/Log.src/M000019.html @@ -0,0 +1,20 @@ + + + + + + between (Git::Log) + + + + +
# File lib/git/log.rb, line 42
+    def between(sha1, sha2 = nil)
+      dirty_log
+      @between = [@base.lib.revparse(sha1), @base.lib.revparse(sha2)]
+      return self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000020.html b/doc/classes/Git/Log.src/M000020.html new file mode 100644 index 0000000..89cc408 --- /dev/null +++ b/doc/classes/Git/Log.src/M000020.html @@ -0,0 +1,18 @@ + + + + + + to_s (Git::Log) + + + + +
# File lib/git/log.rb, line 48
+    def to_s
+      self.map { |c| c.sha }.join("\n")
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000021.html b/doc/classes/Git/Log.src/M000021.html new file mode 100644 index 0000000..96836a9 --- /dev/null +++ b/doc/classes/Git/Log.src/M000021.html @@ -0,0 +1,19 @@ + + + + + + size (Git::Log) + + + + +
# File lib/git/log.rb, line 55
+    def size
+      check_log
+      @commits.size rescue nil
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000022.html b/doc/classes/Git/Log.src/M000022.html new file mode 100644 index 0000000..f231ce1 --- /dev/null +++ b/doc/classes/Git/Log.src/M000022.html @@ -0,0 +1,21 @@ + + + + + + each (Git::Log) + + + + +
# File lib/git/log.rb, line 60
+    def each
+      check_log
+      @commits.each do |c|
+        yield c
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Log.src/M000023.html b/doc/classes/Git/Log.src/M000023.html new file mode 100644 index 0000000..f6a7520 --- /dev/null +++ b/doc/classes/Git/Log.src/M000023.html @@ -0,0 +1,19 @@ + + + + + + first (Git::Log) + + + + +
# File lib/git/log.rb, line 67
+    def first
+      check_log
+      @commits.first rescue nil
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object.html b/doc/classes/Git/Object.html new file mode 100644 index 0000000..499a044 --- /dev/null +++ b/doc/classes/Git/Object.html @@ -0,0 +1,179 @@ + + + + + + Class: Git::Object + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Object
In: + + lib/git/object.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ new   +
+
+ +
+ + + + +
+ +
+

Classes and Modules

+ + Class Git::Object::AbstractObject
+Class Git::Object::Blob
+Class Git::Object::Commit
+Class Git::Object::Tag
+Class Git::Object::Tree
+ +
+ + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

+if we’re calling this, we don’t know what type it is yet so +this is our little factory method +

+

[Source]

+
+
+# File lib/git/object.rb, line 87
+      def new(base, objectish, is_tag = false)
+        if is_tag
+          sha = base.lib.tag_sha(objectish)
+          if sha == ''
+            raise Git::GitTagNameDoesNotExist.new(objectish)
+          end
+          return Tag.new(base, sha, objectish)
+        else
+          sha = base.lib.revparse(objectish)
+          type = base.lib.object_type(sha) 
+        end
+        
+        klass =
+          case type
+          when /blob/:   Blob   
+          when /commit/: Commit
+          when /tree/:   Tree
+          end
+        klass::new(base, sha)
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Object.src/M000120.html b/doc/classes/Git/Object.src/M000120.html new file mode 100644 index 0000000..72e5490 --- /dev/null +++ b/doc/classes/Git/Object.src/M000120.html @@ -0,0 +1,35 @@ + + + + + + new (Git::Object) + + + + +
# File lib/git/object.rb, line 87
+      def new(base, objectish, is_tag = false)
+        if is_tag
+          sha = base.lib.tag_sha(objectish)
+          if sha == ''
+            raise Git::GitTagNameDoesNotExist.new(objectish)
+          end
+          return Tag.new(base, sha, objectish)
+        else
+          sha = base.lib.revparse(objectish)
+          type = base.lib.object_type(sha) 
+        end
+        
+        klass =
+          case type
+          when /blob/:   Blob   
+          when /commit/: Commit
+          when /tree/:   Tree
+          end
+        klass::new(base, sha)
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.html b/doc/classes/Git/Object/AbstractObject.html new file mode 100644 index 0000000..e2569c4 --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.html @@ -0,0 +1,349 @@ + + + + + + Class: Git::Object::AbstractObject + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Object::AbstractObject
In: + + lib/git/object.rb + +
+
Parent: + Object +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ contents   + contents_array   + diff   + grep   + log   + new   + setup   + to_s   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + + + + + + + + + + + + + + + + +
mode [RW] 
sha [RW] 
size [RW] 
type [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 13
+      def initialize(base, sha)
+        @base = base
+        @sha = sha
+        @size = @base.lib.object_size(@sha)
+        setup
+      end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 20
+      def contents
+        @base.lib.object_contents(@sha)
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 24
+      def contents_array
+        self.contents.split("\n")
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 42
+      def diff(objectish)
+        Git::Diff.new(@base, @sha, objectish)
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 36
+      def grep(string, path_limiter = nil, opts = {})
+        default = {:object => @sha, :path_limiter => path_limiter}
+        grep_options = default.merge(opts)
+        @base.lib.grep(string, grep_options)
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 46
+      def log(count = 30)
+        Git::Log.new(@base, count).object(@sha)
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 28
+      def setup
+        raise NotImplementedError
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 32
+      def to_s
+        @sha
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000122.html b/doc/classes/Git/Object/AbstractObject.src/M000122.html new file mode 100644 index 0000000..a43468f --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000122.html @@ -0,0 +1,21 @@ + + + + + + new (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 13
+      def initialize(base, sha)
+        @base = base
+        @sha = sha
+        @size = @base.lib.object_size(@sha)
+        setup
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000123.html b/doc/classes/Git/Object/AbstractObject.src/M000123.html new file mode 100644 index 0000000..261ed9d --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000123.html @@ -0,0 +1,18 @@ + + + + + + contents (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 20
+      def contents
+        @base.lib.object_contents(@sha)
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000124.html b/doc/classes/Git/Object/AbstractObject.src/M000124.html new file mode 100644 index 0000000..2bfbdc8 --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000124.html @@ -0,0 +1,18 @@ + + + + + + contents_array (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 24
+      def contents_array
+        self.contents.split("\n")
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000125.html b/doc/classes/Git/Object/AbstractObject.src/M000125.html new file mode 100644 index 0000000..88e36d8 --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000125.html @@ -0,0 +1,18 @@ + + + + + + setup (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 28
+      def setup
+        raise NotImplementedError
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000126.html b/doc/classes/Git/Object/AbstractObject.src/M000126.html new file mode 100644 index 0000000..b37a7fe --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000126.html @@ -0,0 +1,18 @@ + + + + + + to_s (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 32
+      def to_s
+        @sha
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000127.html b/doc/classes/Git/Object/AbstractObject.src/M000127.html new file mode 100644 index 0000000..11b43c6 --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000127.html @@ -0,0 +1,20 @@ + + + + + + grep (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 36
+      def grep(string, path_limiter = nil, opts = {})
+        default = {:object => @sha, :path_limiter => path_limiter}
+        grep_options = default.merge(opts)
+        @base.lib.grep(string, grep_options)
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000128.html b/doc/classes/Git/Object/AbstractObject.src/M000128.html new file mode 100644 index 0000000..8a352c7 --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000128.html @@ -0,0 +1,18 @@ + + + + + + diff (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 42
+      def diff(objectish)
+        Git::Diff.new(@base, @sha, objectish)
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/AbstractObject.src/M000129.html b/doc/classes/Git/Object/AbstractObject.src/M000129.html new file mode 100644 index 0000000..c7b1dac --- /dev/null +++ b/doc/classes/Git/Object/AbstractObject.src/M000129.html @@ -0,0 +1,18 @@ + + + + + + log (Git::Object::AbstractObject) + + + + +
# File lib/git/object.rb, line 46
+      def log(count = 30)
+        Git::Log.new(@base, count).object(@sha)
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/Blob.html b/doc/classes/Git/Object/Blob.html new file mode 100644 index 0000000..dd3048d --- /dev/null +++ b/doc/classes/Git/Object/Blob.html @@ -0,0 +1,148 @@ + + + + + + Class: Git::Object::Blob + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Object::Blob
In: + + lib/git/object.rb + +
+
Parent: + + AbstractObject + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ setup   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 54
+      def setup
+        @type = 'blob'
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Object/Blob.src/M000132.html b/doc/classes/Git/Object/Blob.src/M000132.html new file mode 100644 index 0000000..73983e4 --- /dev/null +++ b/doc/classes/Git/Object/Blob.src/M000132.html @@ -0,0 +1,18 @@ + + + + + + setup (Git::Object::Blob) + + + + +
# File lib/git/object.rb, line 54
+      def setup
+        @type = 'blob'
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/Commit.html b/doc/classes/Git/Object/Commit.html new file mode 100644 index 0000000..18d4e1b --- /dev/null +++ b/doc/classes/Git/Object/Commit.html @@ -0,0 +1,148 @@ + + + + + + Class: Git::Object::Commit + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Object::Commit
In: + + lib/git/object.rb + +
+
Parent: + + AbstractObject + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ setup   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 66
+      def setup
+        @type = 'commit'
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Object/Commit.src/M000121.html b/doc/classes/Git/Object/Commit.src/M000121.html new file mode 100644 index 0000000..4391b29 --- /dev/null +++ b/doc/classes/Git/Object/Commit.src/M000121.html @@ -0,0 +1,18 @@ + + + + + + setup (Git::Object::Commit) + + + + +
# File lib/git/object.rb, line 66
+      def setup
+        @type = 'commit'
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/Tag.html b/doc/classes/Git/Object/Tag.html new file mode 100644 index 0000000..9055eff --- /dev/null +++ b/doc/classes/Git/Object/Tag.html @@ -0,0 +1,188 @@ + + + + + + Class: Git::Object::Tag + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Object::Tag
In: + + lib/git/object.rb + +
+
Parent: + + AbstractObject + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ new   + setup   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + +
name [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 74
+      def initialize(base, sha, name)
+        super(base, sha)
+        @name = name
+      end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 79
+      def setup
+        @type = 'tag'
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Object/Tag.src/M000130.html b/doc/classes/Git/Object/Tag.src/M000130.html new file mode 100644 index 0000000..5bc3f6c --- /dev/null +++ b/doc/classes/Git/Object/Tag.src/M000130.html @@ -0,0 +1,19 @@ + + + + + + new (Git::Object::Tag) + + + + +
# File lib/git/object.rb, line 74
+      def initialize(base, sha, name)
+        super(base, sha)
+        @name = name
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/Tag.src/M000131.html b/doc/classes/Git/Object/Tag.src/M000131.html new file mode 100644 index 0000000..1daa7e2 --- /dev/null +++ b/doc/classes/Git/Object/Tag.src/M000131.html @@ -0,0 +1,18 @@ + + + + + + setup (Git::Object::Tag) + + + + +
# File lib/git/object.rb, line 79
+      def setup
+        @type = 'tag'
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Object/Tree.html b/doc/classes/Git/Object/Tree.html new file mode 100644 index 0000000..9204e5f --- /dev/null +++ b/doc/classes/Git/Object/Tree.html @@ -0,0 +1,148 @@ + + + + + + Class: Git::Object::Tree + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Object::Tree
In: + + lib/git/object.rb + +
+
Parent: + + AbstractObject + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ setup   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 60
+      def setup
+        @type = 'tree'
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Object/Tree.src/M000133.html b/doc/classes/Git/Object/Tree.src/M000133.html new file mode 100644 index 0000000..eb465c8 --- /dev/null +++ b/doc/classes/Git/Object/Tree.src/M000133.html @@ -0,0 +1,18 @@ + + + + + + setup (Git::Object::Tree) + + + + +
# File lib/git/object.rb, line 60
+      def setup
+        @type = 'tree'
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Path.html b/doc/classes/Git/Path.html new file mode 100644 index 0000000..0b1f892 --- /dev/null +++ b/doc/classes/Git/Path.html @@ -0,0 +1,215 @@ + + + + + + Class: Git::Path + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Path
In: + + lib/git/path.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ new   + readable?   + writable?   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + +
path [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/path.rb, line 6
+    def initialize(path, check_path = true)
+      if !check_path || File.exists?(path)
+        @path = File.expand_path(path)
+      else
+        raise ArgumentError, "path does not exist", File.expand_path(path)
+      end
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/path.rb, line 14
+    def readable?
+      File.readable?(@path)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/path.rb, line 18
+    def writable?
+      File.writable?(@path)
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Path.src/M000117.html b/doc/classes/Git/Path.src/M000117.html new file mode 100644 index 0000000..3dbb37e --- /dev/null +++ b/doc/classes/Git/Path.src/M000117.html @@ -0,0 +1,22 @@ + + + + + + new (Git::Path) + + + + +
# File lib/git/path.rb, line 6
+    def initialize(path, check_path = true)
+      if !check_path || File.exists?(path)
+        @path = File.expand_path(path)
+      else
+        raise ArgumentError, "path does not exist", File.expand_path(path)
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Path.src/M000118.html b/doc/classes/Git/Path.src/M000118.html new file mode 100644 index 0000000..8e32c35 --- /dev/null +++ b/doc/classes/Git/Path.src/M000118.html @@ -0,0 +1,18 @@ + + + + + + readable? (Git::Path) + + + + +
# File lib/git/path.rb, line 14
+    def readable?
+      File.readable?(@path)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Path.src/M000119.html b/doc/classes/Git/Path.src/M000119.html new file mode 100644 index 0000000..ad963a4 --- /dev/null +++ b/doc/classes/Git/Path.src/M000119.html @@ -0,0 +1,18 @@ + + + + + + writable? (Git::Path) + + + + +
# File lib/git/path.rb, line 18
+    def writable?
+      File.writable?(@path)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Remote.html b/doc/classes/Git/Remote.html new file mode 100644 index 0000000..fbef922 --- /dev/null +++ b/doc/classes/Git/Remote.html @@ -0,0 +1,324 @@ + + + + + + Class: Git::Remote + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Remote
In: + + lib/git/remote.rb + +
+
Parent: + + Path + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ branch   + fetch   + merge   + new   + remove   + remove   + to_s   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + + + + + + + + + + + +
fetch_opts [RW] 
name [RW] 
url [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/remote.rb, line 8
+    def initialize(base, name)
+      @base = base
+      config = @base.lib.config_remote(name)
+      @name = name
+      @url = config['url']
+      @fetch_opts = config['fetch']
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/remote.rb, line 29
+    def branch(branch = 'master')
+      Git::Branch.new(@base, "#{@name}/#{branch}")
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/remote.rb, line 20
+    def fetch
+      @base.fetch(@name)
+    end
+
+
+
+
+ +
+ + + + +
+

+merge this remote locally +

+

[Source]

+
+
+# File lib/git/remote.rb, line 25
+    def merge(branch = 'master')
+      @base.merge("#{@name}/#{branch}")
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/remote.rb, line 16
+    def remove
+      @base.remote_remove(@name)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/remote.rb, line 33
+    def remove
+      @base.lib.remote_remove(@name)     
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/remote.rb, line 37
+    def to_s
+      @name
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Remote.src/M000147.html b/doc/classes/Git/Remote.src/M000147.html new file mode 100644 index 0000000..f1de21e --- /dev/null +++ b/doc/classes/Git/Remote.src/M000147.html @@ -0,0 +1,22 @@ + + + + + + new (Git::Remote) + + + + +
# File lib/git/remote.rb, line 8
+    def initialize(base, name)
+      @base = base
+      config = @base.lib.config_remote(name)
+      @name = name
+      @url = config['url']
+      @fetch_opts = config['fetch']
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Remote.src/M000148.html b/doc/classes/Git/Remote.src/M000148.html new file mode 100644 index 0000000..ff83d29 --- /dev/null +++ b/doc/classes/Git/Remote.src/M000148.html @@ -0,0 +1,18 @@ + + + + + + remove (Git::Remote) + + + + +
# File lib/git/remote.rb, line 16
+    def remove
+      @base.remote_remove(@name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Remote.src/M000149.html b/doc/classes/Git/Remote.src/M000149.html new file mode 100644 index 0000000..170a1bd --- /dev/null +++ b/doc/classes/Git/Remote.src/M000149.html @@ -0,0 +1,18 @@ + + + + + + fetch (Git::Remote) + + + + +
# File lib/git/remote.rb, line 20
+    def fetch
+      @base.fetch(@name)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Remote.src/M000150.html b/doc/classes/Git/Remote.src/M000150.html new file mode 100644 index 0000000..78c200e --- /dev/null +++ b/doc/classes/Git/Remote.src/M000150.html @@ -0,0 +1,18 @@ + + + + + + merge (Git::Remote) + + + + +
# File lib/git/remote.rb, line 25
+    def merge(branch = 'master')
+      @base.merge("#{@name}/#{branch}")
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Remote.src/M000151.html b/doc/classes/Git/Remote.src/M000151.html new file mode 100644 index 0000000..e21742d --- /dev/null +++ b/doc/classes/Git/Remote.src/M000151.html @@ -0,0 +1,18 @@ + + + + + + branch (Git::Remote) + + + + +
# File lib/git/remote.rb, line 29
+    def branch(branch = 'master')
+      Git::Branch.new(@base, "#{@name}/#{branch}")
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Remote.src/M000152.html b/doc/classes/Git/Remote.src/M000152.html new file mode 100644 index 0000000..300f6fc --- /dev/null +++ b/doc/classes/Git/Remote.src/M000152.html @@ -0,0 +1,18 @@ + + + + + + remove (Git::Remote) + + + + +
# File lib/git/remote.rb, line 33
+    def remove
+      @base.lib.remote_remove(@name)     
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Remote.src/M000153.html b/doc/classes/Git/Remote.src/M000153.html new file mode 100644 index 0000000..4469ace --- /dev/null +++ b/doc/classes/Git/Remote.src/M000153.html @@ -0,0 +1,18 @@ + + + + + + to_s (Git::Remote) + + + + +
# File lib/git/remote.rb, line 37
+    def to_s
+      @name
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Repository.html b/doc/classes/Git/Repository.html new file mode 100644 index 0000000..9d8927a --- /dev/null +++ b/doc/classes/Git/Repository.html @@ -0,0 +1,113 @@ + + + + + + Class: Git::Repository + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Repository
In: + + lib/git/repository.rb + +
+
Parent: + + Path + +
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Status.html b/doc/classes/Git/Status.html new file mode 100644 index 0000000..81f64d9 --- /dev/null +++ b/doc/classes/Git/Status.html @@ -0,0 +1,348 @@ + + + + + + Class: Git::Status + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Status
In: + + lib/git/status.rb + +
+
Parent: + + Object + +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ []   + added   + changed   + deleted   + each   + new   + pretty   + untracked   +
+
+ +
+ + + +
+

Included Modules

+ +
+ Enumerable +
+
+ +
+ +
+

Classes and Modules

+ + Class Git::Status::StatusFile
+ +
+ + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 9
+    def initialize(base)
+      @base = base
+      construct_status
+    end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

+enumerable method +

+

[Source]

+
+
+# File lib/git/status.rb, line 47
+    def [](file)
+      @files[file]
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 18
+    def added
+      @files.select { |k, f| f.type == 'A' }
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 14
+    def changed
+      @files.select { |k, f| f.type == 'M' }
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 22
+    def deleted
+      @files.select { |k, f| f.type == 'D' }
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 51
+    def each
+      @files.each do |k, file|
+        yield file
+      end
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 30
+    def pretty
+      out = ''
+      self.each do |file|
+        out << file.path
+        out << "\n\tsha(r) " + file.sha_repo.to_s + ' ' + file.mode_repo.to_s
+        out << "\n\tsha(i) " + file.sha_index.to_s + ' ' + file.mode_index.to_s
+        out << "\n\ttype   " + file.type.to_s
+        out << "\n\tstage  " + file.stage.to_s
+        out << "\n\tuntrac " + file.untracked.to_s
+        out << "\n"
+      end
+      out << "\n"
+      out
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 26
+    def untracked
+      @files.select { |k, f| f.untracked }
+    end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000005.html b/doc/classes/Git/Status.src/M000005.html new file mode 100644 index 0000000..7a61284 --- /dev/null +++ b/doc/classes/Git/Status.src/M000005.html @@ -0,0 +1,19 @@ + + + + + + new (Git::Status) + + + + +
# File lib/git/status.rb, line 9
+    def initialize(base)
+      @base = base
+      construct_status
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000006.html b/doc/classes/Git/Status.src/M000006.html new file mode 100644 index 0000000..cefe7e6 --- /dev/null +++ b/doc/classes/Git/Status.src/M000006.html @@ -0,0 +1,18 @@ + + + + + + changed (Git::Status) + + + + +
# File lib/git/status.rb, line 14
+    def changed
+      @files.select { |k, f| f.type == 'M' }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000007.html b/doc/classes/Git/Status.src/M000007.html new file mode 100644 index 0000000..09fd966 --- /dev/null +++ b/doc/classes/Git/Status.src/M000007.html @@ -0,0 +1,18 @@ + + + + + + added (Git::Status) + + + + +
# File lib/git/status.rb, line 18
+    def added
+      @files.select { |k, f| f.type == 'A' }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000008.html b/doc/classes/Git/Status.src/M000008.html new file mode 100644 index 0000000..67834e4 --- /dev/null +++ b/doc/classes/Git/Status.src/M000008.html @@ -0,0 +1,18 @@ + + + + + + deleted (Git::Status) + + + + +
# File lib/git/status.rb, line 22
+    def deleted
+      @files.select { |k, f| f.type == 'D' }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000009.html b/doc/classes/Git/Status.src/M000009.html new file mode 100644 index 0000000..d3bf8f1 --- /dev/null +++ b/doc/classes/Git/Status.src/M000009.html @@ -0,0 +1,18 @@ + + + + + + untracked (Git::Status) + + + + +
# File lib/git/status.rb, line 26
+    def untracked
+      @files.select { |k, f| f.untracked }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000010.html b/doc/classes/Git/Status.src/M000010.html new file mode 100644 index 0000000..cd8897e --- /dev/null +++ b/doc/classes/Git/Status.src/M000010.html @@ -0,0 +1,29 @@ + + + + + + pretty (Git::Status) + + + + +
# File lib/git/status.rb, line 30
+    def pretty
+      out = ''
+      self.each do |file|
+        out << file.path
+        out << "\n\tsha(r) " + file.sha_repo.to_s + ' ' + file.mode_repo.to_s
+        out << "\n\tsha(i) " + file.sha_index.to_s + ' ' + file.mode_index.to_s
+        out << "\n\ttype   " + file.type.to_s
+        out << "\n\tstage  " + file.stage.to_s
+        out << "\n\tuntrac " + file.untracked.to_s
+        out << "\n"
+      end
+      out << "\n"
+      out
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000011.html b/doc/classes/Git/Status.src/M000011.html new file mode 100644 index 0000000..146326a --- /dev/null +++ b/doc/classes/Git/Status.src/M000011.html @@ -0,0 +1,18 @@ + + + + + + [] (Git::Status) + + + + +
# File lib/git/status.rb, line 47
+    def [](file)
+      @files[file]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status.src/M000012.html b/doc/classes/Git/Status.src/M000012.html new file mode 100644 index 0000000..03b742b --- /dev/null +++ b/doc/classes/Git/Status.src/M000012.html @@ -0,0 +1,20 @@ + + + + + + each (Git::Status) + + + + +
# File lib/git/status.rb, line 51
+    def each
+      @files.each do |k, file|
+        yield file
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status/StatusFile.html b/doc/classes/Git/Status/StatusFile.html new file mode 100644 index 0000000..c1a0b2f --- /dev/null +++ b/doc/classes/Git/Status/StatusFile.html @@ -0,0 +1,232 @@ + + + + + + Class: Git::Status::StatusFile + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::Status::StatusFile
In: + + lib/git/status.rb + +
+
Parent: + Object +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ blob   + new   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
mode_index [RW] 
mode_repo [RW] 
path [RW] 
sha_index [RW] 
sha_repo [RW] 
stage [RW] 
type [RW] 
untracked [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 64
+      def initialize(base, hash)
+        @base = base
+        @path = hash[:path]
+        @type = hash[:type]
+        @stage = hash[:stage]
+        @mode_index = hash[:mode_index]
+        @mode_repo = hash[:mode_repo]
+        @sha_index = hash[:sha_index]
+        @sha_repo = hash[:sha_repo]
+        @untracked = hash[:untracked]
+      end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/status.rb, line 76
+      def blob(type = :index)
+        if type == :repo
+          @base.object(@sha_repo)
+        else
+          @base.object(@sha_index) rescue @base.object(@sha_repo)
+        end
+      end
+
+
+
+
+ + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/doc/classes/Git/Status/StatusFile.src/M000013.html b/doc/classes/Git/Status/StatusFile.src/M000013.html new file mode 100644 index 0000000..3a1699b --- /dev/null +++ b/doc/classes/Git/Status/StatusFile.src/M000013.html @@ -0,0 +1,26 @@ + + + + + + new (Git::Status::StatusFile) + + + + +
# File lib/git/status.rb, line 64
+      def initialize(base, hash)
+        @base = base
+        @path = hash[:path]
+        @type = hash[:type]
+        @stage = hash[:stage]
+        @mode_index = hash[:mode_index]
+        @mode_repo = hash[:mode_repo]
+        @sha_index = hash[:sha_index]
+        @sha_repo = hash[:sha_repo]
+        @untracked = hash[:untracked]
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/Status/StatusFile.src/M000014.html b/doc/classes/Git/Status/StatusFile.src/M000014.html new file mode 100644 index 0000000..6ddc339 --- /dev/null +++ b/doc/classes/Git/Status/StatusFile.src/M000014.html @@ -0,0 +1,22 @@ + + + + + + blob (Git::Status::StatusFile) + + + + +
# File lib/git/status.rb, line 76
+      def blob(type = :index)
+        if type == :repo
+          @base.object(@sha_repo)
+        else
+          @base.object(@sha_index) rescue @base.object(@sha_repo)
+        end
+      end
+ + \ No newline at end of file diff --git a/doc/classes/Git/WorkingDirectory.html b/doc/classes/Git/WorkingDirectory.html new file mode 100644 index 0000000..89b1753 --- /dev/null +++ b/doc/classes/Git/WorkingDirectory.html @@ -0,0 +1,113 @@ + + + + + + Class: Git::WorkingDirectory + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassGit::WorkingDirectory
In: + + lib/git/working_directory.rb + +
+
Parent: + + Git::Path + +
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/created.rid b/doc/created.rid new file mode 100644 index 0000000..e14a536 --- /dev/null +++ b/doc/created.rid @@ -0,0 +1 @@ +Sun Nov 11 17:55:02 PST 2007 diff --git a/doc/files/EXAMPLES.html b/doc/files/EXAMPLES.html new file mode 100644 index 0000000..ef92243 --- /dev/null +++ b/doc/files/EXAMPLES.html @@ -0,0 +1,268 @@ + + + + + + File: EXAMPLES + + + + + + + + + + +
+

EXAMPLES

+ + + + + + + + + +
Path:EXAMPLES +
Last Update:Sun Nov 11 17:51:57 PST 2007
+
+ + +
+ + + +
+ +
+

+require ‘git’ +

+

+# needs read permission only +

+

+g = Git.open (working_dir = +’.’) +

+
+       (git_dir, index_file)
+
+

+g.index g.index.readable? g.index.writable? g.repo g.dir +

+

+g.log # returns array of Git::Commit objects g.log.since(‘2 weeks +ago’) g.log.between(‘v2.5’, ‘v2.6’) +g.log.each {|l| puts l.sha } +g.gblob(‘v2.5:Makefile’).log.since(‘2 weeks ago’) +

+

+g.object(‘HEAD^’).to_s # git show / git rev-parse +g.object(‘HEAD^’).contents +g.object(‘v2.5:Makefile’).size +g.object(‘v2.5:Makefile’).sha +

+

+g.gtree(treeish) g.gblob(treeish) g.gcommit(treeish) +

+

+g.revparse(‘v2.5:Makefile’) +

+

+g.branches # returns Git::Branch +objects g.branches.local g.branches.remote g.branches[:master].gcommit +g.branches[‘origin/master’].gcommit +

+

+g.grep(‘hello’) # implies HEAD +g.blob(‘v2.5:Makefile’).grep(‘hello’) +g.tag(‘v2.5’).grep(‘hello’, ‘docs/’) +

+

+g.diff(commit1, commit2).size g.diff(commit1, commit2).stats +g.gtree(‘v2.5’).diff(‘v2.6’).insertions +g.diff(‘gitsearch1’, +‘v2.5’).path(‘lib/’) +g.diff(‘gitsearch1’, @git.gtree(‘v2.5’)) +g.diff(‘gitsearch1’, +‘v2.5’).path(‘docs/’).patch +g.gtree(‘v2.5’).diff(‘v2.6’).patch +

+

+g.gtree(‘v2.5’).diff(‘v2.6’).each do |file_diff| +

+
+  puts file_diff.path
+  puts file_diff.patch
+  puts file_diff.blob(:src).contents
+
+

+end +

+

+g.config(‘user.name’) # returns ‘Scott Chacon’ +g.config # returns whole config hash +

+

+g.tag # returns array of Git::Tag objects +

+

+# needs write permission +

+

+g = Git.init +

+
+  Git.init('project')
+  Git.init('/home/schacon/proj',
+              { :git_dir => '/opt/git/proj.git',
+                  :index_file => '/tmp/index'} )
+
+

+g = Git.clone(URI, :name => +‘name’, :path => ’/tmp/checkout‘ +

+
+       (git_dir, index_file)
+
+

+g.config(‘user.name’, ‘Scott Chacon’) +g.config(‘user.email’, ‘email@email.com’) +

+

+g.add(’.’) g.add([file1, file2]) +

+

+g.remove(‘file.txt’) g.remove([‘file.txt’, +‘file2.txt’]) +

+

+g.commit(‘message’) g.commit_all(‘message’) +

+

+g = Git.clone(repo, +‘myrepo’) Dir.chdir(‘myrepo’) do +

+
+ new_file('test-file', 'blahblahblah')
+ g.status.untracked.each do |file|
+  puts file.blob(:index).contents
+ end
+
+

+end +

+

+g.reset # defaults to HEAD g.reset_hard(Git::Commit) +

+

+g.branch(‘new_branch’) # creates new or fetches existing +g.branch(‘new_branch’).checkout +g.branch(‘new_branch’).delete +g.branch(‘existing_branch’).checkout +

+

+g.checkout(‘new_branch’) +g.checkout(g.branch(‘new_branch’)) +

+

+g.branch(name).merge(branch2) g.branch(branch2).merge # merges HEAD with +branch2 +

+

+g.branch(name).in_branch(message) { # add files } # auto-commits +g.merge(‘new_branch’) +g.merge(‘origin/remote_branch’) +g.merge(b.branch(‘master’)) g.merge([branch1, branch2]) +

+

+r = g.add_remote(name, uri) # Git::Remote r = g.add_remote(name, Git::Base) # Git::Remote +

+

+g.remotes # array of Git::Remotes g.remote(name).fetch +g.remote(name).remove g.remote(name).merge g.remote(name).merge(branch) +

+

+g.fetch g.fetch(g.remotes.first) +

+

+g.pull g.pull(Git::Repo, Git::Branch) # fetch and a merge +

+

+g.add_tag(‘tag_name’) # returns Git::Tag +

+

+g.repack +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/README.html b/doc/files/README.html new file mode 100644 index 0000000..3179ce1 --- /dev/null +++ b/doc/files/README.html @@ -0,0 +1,119 @@ + + + + + + File: README + + + + + + + + + + +
+

README

+ + + + + + + + + +
Path:README +
Last Update:Sun Nov 11 17:55:00 PST 2007
+
+ + +
+ + + +
+ +
+

Git Library for Ruby

+

What it is

+

+Library for using Git in Ruby. +

+

Roadmap

+

+Right now I’m forking calls to the ‘git’ binary, but +eventually I’ll replace that with either C bindings to libgit or +libgit-thin, or I’ll write pure ruby handlers for at least some of +the Git stuff. +

+

+See EXAMPLES file for, well, examples. +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/base_rb.html b/doc/files/lib/git/base_rb.html new file mode 100644 index 0000000..4e8dfee --- /dev/null +++ b/doc/files/lib/git/base_rb.html @@ -0,0 +1,101 @@ + + + + + + File: base.rb + + + + + + + + + + +
+

base.rb

+ + + + + + + + + +
Path:lib/git/base.rb +
Last Update:Sun Nov 11 16:46:30 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/branch_rb.html b/doc/files/lib/git/branch_rb.html new file mode 100644 index 0000000..2c79e83 --- /dev/null +++ b/doc/files/lib/git/branch_rb.html @@ -0,0 +1,101 @@ + + + + + + File: branch.rb + + + + + + + + + + +
+

branch.rb

+ + + + + + + + + +
Path:lib/git/branch.rb +
Last Update:Sun Nov 11 17:19:18 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/branches_rb.html b/doc/files/lib/git/branches_rb.html new file mode 100644 index 0000000..52608d1 --- /dev/null +++ b/doc/files/lib/git/branches_rb.html @@ -0,0 +1,101 @@ + + + + + + File: branches.rb + + + + + + + + + + +
+

branches.rb

+ + + + + + + + + +
Path:lib/git/branches.rb +
Last Update:Sun Nov 11 12:10:49 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/diff_rb.html b/doc/files/lib/git/diff_rb.html new file mode 100644 index 0000000..79849e7 --- /dev/null +++ b/doc/files/lib/git/diff_rb.html @@ -0,0 +1,101 @@ + + + + + + File: diff.rb + + + + + + + + + + +
+

diff.rb

+ + + + + + + + + +
Path:lib/git/diff.rb +
Last Update:Sat Nov 10 11:50:45 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/index_rb.html b/doc/files/lib/git/index_rb.html new file mode 100644 index 0000000..c4d1cfa --- /dev/null +++ b/doc/files/lib/git/index_rb.html @@ -0,0 +1,101 @@ + + + + + + File: index.rb + + + + + + + + + + +
+

index.rb

+ + + + + + + + + +
Path:lib/git/index.rb +
Last Update:Wed Nov 07 15:40:20 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/lib_rb.html b/doc/files/lib/git/lib_rb.html new file mode 100644 index 0000000..7bbabc2 --- /dev/null +++ b/doc/files/lib/git/lib_rb.html @@ -0,0 +1,101 @@ + + + + + + File: lib.rb + + + + + + + + + + +
+

lib.rb

+ + + + + + + + + +
Path:lib/git/lib.rb +
Last Update:Sun Nov 11 17:17:50 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/log_rb.html b/doc/files/lib/git/log_rb.html new file mode 100644 index 0000000..0d10862 --- /dev/null +++ b/doc/files/lib/git/log_rb.html @@ -0,0 +1,101 @@ + + + + + + File: log.rb + + + + + + + + + + +
+

log.rb

+ + + + + + + + + +
Path:lib/git/log.rb +
Last Update:Fri Nov 09 12:34:33 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/object_rb.html b/doc/files/lib/git/object_rb.html new file mode 100644 index 0000000..8ea73f7 --- /dev/null +++ b/doc/files/lib/git/object_rb.html @@ -0,0 +1,101 @@ + + + + + + File: object.rb + + + + + + + + + + +
+

object.rb

+ + + + + + + + + +
Path:lib/git/object.rb +
Last Update:Sun Nov 11 15:59:01 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/path_rb.html b/doc/files/lib/git/path_rb.html new file mode 100644 index 0000000..edc7fbf --- /dev/null +++ b/doc/files/lib/git/path_rb.html @@ -0,0 +1,101 @@ + + + + + + File: path.rb + + + + + + + + + + +
+

path.rb

+ + + + + + + + + +
Path:lib/git/path.rb +
Last Update:Sat Nov 10 15:17:16 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/remote_rb.html b/doc/files/lib/git/remote_rb.html new file mode 100644 index 0000000..4f89827 --- /dev/null +++ b/doc/files/lib/git/remote_rb.html @@ -0,0 +1,101 @@ + + + + + + File: remote.rb + + + + + + + + + + +
+

remote.rb

+ + + + + + + + + +
Path:lib/git/remote.rb +
Last Update:Sun Nov 11 15:16:54 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/repository_rb.html b/doc/files/lib/git/repository_rb.html new file mode 100644 index 0000000..0880eb3 --- /dev/null +++ b/doc/files/lib/git/repository_rb.html @@ -0,0 +1,101 @@ + + + + + + File: repository.rb + + + + + + + + + + +
+

repository.rb

+ + + + + + + + + +
Path:lib/git/repository.rb +
Last Update:Thu Nov 08 17:43:06 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/status_rb.html b/doc/files/lib/git/status_rb.html new file mode 100644 index 0000000..3ebce23 --- /dev/null +++ b/doc/files/lib/git/status_rb.html @@ -0,0 +1,101 @@ + + + + + + File: status.rb + + + + + + + + + + +
+

status.rb

+ + + + + + + + + +
Path:lib/git/status.rb +
Last Update:Sun Nov 11 11:20:53 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git/working_directory_rb.html b/doc/files/lib/git/working_directory_rb.html new file mode 100644 index 0000000..c90324d --- /dev/null +++ b/doc/files/lib/git/working_directory_rb.html @@ -0,0 +1,101 @@ + + + + + + File: working_directory.rb + + + + + + + + + + +
+

working_directory.rb

+ + + + + + + + + +
Path:lib/git/working_directory.rb +
Last Update:Sat Nov 10 16:15:20 PST 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/files/lib/git_rb.html b/doc/files/lib/git_rb.html new file mode 100644 index 0000000..49e7ce6 --- /dev/null +++ b/doc/files/lib/git_rb.html @@ -0,0 +1,127 @@ + + + + + + File: git.rb + + + + + + + + + + +
+

git.rb

+ + + + + + + + + +
Path:lib/git.rb +
Last Update:Sat Nov 10 16:21:26 PST 2007
+
+ + +
+ + + +
+ +
+

+Add the directory containing this file to the start of the load path if it +isn’t there already. +

+ +
+ +
+

Required files

+ +
+ git/base   + git/path   + git/lib   + git/repository   + git/index   + git/working_directory   + git/log   + git/object   + git/branches   + git/branch   + git/remote   + git/diff   + git/status   +
+
+ +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/doc/fr_class_index.html b/doc/fr_class_index.html new file mode 100644 index 0000000..2d3002e --- /dev/null +++ b/doc/fr_class_index.html @@ -0,0 +1,49 @@ + + + + + + + + Classes + + + + + + + + \ No newline at end of file diff --git a/doc/fr_file_index.html b/doc/fr_file_index.html new file mode 100644 index 0000000..83c920c --- /dev/null +++ b/doc/fr_file_index.html @@ -0,0 +1,42 @@ + + + + + + + + Files + + + + + + + + \ No newline at end of file diff --git a/doc/fr_method_index.html b/doc/fr_method_index.html new file mode 100644 index 0000000..4a3b21f --- /dev/null +++ b/doc/fr_method_index.html @@ -0,0 +1,179 @@ + + + + + + + + Methods + + + + + +
+

Methods

+
+ [] (Git::Branches)
+ [] (Git::Status)
+ [] (Git::Diff)
+ add (Git::Base)
+ add (Git::Lib)
+ add_remote (Git::Base)
+ add_tag (Git::Base)
+ added (Git::Status)
+ bare (Git)
+ bare (Git::Base)
+ between (Git::Log)
+ blob (Git::Diff::DiffFile)
+ blob (Git::Status::StatusFile)
+ branch (Git::Remote)
+ branch (Git::Base)
+ branch_current (Git::Lib)
+ branch_delete (Git::Lib)
+ branch_new (Git::Lib)
+ branches (Git::Base)
+ branches_all (Git::Lib)
+ changed (Git::Status)
+ chdir (Git::Base)
+ checkout (Git::Lib)
+ checkout (Git::Base)
+ checkout (Git::Branch)
+ clone (Git::Lib)
+ clone (Git)
+ clone (Git::Base)
+ commit (Git::Lib)
+ commit (Git::Base)
+ commit_all (Git::Base)
+ config (Git::Base)
+ config_get (Git::Lib)
+ config_list (Git::Lib)
+ config_remote (Git::Lib)
+ config_set (Git::Lib)
+ contents (Git::Object::AbstractObject)
+ contents_array (Git::Object::AbstractObject)
+ create (Git::Branch)
+ current (Git::Branch)
+ current_branch (Git::Base)
+ delete (Git::Branch)
+ deleted (Git::Status)
+ deletions (Git::Diff)
+ diff (Git::Base)
+ diff (Git::Object::AbstractObject)
+ diff_files (Git::Lib)
+ diff_full (Git::Lib)
+ diff_index (Git::Lib)
+ diff_stats (Git::Lib)
+ dir (Git::Base)
+ each (Git::Log)
+ each (Git::Status)
+ each (Git::Diff)
+ each (Git::Branches)
+ fetch (Git::Remote)
+ fetch (Git::Lib)
+ fetch (Git::Base)
+ first (Git::Log)
+ gblob (Git::Base)
+ gcommit (Git::Branch)
+ gcommit (Git::Base)
+ grep (Git::Object::AbstractObject)
+ grep (Git::Lib)
+ grep (Git::Base)
+ gtree (Git::Base)
+ in_branch (Git::Branch)
+ index (Git::Base)
+ init (Git::Lib)
+ init (Git::Base)
+ init (Git)
+ insertions (Git::Diff)
+ lib (Git::Base)
+ lines (Git::Diff)
+ local (Git::Branches)
+ log (Git::Base)
+ log (Git::Object::AbstractObject)
+ log_commits (Git::Lib)
+ ls_files (Git::Lib)
+ merge (Git::Lib)
+ merge (Git::Branch)
+ merge (Git::Remote)
+ merge (Git::Base)
+ new (Git::Remote)
+ new (Git::Status::StatusFile)
+ new (Git::Diff)
+ new (Git::Branch)
+ new (Git::Diff::DiffFile)
+ new (Git::Object::Tag)
+ new (Git::Base)
+ new (Git::Log)
+ new (Git::Object::AbstractObject)
+ new (Git::Lib)
+ new (Git::Object)
+ new (Git::Status)
+ new (Git::Branches)
+ new (Git::Path)
+ object (Git::Log)
+ object (Git::Base)
+ object_contents (Git::Lib)
+ object_size (Git::Lib)
+ object_type (Git::Lib)
+ open (Git)
+ open (Git::Base)
+ patch (Git::Diff)
+ path (Git::Diff)
+ path (Git::Log)
+ pretty (Git::Status)
+ pull (Git::Base)
+ readable? (Git::Path)
+ remote (Git::Branches)
+ remote (Git::Base)
+ remote_add (Git::Lib)
+ remote_remove (Git::Lib)
+ remotes (Git::Lib)
+ remotes (Git::Base)
+ remove (Git::Base)
+ remove (Git::Remote)
+ remove (Git::Remote)
+ remove (Git::Lib)
+ repack (Git::Lib)
+ repack (Git::Base)
+ repo (Git::Base)
+ repo_size (Git::Base)
+ reset (Git::Base)
+ reset (Git::Lib)
+ reset_hard (Git::Base)
+ revparse (Git::Base)
+ revparse (Git::Lib)
+ setup (Git::Object::Blob)
+ setup (Git::Object::Tag)
+ setup (Git::Object::Commit)
+ setup (Git::Object::AbstractObject)
+ setup (Git::Object::Tree)
+ since (Git::Log)
+ size (Git::Log)
+ size (Git::Diff)
+ size (Git::Branches)
+ stats (Git::Diff)
+ status (Git::Base)
+ tag (Git::Base)
+ tag (Git::Lib)
+ tag_sha (Git::Lib)
+ tags (Git::Lib)
+ tags (Git::Base)
+ to_a (Git::Branch)
+ to_s (Git::Diff)
+ to_s (Git::Object::AbstractObject)
+ to_s (Git::Branch)
+ to_s (Git::Log)
+ to_s (Git::Remote)
+ untracked (Git::Status)
+ writable? (Git::Path)
+
+
+ + \ No newline at end of file diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..fa5d583 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,24 @@ + + + + + + + RDoc Documentation + + + + + + + + + + + \ No newline at end of file diff --git a/doc/rdoc-style.css b/doc/rdoc-style.css new file mode 100644 index 0000000..44c7b3d --- /dev/null +++ b/doc/rdoc-style.css @@ -0,0 +1,208 @@ + +body { + font-family: Verdana,Arial,Helvetica,sans-serif; + font-size: 90%; + margin: 0; + margin-left: 40px; + padding: 0; + background: white; +} + +h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; } +h1 { font-size: 150%; } +h2,h3,h4 { margin-top: 1em; } + +a { background: #eef; color: #039; text-decoration: none; } +a:hover { background: #039; color: #eef; } + +/* Override the base stylesheet's Anchor inside a table cell */ +td > a { + background: transparent; + color: #039; + text-decoration: none; +} + +/* and inside a section title */ +.section-title > a { + background: transparent; + color: #eee; + text-decoration: none; +} + +/* === Structural elements =================================== */ + +div#index { + margin: 0; + margin-left: -40px; + padding: 0; + font-size: 90%; +} + + +div#index a { + margin-left: 0.7em; +} + +div#index .section-bar { + margin-left: 0px; + padding-left: 0.7em; + background: #ccc; + font-size: small; +} + + +div#classHeader, div#fileHeader { + width: auto; + color: white; + padding: 0.5em 1.5em 0.5em 1.5em; + margin: 0; + margin-left: -40px; + border-bottom: 3px solid #006; +} + +div#classHeader a, div#fileHeader a { + background: inherit; + color: white; +} + +div#classHeader td, div#fileHeader td { + background: inherit; + color: white; +} + + +div#fileHeader { + background: #057; +} + +div#classHeader { + background: #048; +} + + +.class-name-in-header { + font-size: 180%; + font-weight: bold; +} + + +div#bodyContent { + padding: 0 1.5em 0 1.5em; +} + +div#description { + padding: 0.5em 1.5em; + background: #efefef; + border: 1px dotted #999; +} + +div#description h1,h2,h3,h4,h5,h6 { + color: #125;; + background: transparent; +} + +div#validator-badges { + text-align: center; +} +div#validator-badges img { border: 0; } + +div#copyright { + color: #333; + background: #efefef; + font: 0.75em sans-serif; + margin-top: 5em; + margin-bottom: 0; + padding: 0.5em 2em; +} + + +/* === Classes =================================== */ + +table.header-table { + color: white; + font-size: small; +} + +.type-note { + font-size: small; + color: #DEDEDE; +} + +.xxsection-bar { + background: #eee; + color: #333; + padding: 3px; +} + +.section-bar { + color: #333; + border-bottom: 1px solid #999; + margin-left: -20px; +} + + +.section-title { + background: #79a; + color: #eee; + padding: 3px; + margin-top: 2em; + margin-left: -30px; + border: 1px solid #999; +} + +.top-aligned-row { vertical-align: top } +.bottom-aligned-row { vertical-align: bottom } + +/* --- Context section classes ----------------------- */ + +.context-row { } +.context-item-name { font-family: monospace; font-weight: bold; color: black; } +.context-item-value { font-size: small; color: #448; } +.context-item-desc { color: #333; padding-left: 2em; } + +/* --- Method classes -------------------------- */ +.method-detail { + background: #efefef; + padding: 0; + margin-top: 0.5em; + margin-bottom: 1em; + border: 1px dotted #ccc; +} +.method-heading { + color: black; + background: #ccc; + border-bottom: 1px solid #666; + padding: 0.2em 0.5em 0 0.5em; +} +.method-signature { color: black; background: inherit; } +.method-name { font-weight: bold; } +.method-args { font-style: italic; } +.method-description { padding: 0 0.5em 0 0.5em; } + +/* --- Source code sections -------------------- */ + +a.source-toggle { font-size: 90%; } +div.method-source-code { + background: #262626; + color: #ffdead; + margin: 1em; + padding: 0.5em; + border: 1px dashed #999; + overflow: hidden; +} + +div.method-source-code pre { color: #ffdead; overflow: hidden; } + +/* --- Ruby keyword styles --------------------- */ + +.standalone-code { background: #221111; color: #ffdead; overflow: hidden; } + +.ruby-constant { color: #7fffd4; background: transparent; } +.ruby-keyword { color: #00ffff; background: transparent; } +.ruby-ivar { color: #eedd82; background: transparent; } +.ruby-operator { color: #00ffee; background: transparent; } +.ruby-identifier { color: #ffdead; background: transparent; } +.ruby-node { color: #ffa07a; background: transparent; } +.ruby-comment { color: #b22222; font-weight: bold; background: transparent; } +.ruby-regexp { color: #ffa07a; background: transparent; } +.ruby-value { color: #7fffd4; background: transparent; } \ No newline at end of file diff --git a/lib/git/branch.rb b/lib/git/branch.rb index 4b4ecfc..7cef94e 100644 --- a/lib/git/branch.rb +++ b/lib/git/branch.rb @@ -72,6 +72,10 @@ module Git end end + def to_a + [@full] + end + def to_s @full end diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 3f97929..5bb2e2b 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -257,7 +257,7 @@ module Git command('checkout', arr_opts) end - def merge(branch, message = nil) + def merge(branch, message = nil) arr_opts = [] arr_opts << ["-m '#{message}'"] if message arr_opts << branch.to_a.join(' ') @@ -330,7 +330,7 @@ module Git if $?.exitstatus == 1 && out == '' return '' end - raise Git::GitExecuteError.new(git_cmd + out.to_s) + raise Git::GitExecuteError.new(git_cmd + ':' + out.to_s) end out end -- 2.11.4.GIT