Skip to content
This repository
Browse code

Move the last pockets of Sprockets stuff into the Sprockets directory

  • Loading branch information...
commit a9f22dc272ad5b7fe23b4648b825fd454ad230a3 1 parent 76f947e
Yehuda Katz wycats authored
2  actionpack/lib/action_view/helpers.rb
@@ -22,7 +22,6 @@ module Helpers #:nodoc:
22 22 autoload :RecordTagHelper
23 23 autoload :RenderingHelper
24 24 autoload :SanitizeHelper
25   - autoload :SprocketsHelper
26 25 autoload :TagHelper
27 26 autoload :TextHelper
28 27 autoload :TranslationHelper
@@ -53,7 +52,6 @@ module Helpers #:nodoc:
53 52 include RecordTagHelper
54 53 include RenderingHelper
55 54 include SanitizeHelper
56   - include SprocketsHelper
57 55 include TagHelper
58 56 include TextHelper
59 57 include TranslationHelper
14 actionpack/lib/action_view/helpers/sprockets_helper.rb
... ... @@ -1,14 +0,0 @@
1   -require 'uri'
2   -require 'action_view/helpers/asset_paths'
3   -
4   -module ActionView
5   - module Helpers
6   - module SprocketsHelper
7   - def debug_assets?
8   - params[:debug_assets] == '1' ||
9   - params[:debug_assets] == 'true'
10   - end
11   -
12   - end
13   - end
14   -end
21 actionpack/lib/sprockets/helpers/rails_helper.rb
... ... @@ -1,3 +1,6 @@
  1 +require "action_view/helpers/asset_paths"
  2 +require "action_view/helpers/asset_tag_helper"
  3 +
1 4 module Sprockets
2 5 module Helpers
3 6 module RailsHelper
@@ -9,12 +12,6 @@ def asset_paths
9 12 end
10 13 end
11 14
12   - def asset_path(source, default_ext = nil, body = false)
13   - source = source.logical_path if source.respond_to?(:logical_path)
14   - path = asset_paths.compute_public_path(source, 'assets', default_ext, true)
15   - body ? "#{path}?body=1" : path
16   - end
17   -
18 15 def javascript_include_tag(source, options = {})
19 16 debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
20 17 body = options.key?(:body) ? options.delete(:body) : false
@@ -53,6 +50,18 @@ def stylesheet_link_tag(source, options = {})
53 50 end
54 51 end
55 52
  53 + private
  54 + def debug_assets?
  55 + params[:debug_assets] == '1' ||
  56 + params[:debug_assets] == 'true'
  57 + end
  58 +
  59 + def asset_path(source, default_ext = nil, body = false)
  60 + source = source.logical_path if source.respond_to?(:logical_path)
  61 + path = asset_paths.compute_public_path(source, 'assets', default_ext, true)
  62 + body ? "#{path}?body=1" : path
  63 + end
  64 +
56 65 class AssetPaths < ActionView::Helpers::AssetPaths #:nodoc:
57 66 def compute_public_path(source, dir, ext=nil, include_host=true)
58 67 super(source, 'assets', ext, include_host)
1  actionpack/lib/sprockets/railtie.rb
@@ -35,7 +35,6 @@ def self.using_scss?
35 35
36 36 ActiveSupport.on_load(:action_view) do
37 37 app.assets.context_class.instance_eval do
38   - include ::ActionView::Helpers::SprocketsHelper
39 38 include ::Sprockets::Helpers::RailsHelper
40 39 end
41 40 end
3  actionpack/test/template/sprockets_helper_test.rb
@@ -4,8 +4,7 @@
4 4 require 'mocha'
5 5
6 6 class SprocketsHelperTest < ActionView::TestCase
7   - tests ActionView::Helpers::SprocketsHelper
8   - include Sprockets::Helpers::RailsHelper
  7 + tests Sprockets::Helpers::RailsHelper
9 8
10 9 attr_accessor :assets
11 10

0 comments on commit a9f22dc

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