lib/tophat.rb in tophat-1.6.1 vs lib/tophat.rb in tophat-1.7.0
- old
+ new
@@ -1,24 +1,33 @@
require 'action_view'
+require 'tophat/html'
+require 'tophat/title'
+require 'tophat/meta'
+require 'tophat/stylesheet'
+require 'tophat/robots'
+require 'tophat/opengraph'
+require 'tophat/twitter_card'
module TopHat
extend self
- def current
- return Thread.current[:tophat] if Thread.current[:tophat]
+ require "tophat/railtie" if defined?(::Rails)
- reset
+ def current
+ Thread.current[:tophat] ||= {}
end
def reset
Thread.current[:tophat] = {}
end
-end
+ def setup
+ ActionView::Base.send :include, TopHat::HtmlHelper
+ ActionView::Base.send :include, TopHat::TitleHelper
+ ActionView::Base.send :include, TopHat::MetaHelper
+ ActionView::Base.send :include, TopHat::StylesheetHelper
+ ActionView::Base.send :include, TopHat::RobotsHelper
+ ActionView::Base.send :include, TopHat::OpenGraphHelper
+ ActionView::Base.send :include, TopHat::TwitterCardHelper
+ end
-require 'tophat/html'
-require 'tophat/title'
-require 'tophat/meta'
-require 'tophat/stylesheet'
-require 'tophat/robots'
-require 'tophat/opengraph'
-require 'tophat/twitter_card'
+end