Skip to content
This repository has been archived by the owner on Jan 30, 2018. It is now read-only.

Merge of my fixes from master #34

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gem 'activesupport-i18n-patch', :git => 'git://github.com/teambox/activesupport-

gem 'nokogiri'
gem 'SystemTimer', '~> 1.2.0', :require => 'system_timer'
gem 'whenever', '~> 0.4.1', :require => nil
gem 'whenever', '~> 0.7.0', :require => nil
gem 'icalendar', '~> 1.1.3'
gem 'libxml-ruby', '1.1.3', :require => 'libxml'
gem 'rdiscount', '~> 1.6.3'
Expand Down
9 changes: 5 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ GEM
cgi_multipart_eof_fix (2.5.0)
childprocess (0.2.2)
ffi (~> 1.0.6)
chronic (0.5.0)
chronic (0.6.4)
cocaine (0.1.0)
columnize (0.3.4)
configuration (1.3.1)
Expand Down Expand Up @@ -283,8 +283,9 @@ GEM
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
whenever (0.4.2)
chronic (>= 0.2.3)
whenever (0.7.0)
activesupport (>= 2.3.4)
chronic (~> 0.6.3)
xml-simple (1.1.0)
xpath (0.1.4)
nokogiri (~> 1.3)
Expand Down Expand Up @@ -350,5 +351,5 @@ DEPENDENCIES
unicorn
vestal_versions (~> 1.2.2)!
webrat
whenever (~> 0.4.1)
whenever (~> 0.7.0)
will_paginate!
2 changes: 1 addition & 1 deletion app/models/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def copy_ownership_from_comment
end

def inherit_privacy # before_save
if comment_id
if comment_id and comment
self.is_private = comment.is_private
end
true
Expand Down
17 changes: 12 additions & 5 deletions config/schedule.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
set :output, "#{Rails.root}/log/cron.log"
# When running Whenever, the environment should be specified with --set environment
ENV['RAILS_ENV'] = environment || 'production'

require File.join(File.dirname(__FILE__), "environment")

set :output, File.join(Rails.root, "log", "cron.log")

every 1.hour do
rake "mail:reminders", :environment => :production
end

every 1.minutes do
rake "mail:inbox", :environment => :production
if Teambox.config.allow_incoming_email and Teambox.config.incoming_email_settings[:type].downcase != 'pipe'
every 1.minutes do
rake "mail:inbox", :environment => :production
end
end

every 15.minutes do
rake "mail:digest", :environment => :production
end

every 30.minutes do
rake "ts:rebuild", :environment => :production
end
rake "ts:reindex", :environment => :production
end
1 change: 1 addition & 0 deletions config/teambox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ defaults: &defaults
# * Run `rake mail:inbox` periodically from cron to process incoming emails.
# Important: Email should be received in the same domain it's being sent from.
incoming_email_settings:
# Set this to "pipe" if piping the mail directly to the receive_mail script
:type: POP
:address: mail.example.com
:user_name: USER
Expand Down
8 changes: 7 additions & 1 deletion lib/tasks/rcov.rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unless Teambox.config.heroku?
begin
require 'cucumber/rake/task'
require 'rspec/core/rake_task'

Expand All @@ -23,4 +23,10 @@ unless Teambox.config.heroku?
Rake::Task["rcov:rspec_run"].invoke
end
end

rescue LoadError
desc 'RCov rake tasks not available (Cucumber or RSpec not installed)'
task :rcov do
abort 'RCov tasks are not available. Make sure Cucumber and RSpec are installed.'
end
end
22 changes: 13 additions & 9 deletions script/receive_email
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!/usr/bin/env ruby
# This script can be used to process an incoming e-mail, e.g. by configuring Postfix to pipe it here

ENV['RAILS_ENV'] = ENV['RAILS_ENV'] || 'production'
log_file = File.dirname(__FILE__) + '/../log/' + ENV['RAILS_ENV'] + '.log'
Dir.chdir File.join(File.dirname(__FILE__), '..') do

# Send output to the log so we don't generate a bounce message
$stderr.reopen(log_file, 'a')
$stderr.sync = true
$stdout.reopen(log_file, 'a')
$stderr.sync = true
ENV['RAILS_ENV'] = ENV['RAILS_ENV'] || 'production'
log_file = File.dirname(__FILE__) + '/../log/' + ENV['RAILS_ENV'] + '.log'

require File.dirname(__FILE__) + '/../config/environment'
# Send output to the log so we don't generate a bounce message
$stderr.reopen(log_file, 'a')
$stderr.sync = true
$stdout.reopen(log_file, 'a')
$stdout.sync = true

Emailer.receive(STDIN.read)
require File.dirname(__FILE__) + '/../config/environment'

Emailer.receive(STDIN.read)

end