summaryrefslogtreecommitdiffstats
path: root/lib/git/lib.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/lib.rb')
-rw-r--r--lib/git/lib.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/git/lib.rb b/lib/git/lib.rb
new file mode 100644
index 0000000..3df049c
--- /dev/null
+++ b/lib/git/lib.rb
@@ -0,0 +1,22 @@
+module Git
+ class Lib
+
+ @base = nil
+
+ def initialize(base)
+ @base = base
+ end
+
+ def log_shas(count)
+ command('log', "-#{count} --pretty=oneline").split("\n").map { |l| Git::Commit.new(l.split.first) }
+ end
+
+ private
+
+ def command(cmd, opts)
+ ENV['GIT_DIR'] = @base.repo.path
+ `git #{cmd} #{opts}`
+ end
+
+ end
+end \ No newline at end of file