Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@jeffkreeftmeijer jeffkreeftmeijer authored
View
3  app/controllers/contests_controller.rb
@@ -1,3 +1,6 @@
+require 'kramdown'
+require 'gust'
+
class ContestsController < ApplicationController
def index
View
3  app/helpers/application_helper.rb
@@ -1,4 +1,7 @@
+require 'sprockets/helpers/rails_helper'
+
module ApplicationHelper
+ include Sprockets::Helpers::RailsHelper
def avatar_url
"http://#{request.subdomain.present? ? "#{request.subdomain}." : ''}" <<
View
3  app/models/contest.rb
@@ -1,3 +1,6 @@
+require 'mongoid'
+require 'mongoid/slug'
+require 'gravtastic'
require 'state'
require 'time_from_date_field'
require 'mongoid_extensions'
View
3  app/models/user.rb
@@ -1,3 +1,6 @@
+require 'mongoid'
+require 'gravtastic'
+
require 'points'
require 'scores'
require 'participations'
View
5 config/application.rb
@@ -4,10 +4,13 @@
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
+require "mongoid/railtie"
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env) if defined?(Bundler)
+Bundler.setup(:default, Rails.env) if defined?(Bundler)
+
+require 'haml'
module Codebrawl
class Application < Rails::Application
View
2  config/initializers/codebrawl.rb
@@ -1,3 +1,5 @@
+require 'hashr'
+
module Codebrawl
class Config < Hashr
define(
View
2  config/initializers/hoptoad.rb
@@ -1,3 +1,5 @@
+require 'hoptoad_notifier'
+
HoptoadNotifier.configure do |config|
config.api_key = Codebrawl.config.hoptoad.api_key
end
View
2  config/initializers/omniauth.rb
@@ -1,3 +1,5 @@
+require 'omniauth'
+
Rails.application.config.middleware.use OmniAuth::Builder do
provider :github,
Codebrawl.config.github.id,
View
4 spec/models/user_spec.rb
@@ -1,7 +1,5 @@
-require 'mongoid'
-require 'gravtastic'
-require 'shoulda-matchers'
require File.expand_path('app/models/user')
+require 'shoulda-matchers'
describe User do
View
6 spec/spec_helper.rb
@@ -1,4 +1,8 @@
require 'spork'
+require 'database_cleaner'
+require 'fabrication'
+require 'faker'
+require 'timecop'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
@@ -10,6 +14,8 @@
require 'rspec/rails'
require 'spec_config'
+ require 'shoulda-matchers'
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
Please sign in to comment.
Something went wrong with that request. Please try again.