Commit a18ce409431dfad00af137bf3983bb0f456d2485

Authored by Dmitriy Zaporozhets
1 parent 4524ba20

Revert "First step with rugged"

This reverts commit 4524ba20b804dacccbaca3c37e781adc82c5e0d3.
Gemfile
... ... @@ -22,7 +22,6 @@ gem 'omniauth-twitter'
22 22 gem 'omniauth-github'
23 23  
24 24 # Extracting information from a git repository
25   -gem 'rugged', '~> 0.17.0.b7'
26 25 gem "gitlab-grit", '~> 1.0.0', require: 'grit'
27 26 gem 'grit_ext', '~> 0.8.1'
28 27  
... ...
Gemfile.lock
... ... @@ -397,7 +397,6 @@ GEM
397 397 ruby-progressbar (1.0.2)
398 398 rubyntlm (0.1.1)
399 399 rubyzip (0.9.9)
400   - rugged (0.17.0.b7)
401 400 sanitize (2.0.3)
402 401 nokogiri (>= 1.4.4, < 1.6)
403 402 sass (3.2.7)
... ... @@ -566,7 +565,6 @@ DEPENDENCIES
566 565 redcarpet (~> 2.2.2)
567 566 redis-rails
568 567 rspec-rails
569   - rugged (~> 0.17.0.b7)
570 568 sass-rails (~> 3.2.5)
571 569 sdoc
572 570 seed-fu
... ...
app/models/repository.rb
... ... @@ -34,10 +34,6 @@ class Repository
34 34 @repo ||= Grit::Repo.new(path_to_repo)
35 35 end
36 36  
37   - def rugged
38   - @rugged ||= Rugged::Repository.new(path_to_repo)
39   - end
40   -
41 37 def commit(commit_id = nil)
42 38 Commit.find_or_first(repo, commit_id, root_ref)
43 39 end
... ... @@ -68,17 +64,17 @@ class Repository
68 64  
69 65 # Returns an Array of branch names
70 66 def branch_names
71   - branches.map(&:name).sort
  67 + repo.branches.collect(&:name).sort
72 68 end
73 69  
74 70 # Returns an Array of Branches
75 71 def branches
76   - rugged.branches.sort_by(&:name)
  72 + repo.branches.sort_by(&:name)
77 73 end
78 74  
79 75 # Returns an Array of tag names
80 76 def tag_names
81   - rugged.tags.sort.reverse
  77 + repo.tags.collect(&:name).sort.reverse
82 78 end
83 79  
84 80 # Returns an Array of Tags
... ...