Merge branch 'master' into stable
This commit is contained in:
commit
1c5cb538f2
|
@ -2,7 +2,7 @@
|
|||
.event_lp
|
||||
%div
|
||||
= image_tag gravatar_icon(event.author_email), class: "avatar"
|
||||
%span Your pushed to
|
||||
%span You pushed to
|
||||
= event.ref_type
|
||||
= link_to project_commits_path(event.project, ref: event.ref_name) do
|
||||
%strong= truncate(event.ref_name, length: 28)
|
||||
|
|
31
config/initializers/4_resque.rb
Normal file
31
config/initializers/4_resque.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Custom Redis configuration
|
||||
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
|
||||
rails_env = ENV['RAILS_ENV'] || 'development'
|
||||
config_file = File.join(rails_root, 'config', 'resque.yml')
|
||||
|
||||
if File.exists?(config_file)
|
||||
resque_config = YAML.load_file(config_file)
|
||||
Resque.redis = resque_config[rails_env]
|
||||
end
|
||||
|
||||
# Queues
|
||||
Resque.watch_queue(PostReceive.instance_variable_get("@queue"))
|
||||
|
||||
# Authentication
|
||||
require 'resque/server'
|
||||
class Authentication
|
||||
def initialize(app)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
account = env['warden'].authenticate!(:database_authenticatable, :rememberable, scope: :user)
|
||||
raise "Access denied" if !account.admin?
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
Resque::Server.use Authentication
|
||||
|
||||
# Mailer
|
||||
Resque::Mailer.excluded_environments = []
|
|
@ -1 +0,0 @@
|
|||
Resque.watch_queue(PostReceive.instance_variable_get("@queue"))
|
|
@ -1,8 +0,0 @@
|
|||
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
|
||||
rails_env = ENV['RAILS_ENV'] || 'development'
|
||||
config_file = File.join(rails_root, 'config', 'resque.yml')
|
||||
|
||||
if File.exists?(config_file)
|
||||
resque_config = YAML.load_file(config_file)
|
||||
Resque.redis = resque_config[rails_env]
|
||||
end
|
|
@ -1,14 +0,0 @@
|
|||
require 'resque/server'
|
||||
class Authentication
|
||||
def initialize(app)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
account = env['warden'].authenticate!(:database_authenticatable, :rememberable, scope: :user)
|
||||
raise "Access denied" if !account.admin?
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
Resque::Server.use Authentication
|
|
@ -1 +0,0 @@
|
|||
Resque::Mailer.excluded_environments = []
|
|
@ -16,7 +16,7 @@ class Dashboard < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
Then 'I should see last push widget' do
|
||||
page.should have_content "Your pushed to branch new_design"
|
||||
page.should have_content "You pushed to branch new_design"
|
||||
page.should have_link "Create Merge Request"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue