Skip to content

Commit

Permalink
Merge pull request activerecord-hackery#318 from tylerhunt/require-de…
Browse files Browse the repository at this point in the history
…pendencies

Explicitly define and require dependencies
  • Loading branch information
jonatack committed Dec 14, 2013
2 parents 155278c + b1a8e02 commit 81e9406
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/ransack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ class UntraversableAssociationError < StandardError; end;
require 'ransack/helpers'
require 'action_controller'

ActionController::Base.helper Ransack::Helpers::FormHelper
ActionController::Base.helper Ransack::Helpers::FormHelper
4 changes: 3 additions & 1 deletion lib/ransack/adapters/active_record/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/class/attribute'

module Ransack
module Adapters
module ActiveRecord
Expand Down Expand Up @@ -37,4 +39,4 @@ def ransackable_associations(auth_object = nil)
end
end
end
end
end
2 changes: 2 additions & 0 deletions lib/ransack/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/module/attribute_accessors'

require 'ransack/constants'
require 'ransack/predicate'

Expand Down
2 changes: 2 additions & 0 deletions lib/ransack/nodes/attribute.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/module/delegation'

module Ransack
module Nodes
class Attribute < Node
Expand Down
2 changes: 2 additions & 0 deletions lib/ransack/nodes/grouping.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/module/delegation'

module Ransack
module Nodes
class Grouping < Node
Expand Down
5 changes: 4 additions & 1 deletion lib/ransack/nodes/node.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/module/delegation'

module Ransack
module Nodes
class Node
Expand Down Expand Up @@ -31,4 +34,4 @@ def translate(key, options = {})

end
end
end
end
4 changes: 3 additions & 1 deletion lib/ransack/nodes/value.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/module/delegation'

module Ransack
module Nodes
class Value < Node
Expand Down Expand Up @@ -107,4 +109,4 @@ def array_of_arrays?(val)
end
end
end
end
end
4 changes: 3 additions & 1 deletion lib/ransack/ransacker.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/module/delegation'

module Ransack
class Ransacker

Expand All @@ -21,4 +23,4 @@ def attr_from(bindable)
end

end
end
end
2 changes: 2 additions & 0 deletions lib/ransack/search.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/core_ext/module/delegation'

require 'ransack/nodes'
require 'ransack/context'
require 'ransack/naming'
Expand Down
2 changes: 2 additions & 0 deletions lib/ransack/translate.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'i18n'

I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'locale', '*.yml')]

module Ransack
Expand Down
4 changes: 3 additions & 1 deletion ransack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ Gem::Specification.new do |s|

s.rubyforge_project = "ransack"

s.add_dependency 'activerecord', '>= 3.0'
s.add_dependency 'actionpack', '>= 3.0'
s.add_dependency 'activerecord', '>= 3.0'
s.add_dependency 'activesupport', '>= 3.0'
s.add_dependency 'i18n'
s.add_dependency 'polyamorous', '~> 0.6.0'
s.add_development_dependency 'rspec', '~> 2.8.0'
s.add_development_dependency 'machinist', '~> 1.0.6'
Expand Down
6 changes: 6 additions & 0 deletions spec/ransack/dependencies_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe 'Ransack' do
it 'can be required without errors' do
output = `bundle exec ruby -e "require 'ransack'" 2>&1`
output.should be_empty
end
end

0 comments on commit 81e9406

Please sign in to comment.