From e93f1603f53f5d62798cd246222b32ea43729314 Mon Sep 17 00:00:00 2001 From: Valera Sizov Date: Sat, 8 Oct 2011 15:15:24 -0700 Subject: [PATCH] transition to gem git --- Gemfile | 3 +-- Gemfile.lock | 6 ++---- lib/gitosis.rb | 11 ++++------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index 466ab3275..bf64a37a3 100644 --- a/Gemfile +++ b/Gemfile @@ -14,12 +14,11 @@ gem 'six' gem 'therubyracer' gem 'faker' gem 'seed-fu', :branch => 'rails-3-1', :git => 'git://github.com/mbleigh/seed-fu.git' -gem "lockfile" gem "inifile" -gem "net-ssh" gem "albino", :git => "git://github.com/randx/albino.git" gem "kaminari" gem "thin" +gem "git" group :assets do gem 'sass-rails', " ~> 3.1.0" diff --git a/Gemfile.lock b/Gemfile.lock index e15f7123d..dd97bd671 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -97,6 +97,7 @@ GEM faker (0.9.5) i18n (~> 0.4) ffi (1.0.9) + git (1.2.5) grit (2.4.1) diff-lcs (~> 1.1) mime-types (~> 1.15) @@ -121,14 +122,12 @@ GEM libv8 (3.3.10.2) linecache19 (0.5.12) ruby_core_source (>= 0.1.4) - lockfile (1.4.3) mail (2.3.0) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.16) multi_json (1.0.3) - net-ssh (2.2.1) nokogiri (1.5.0) orm_adapter (0.0.5) polyglot (0.3.2) @@ -247,14 +246,13 @@ DEPENDENCIES database_cleaner devise (= 1.4.7) faker + git grit haml-rails inifile jquery-rails kaminari launchy - lockfile - net-ssh rails (= 3.1.0) rails-footnotes (>= 3.7.5.rc4) rspec-rails diff --git a/lib/gitosis.rb b/lib/gitosis.rb index d19fb2396..d0997825f 100644 --- a/lib/gitosis.rb +++ b/lib/gitosis.rb @@ -1,6 +1,4 @@ -require 'lockfile' require 'inifile' -require 'net/ssh' class Gitosis @@ -11,14 +9,13 @@ class Gitosis Dir.mkdir @local_dir # clone repo - `git clone #{GITOSIS['admin_uri']} #{@local_dir}/gitosis` + @repo = Git.clone(GITOSIS['admin_uri'], "#{@local_dir}/gitosis") end def push - # add, commit, push, and remove local tmp dir - `cd #{File.join(@local_dir,'gitosis')} ; git add keydir/* gitosis.conf` - `cd #{File.join(@local_dir,'gitosis')} ; git commit -a -m 'updated by Gitlab Gitosis'` - `cd #{File.join(@local_dir,'gitosis')} ; git push` + @repo.add('.') + @repo.commit_all "Gitlab" + @repo.push # remove local copy `rm -Rf #{@local_dir}` -- 2.11.0