Skip to content
Browse files

Move the last pockets of Sprockets stuff into the Sprockets directory

  • Loading branch information...
1 parent 76f947e commit a9f22dc272ad5b7fe23b4648b825fd454ad230a3 @wycats wycats committed May 23, 2011
View
2 actionpack/lib/action_view/helpers.rb
@@ -22,7 +22,6 @@ module Helpers #:nodoc:
autoload :RecordTagHelper
autoload :RenderingHelper
autoload :SanitizeHelper
- autoload :SprocketsHelper
autoload :TagHelper
autoload :TextHelper
autoload :TranslationHelper
@@ -53,7 +52,6 @@ module Helpers #:nodoc:
include RecordTagHelper
include RenderingHelper
include SanitizeHelper
- include SprocketsHelper
include TagHelper
include TextHelper
include TranslationHelper
View
14 actionpack/lib/action_view/helpers/sprockets_helper.rb
@@ -1,14 +0,0 @@
-require 'uri'
-require 'action_view/helpers/asset_paths'
-
-module ActionView
- module Helpers
- module SprocketsHelper
- def debug_assets?
- params[:debug_assets] == '1' ||
- params[:debug_assets] == 'true'
- end
-
- end
- end
-end
View
21 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -1,3 +1,6 @@
+require "action_view/helpers/asset_paths"
+require "action_view/helpers/asset_tag_helper"
+
module Sprockets
module Helpers
module RailsHelper
@@ -9,12 +12,6 @@ def asset_paths
end
end
- def asset_path(source, default_ext = nil, body = false)
- source = source.logical_path if source.respond_to?(:logical_path)
- path = asset_paths.compute_public_path(source, 'assets', default_ext, true)
- body ? "#{path}?body=1" : path
- end
-
def javascript_include_tag(source, options = {})
debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
body = options.key?(:body) ? options.delete(:body) : false
@@ -53,6 +50,18 @@ def stylesheet_link_tag(source, options = {})
end
end
+ private
+ def debug_assets?
+ params[:debug_assets] == '1' ||
+ params[:debug_assets] == 'true'
+ end
+
+ def asset_path(source, default_ext = nil, body = false)
+ source = source.logical_path if source.respond_to?(:logical_path)
+ path = asset_paths.compute_public_path(source, 'assets', default_ext, true)
+ body ? "#{path}?body=1" : path
+ end
+
class AssetPaths < ActionView::Helpers::AssetPaths #:nodoc:
def compute_public_path(source, dir, ext=nil, include_host=true)
super(source, 'assets', ext, include_host)
View
1 actionpack/lib/sprockets/railtie.rb
@@ -35,7 +35,6 @@ def self.using_scss?
ActiveSupport.on_load(:action_view) do
app.assets.context_class.instance_eval do
- include ::ActionView::Helpers::SprocketsHelper
include ::Sprockets::Helpers::RailsHelper
end
end
View
3 actionpack/test/template/sprockets_helper_test.rb
@@ -4,8 +4,7 @@
require 'mocha'
class SprocketsHelperTest < ActionView::TestCase
- tests ActionView::Helpers::SprocketsHelper
- include Sprockets::Helpers::RailsHelper
+ tests Sprockets::Helpers::RailsHelper
attr_accessor :assets

0 comments on commit a9f22dc

Please sign in to comment.
Something went wrong with that request. Please try again.