Browse Source

Replaced delayed job with sidekiq

development
Godwin 9 years ago
parent
commit
8120727b31
  1. 7
      Gemfile
  2. 2
      app/assets/stylesheets/_application.scss
  3. 21
      config/Xsitemap.rb
  4. 15
      config/application.rb
  5. 7
      config/environments/development.rb
  6. 3
      config/environments/preview.rb
  7. 2
      config/environments/production.rb
  8. 3
      config/environments/test.rb
  9. 1
      config/initializers/delayed_job_config.rb
  10. 5
      public/Xrobots.txt

7
Gemfile

@ -38,10 +38,10 @@ gem 'activerecord-session_store'
gem 'paypal-express', '0.7.1'
gem 'sass-json-vars'
gem 'premailer-rails'
gem 'delayed_job_active_record'
gem 'redcarpet'
gem 'copydb'
gem 'sidekiq'
gem 'letter_opener'
gem 'launchy'
group :test do
gem 'rspec'
@ -71,7 +71,6 @@ group :test do
gem 'guard-rspec'
gem 'factory_girl_rails'
gem 'coveralls', require: false
gem 'launchy'
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'webmock', require: false

2
app/assets/stylesheets/_application.scss

@ -3033,7 +3033,7 @@ html[data-ontop] {
}
&:last-child {
@include _(border-radius, 0 0 0.15em 0.15em);
@include _(border-radius, 0 0.15em 0.15em 0);
}
}
}

21
config/Xsitemap.rb

@ -1,21 +0,0 @@
SitemapGenerator::Sitemap.default_host = "http://hackingoff.com"
SitemapGenerator::Sitemap.create do
routes = Rails.application.routes.routes.map do |route|
{alias: route.name, path: route.path.spec.to_s, controller: route.defaults[:controller], action: route.defaults[:action]}
end
# Set a list of controllers you don't want to generate routes for.
# /rails/info in particular maps to something inaccessible.
# redirects have a nil controller. This prevents duplicate content penalties.
banned_controllers = ["rails/info", nil]
routes.reject! {|route| banned_controllers.include?(route[:controller])}
# sitemap_generator includes root by default; prevent duplication
routes.reject! {|route| route[:path] == '/'}
routes.each {|route| add route[:path][0..-11]} # Strips off '(.:format)
# Notice the below if you're hosting Jekyll/Octopress in a subdirectory
# or otherwise want to index content outside of Rails' routes.
# add_to_index '/path/sitemap.xml'

15
config/application.rb

@ -29,21 +29,8 @@ module BikeBike
config.i18n.enforce_available_locales = false
self.paths['config/database'] = Rails.root.join('config', 'database.yml')
config.active_record.raise_in_transactional_callbacks = true
config.action_mailer.raise_delivery_errors = true
config.exceptions_app = self.routes
I18n.config.language_threshold = 0
if Rails.env == 'development' || Rails.env == 'test'
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM
else
# detect the language using the subdimain
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN
if Rails.env == 'preview'
I18n.config.subdomain_format = 'preview-%'
# if we are in our preview environment, set the locale regex to detect the preview- prefix
I18n.config.host_locale_regex = /^preview\-([a-z]{2})\.bikebike\.org$/
end
end
config.active_job.queue_adapter = :delayed_job
end
end

7
config/environments/development.rb

@ -51,5 +51,12 @@ BikeBike::Application.configure do
config.serve_static_files = true
# config.action_controller.perform_caching = true
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM
# to be appraised of mailing errors
config.action_mailer.raise_delivery_errors = true
# to deliver to the browser instead of email
config.action_mailer.delivery_method = :letter_opener
Paypal.sandbox!
end

3
config/environments/preview.rb

@ -98,4 +98,7 @@ BikeBike::Application.configure do
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN
I18n.config.subdomain_format = 'preview-%'
end

2
config/environments/production.rb

@ -99,4 +99,6 @@ BikeBike::Application.configure do
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN
I18n.config.host_locale_regex = /^preview\-([a-z]{2})\.bikebike\.org$/
end

3
config/environments/test.rb

@ -35,5 +35,8 @@ BikeBike::Application.configure do
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM
Paypal.sandbox!
end

1
config/initializers/delayed_job_config.rb

@ -1 +0,0 @@
Delayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))

5
public/Xrobots.txt

@ -1,5 +0,0 @@
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
#
# To ban all spiders from the entire site uncomment the next two lines:
# User-agent: *
# Disallow: /
Loading…
Cancel
Save