Commit 1b2068ea authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Gem updates & githost logger

* Grit gem updated
* gitolite-client updated
* logger added
* few fixes
parent 09831488
...@@ -11,8 +11,8 @@ gem "kaminari" ...@@ -11,8 +11,8 @@ gem "kaminari"
gem "haml", "3.1.4" gem "haml", "3.1.4"
gem "haml-rails" gem "haml-rails"
gem "jquery-rails" gem "jquery-rails"
gem "grit", :git => "https://github.com/gitlabhq/grit.git" gem "grit", :git => "https://github.com/gitlabhq/grit.git", :ref => "810e3c11787e9d84c5925a7edc3264db0f04bb49"
gem "gitolite", :git => "https://github.com/gitlabhq/gitolite-client.git" gem "gitolite", :git => "https://github.com/gitlabhq/gitolite-client.git", :ref => "9b715ca8bab6529f6c92204a25f84d12f25a6eb0"
gem "carrierwave" gem "carrierwave"
gem "six" gem "six"
gem "therubyracer" gem "therubyracer"
......
...@@ -6,17 +6,19 @@ GIT ...@@ -6,17 +6,19 @@ GIT
GIT GIT
remote: https://github.com/gitlabhq/gitolite-client.git remote: https://github.com/gitlabhq/gitolite-client.git
revision: 36dabd226caa40ff052677719adaacbfe667b36c revision: 9b715ca8bab6529f6c92204a25f84d12f25a6eb0
ref: 9b715ca8bab6529f6c92204a25f84d12f25a6eb0
specs: specs:
gitolite (0.0.3.alpha) gitolite (0.0.4.alpha)
grit (~> 2.4.1) grit (>= 2.4.1)
hashery (~> 1.4.0) hashery (~> 1.4.0)
GIT GIT
remote: https://github.com/gitlabhq/grit.git remote: https://github.com/gitlabhq/grit.git
revision: 3fc864f3c637e06e2fa7a81f6b48a5df58a9bc5b revision: 810e3c11787e9d84c5925a7edc3264db0f04bb49
ref: 810e3c11787e9d84c5925a7edc3264db0f04bb49
specs: specs:
grit (2.4.1) grit (2.5.0)
diff-lcs (~> 1.1) diff-lcs (~> 1.1)
mime-types (~> 1.15) mime-types (~> 1.15)
posix-spawn (~> 0.3.6) posix-spawn (~> 0.3.6)
......
...@@ -15,6 +15,7 @@ class CommitsController < ApplicationController ...@@ -15,6 +15,7 @@ class CommitsController < ApplicationController
def index def index
@repo = project.repo @repo = project.repo
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0) @limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
@commits = @project.commits(@ref, params[:path], @limit, @offset) @commits = @project.commits(@ref, params[:path], @limit, @offset)
respond_to do |format| respond_to do |format|
......
...@@ -2,6 +2,7 @@ require 'digest/md5' ...@@ -2,6 +2,7 @@ require 'digest/md5'
module ApplicationHelper module ApplicationHelper
def gravatar_icon(user_email = '', size = 40) def gravatar_icon(user_email = '', size = 40)
return unless user_email
gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com" gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
user_email.strip! user_email.strip!
"#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon" "#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
......
...@@ -73,7 +73,7 @@ class Commit ...@@ -73,7 +73,7 @@ class Commit
repo.commits(ref, limit, offset) repo.commits(ref, limit, offset)
else else
repo.commits(ref) repo.commits(ref)
end.map{ |c| Commit.new(c) } end.map{ |c| Commit.new(c) }
end end
def commits_between(repo, from, to) def commits_between(repo, from, to)
......
...@@ -3,6 +3,8 @@ module Gitlabhq ...@@ -3,6 +3,8 @@ module Gitlabhq
extend self extend self
def utf8 message def utf8 message
return nil unless message
hash = CharlockHolmes::EncodingDetector.detect(message) rescue {} hash = CharlockHolmes::EncodingDetector.detect(message) rescue {}
if hash[:encoding] if hash[:encoding]
CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8') CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8')
......
...@@ -46,6 +46,7 @@ module Gitlabhq ...@@ -46,6 +46,7 @@ module Gitlabhq
end end
end end
rescue Exception => ex rescue Exception => ex
Gitlabhq::Logger.error(ex.message)
raise Gitolite::AccessDenied.new("gitolite timeout") raise Gitolite::AccessDenied.new("gitolite timeout")
end end
......
module Gitlabhq
class Logger
def self.error(message)
@@logger ||= ::Logger.new(File.join(Rails.root, "log/githost.log"))
@@logger.error(message)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment