Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bundler.setup instead of Bundler.require

Handle requirements within the app, making sure the models and other
parts don't depend on Bundler having them preloaded already.
  • Loading branch information...
commit 9df324809cc6e39495af9c78407a6fefed02b7e0 1 parent 4ead0aa
Jeff Kreeftmeijer authored October 17, 2011
3  app/controllers/contests_controller.rb
... ...
@@ -1,3 +1,6 @@
  1
+require 'kramdown'
  2
+require 'gust'
  3
+
1 4
 class ContestsController < ApplicationController
2 5
 
3 6
   def index
3  app/helpers/application_helper.rb
... ...
@@ -1,4 +1,7 @@
  1
+require 'sprockets/helpers/rails_helper'
  2
+
1 3
 module ApplicationHelper
  4
+  include Sprockets::Helpers::RailsHelper
2 5
 
3 6
   def avatar_url
4 7
     "http://#{request.subdomain.present? ? "#{request.subdomain}." : ''}" <<
3  app/models/contest.rb
... ...
@@ -1,3 +1,6 @@
  1
+require 'mongoid'
  2
+require 'mongoid/slug'
  3
+require 'gravtastic'
1 4
 require 'state'
2 5
 require 'time_from_date_field'
3 6
 require 'mongoid_extensions'
3  app/models/user.rb
... ...
@@ -1,3 +1,6 @@
  1
+require 'mongoid'
  2
+require 'gravtastic'
  3
+
1 4
 require 'points'
2 5
 require 'scores'
3 6
 require 'participations'
5  config/application.rb
@@ -4,10 +4,13 @@
4 4
 require "action_mailer/railtie"
5 5
 require "active_resource/railtie"
6 6
 require "rails/test_unit/railtie"
  7
+require "mongoid/railtie"
7 8
 
8 9
 # If you have a Gemfile, require the gems listed there, including any gems
9 10
 # you've limited to :test, :development, or :production.
10  
-Bundler.require(:default, Rails.env) if defined?(Bundler)
  11
+Bundler.setup(:default, Rails.env) if defined?(Bundler)
  12
+
  13
+require 'haml'
11 14
 
12 15
 module Codebrawl
13 16
   class Application < Rails::Application
2  config/initializers/codebrawl.rb
... ...
@@ -1,3 +1,5 @@
  1
+require 'hashr'
  2
+
1 3
 module Codebrawl
2 4
   class Config < Hashr
3 5
     define(
2  config/initializers/hoptoad.rb
... ...
@@ -1,3 +1,5 @@
  1
+require 'hoptoad_notifier'
  2
+
1 3
 HoptoadNotifier.configure do |config|
2 4
   config.api_key = Codebrawl.config.hoptoad.api_key
3 5
 end
2  config/initializers/omniauth.rb
... ...
@@ -1,3 +1,5 @@
  1
+require 'omniauth'
  2
+
1 3
 Rails.application.config.middleware.use OmniAuth::Builder do
2 4
   provider :github,
3 5
     Codebrawl.config.github.id,
4  spec/models/user_spec.rb
... ...
@@ -1,7 +1,5 @@
1  
-require 'mongoid'
2  
-require 'gravtastic'
3  
-require 'shoulda-matchers'
4 1
 require File.expand_path('app/models/user')
  2
+require 'shoulda-matchers'
5 3
 
6 4
 describe User do
7 5
 
6  spec/spec_helper.rb
... ...
@@ -1,4 +1,8 @@
1 1
 require 'spork'
  2
+require 'database_cleaner'
  3
+require 'fabrication'
  4
+require 'faker'
  5
+require 'timecop'
2 6
 
3 7
 Spork.prefork do
4 8
   ENV["RAILS_ENV"] ||= 'test'
@@ -10,6 +14,8 @@
10 14
   require 'rspec/rails'
11 15
   require 'spec_config'
12 16
 
  17
+  require 'shoulda-matchers'
  18
+
13 19
   Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
14 20
 
15 21
   RSpec.configure do |config|

0 notes on commit 9df3248

Please sign in to comment.
Something went wrong with that request. Please try again.