Commit 1c5cb538f211b7cd0afd991729a55d309961777b
Exists in
master
and in
4 other branches
Merge branch 'master' into stable
Showing
7 changed files
with
33 additions
and
26 deletions
Show diff stats
app/views/events/_event_last_push.html.haml
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | .event_lp | 2 | .event_lp |
| 3 | %div | 3 | %div |
| 4 | = image_tag gravatar_icon(event.author_email), class: "avatar" | 4 | = image_tag gravatar_icon(event.author_email), class: "avatar" |
| 5 | - %span Your pushed to | 5 | + %span You pushed to |
| 6 | = event.ref_type | 6 | = event.ref_type |
| 7 | = link_to project_commits_path(event.project, ref: event.ref_name) do | 7 | = link_to project_commits_path(event.project, ref: event.ref_name) do |
| 8 | %strong= truncate(event.ref_name, length: 28) | 8 | %strong= truncate(event.ref_name, length: 28) |
| @@ -0,0 +1,31 @@ | @@ -0,0 +1,31 @@ | ||
| 1 | +# Custom Redis configuration | ||
| 2 | +rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..' | ||
| 3 | +rails_env = ENV['RAILS_ENV'] || 'development' | ||
| 4 | +config_file = File.join(rails_root, 'config', 'resque.yml') | ||
| 5 | + | ||
| 6 | +if File.exists?(config_file) | ||
| 7 | + resque_config = YAML.load_file(config_file) | ||
| 8 | + Resque.redis = resque_config[rails_env] | ||
| 9 | +end | ||
| 10 | + | ||
| 11 | +# Queues | ||
| 12 | +Resque.watch_queue(PostReceive.instance_variable_get("@queue")) | ||
| 13 | + | ||
| 14 | +# Authentication | ||
| 15 | +require 'resque/server' | ||
| 16 | +class Authentication | ||
| 17 | + def initialize(app) | ||
| 18 | + @app = app | ||
| 19 | + end | ||
| 20 | + | ||
| 21 | + def call(env) | ||
| 22 | + account = env['warden'].authenticate!(:database_authenticatable, :rememberable, scope: :user) | ||
| 23 | + raise "Access denied" if !account.admin? | ||
| 24 | + @app.call(env) | ||
| 25 | + end | ||
| 26 | +end | ||
| 27 | + | ||
| 28 | +Resque::Server.use Authentication | ||
| 29 | + | ||
| 30 | +# Mailer | ||
| 31 | +Resque::Mailer.excluded_environments = [] |
config/initializers/4_resque_queues.rb
| @@ -1 +0,0 @@ | @@ -1 +0,0 @@ | ||
| 1 | -Resque.watch_queue(PostReceive.instance_variable_get("@queue")) |
config/initializers/resque.rb
| @@ -1,8 +0,0 @@ | @@ -1,8 +0,0 @@ | ||
| 1 | -rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..' | ||
| 2 | -rails_env = ENV['RAILS_ENV'] || 'development' | ||
| 3 | -config_file = File.join(rails_root, 'config', 'resque.yml') | ||
| 4 | - | ||
| 5 | -if File.exists?(config_file) | ||
| 6 | - resque_config = YAML.load_file(config_file) | ||
| 7 | - Resque.redis = resque_config[rails_env] | ||
| 8 | -end |
config/initializers/resque_authentication.rb
| @@ -1,14 +0,0 @@ | @@ -1,14 +0,0 @@ | ||
| 1 | -require 'resque/server' | ||
| 2 | -class Authentication | ||
| 3 | - def initialize(app) | ||
| 4 | - @app = app | ||
| 5 | - end | ||
| 6 | - | ||
| 7 | - def call(env) | ||
| 8 | - account = env['warden'].authenticate!(:database_authenticatable, :rememberable, scope: :user) | ||
| 9 | - raise "Access denied" if !account.admin? | ||
| 10 | - @app.call(env) | ||
| 11 | - end | ||
| 12 | -end | ||
| 13 | - | ||
| 14 | -Resque::Server.use Authentication | ||
| 15 | \ No newline at end of file | 0 | \ No newline at end of file |
config/initializers/resque_mailer.rb
| @@ -1 +0,0 @@ | @@ -1 +0,0 @@ | ||
| 1 | -Resque::Mailer.excluded_environments = [] |
features/steps/dashboard/dashboard.rb
| @@ -16,7 +16,7 @@ class Dashboard < Spinach::FeatureSteps | @@ -16,7 +16,7 @@ class Dashboard < Spinach::FeatureSteps | ||
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | Then 'I should see last push widget' do | 18 | Then 'I should see last push widget' do |
| 19 | - page.should have_content "Your pushed to branch new_design" | 19 | + page.should have_content "You pushed to branch new_design" |
| 20 | page.should have_link "Create Merge Request" | 20 | page.should have_link "Create Merge Request" |
| 21 | end | 21 | end |
| 22 | 22 |