Skip to content

Commit

Permalink
Reorganized the way some files are required. Using autoload.
Browse files Browse the repository at this point in the history
  • Loading branch information
thhermansen committed Jun 13, 2010
1 parent 0862137 commit 60f93ec
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
21 changes: 19 additions & 2 deletions lib/devise_facebook_open_graph.rb
@@ -1,8 +1,25 @@
# encoding: utf-8
require 'devise'

require 'devise_facebook_open_graph/facebook/config'
require 'devise_facebook_open_graph/rails/view_helpers'

require 'devise_facebook_open_graph/rails'

module DeviseFacebookOpenGraph
module Facebook
extend ActiveSupport::Autoload

autoload :Config
end

module Rails
extend ActiveSupport::Autoload

autoload :ViewHelpers
autoload :ControllerHelpers
end
end



require 'devise_facebook_open_graph/strategy'
require 'devise_facebook_open_graph/schema'
Expand Down
2 changes: 2 additions & 0 deletions lib/devise_facebook_open_graph/rails.rb
@@ -0,0 +1,2 @@
ActiveSupport.on_load(:action_view) { include DeviseFacebookOpenGraph::Rails::ViewHelpers }
ActiveSupport.on_load(:action_controller) { include DeviseFacebookOpenGraph::Rails::ControllerHelpers }
8 changes: 8 additions & 0 deletions lib/devise_facebook_open_graph/rails/controller_helpers.rb
@@ -0,0 +1,8 @@
# encoding: utf-8

module DeviseFacebookOpenGraph
module Rails
module ControllerHelpers
end
end
end
2 changes: 0 additions & 2 deletions lib/devise_facebook_open_graph/rails/view_helpers.rb
Expand Up @@ -35,5 +35,3 @@ def facebook_init_javascript_sdk
end
end
end

::ActionView::Base.send :include, DeviseFacebookOpenGraph::Rails::ViewHelpers

0 comments on commit 60f93ec

Please sign in to comment.