Commit e93f1603f53f5d62798cd246222b32ea43729314

Authored by Valera Sizov
1 parent b19a04f5

transition to gem git

Showing 3 changed files with 7 additions and 13 deletions   Show diff stats
Gemfile
... ... @@ -14,12 +14,11 @@ gem 'six'
14 14 gem 'therubyracer'
15 15 gem 'faker'
16 16 gem 'seed-fu', :branch => 'rails-3-1', :git => 'git://github.com/mbleigh/seed-fu.git'
17   -gem "lockfile"
18 17 gem "inifile"
19   -gem "net-ssh"
20 18 gem "albino", :git => "git://github.com/randx/albino.git"
21 19 gem "kaminari"
22 20 gem "thin"
  21 +gem "git"
23 22  
24 23 group :assets do
25 24 gem 'sass-rails', " ~> 3.1.0"
... ...
Gemfile.lock
... ... @@ -97,6 +97,7 @@ GEM
97 97 faker (0.9.5)
98 98 i18n (~> 0.4)
99 99 ffi (1.0.9)
  100 + git (1.2.5)
100 101 grit (2.4.1)
101 102 diff-lcs (~> 1.1)
102 103 mime-types (~> 1.15)
... ... @@ -121,14 +122,12 @@ GEM
121 122 libv8 (3.3.10.2)
122 123 linecache19 (0.5.12)
123 124 ruby_core_source (>= 0.1.4)
124   - lockfile (1.4.3)
125 125 mail (2.3.0)
126 126 i18n (>= 0.4.0)
127 127 mime-types (~> 1.16)
128 128 treetop (~> 1.4.8)
129 129 mime-types (1.16)
130 130 multi_json (1.0.3)
131   - net-ssh (2.2.1)
132 131 nokogiri (1.5.0)
133 132 orm_adapter (0.0.5)
134 133 polyglot (0.3.2)
... ... @@ -247,14 +246,13 @@ DEPENDENCIES
247 246 database_cleaner
248 247 devise (= 1.4.7)
249 248 faker
  249 + git
250 250 grit
251 251 haml-rails
252 252 inifile
253 253 jquery-rails
254 254 kaminari
255 255 launchy
256   - lockfile
257   - net-ssh
258 256 rails (= 3.1.0)
259 257 rails-footnotes (>= 3.7.5.rc4)
260 258 rspec-rails
... ...
lib/gitosis.rb
1   -require 'lockfile'
2 1 require 'inifile'
3   -require 'net/ssh'
4 2  
5 3 class Gitosis
6 4  
... ... @@ -11,14 +9,13 @@ class Gitosis
11 9 Dir.mkdir @local_dir
12 10  
13 11 # clone repo
14   - `git clone #{GITOSIS['admin_uri']} #{@local_dir}/gitosis`
  12 + @repo = Git.clone(GITOSIS['admin_uri'], "#{@local_dir}/gitosis")
15 13 end
16 14  
17 15 def push
18   - # add, commit, push, and remove local tmp dir
19   - `cd #{File.join(@local_dir,'gitosis')} ; git add keydir/* gitosis.conf`
20   - `cd #{File.join(@local_dir,'gitosis')} ; git commit -a -m 'updated by Gitlab Gitosis'`
21   - `cd #{File.join(@local_dir,'gitosis')} ; git push`
  16 + @repo.add('.')
  17 + @repo.commit_all "Gitlab"
  18 + @repo.push
22 19  
23 20 # remove local copy
24 21 `rm -Rf #{@local_dir}`
... ...