Instead of requiring dependency, only exe if defined

This commit is contained in:
Neil Matatall 2013-01-25 00:12:31 -08:00
Родитель 3f04883d51
Коммит f43a46d92d
3 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@ -1,5 +1,3 @@
require 'active_support/dependencies'
# rails 3.1+
if defined?(Rails::Railtie)
module SecureHeaders
@ -25,10 +23,12 @@ else
end
end
if ActiveSupport::Dependencies.autoload_paths
ActiveSupport::Dependencies.autoload_paths << File.expand_path(File.join("..", "..", "..", "app", "controllers"), __FILE__)
else
ActiveSupport::Dependencies.autoload_paths = [File.expand_path(File.join("..", "..", "..", "app", "controllers"), __FILE__)]
if defined?(ActiveSupport::Dependencies)
if ActiveSupport::Dependencies.autoload_paths
ActiveSupport::Dependencies.autoload_paths << File.expand_path(File.join("..", "..", "..", "app", "controllers"), __FILE__)
else
ActiveSupport::Dependencies.autoload_paths = [File.expand_path(File.join("..", "..", "..", "app", "controllers"), __FILE__)]
end
end
if defined? ActionController::Routing

Просмотреть файл

@ -19,6 +19,5 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
gem.add_dependency "brwsr", ">= 1.1.1"
gem.add_dependency "activesupport", ">= 2.0"
gem.add_development_dependency "rake"
end

Просмотреть файл

@ -1,6 +1,5 @@
require 'rubygems'
require 'spork'
require 'active_support'
unless Spork.using_spork?
require 'simplecov'