Gem updates & githost logger
* Grit gem updated * gitolite-client updated * logger added * few fixes
This commit is contained in:
parent
09831488c9
commit
1b2068eaa9
8 changed files with 23 additions and 8 deletions
4
Gemfile
4
Gemfile
|
@ -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"
|
||||||
|
|
12
Gemfile.lock
12
Gemfile.lock
|
@ -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
|
||||||
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'
|
||||||
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"
|
||||||
|
|
|
@ -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
|
||||||
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
|
||||||
|
|
||||||
|
|
8
lib/gitlabhq/logger.rb
Normal file
8
lib/gitlabhq/logger.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
module Gitlabhq
|
||||||
|
class Logger
|
||||||
|
def self.error(message)
|
||||||
|
@@logger ||= ::Logger.new(File.join(Rails.root, "log/githost.log"))
|
||||||
|
@@logger.error(message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue