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