diff options
author | wycats <wycats@gmail.com> | 2011-05-23 16:43:58 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2011-05-23 16:45:26 -0700 |
commit | a9f22dc272ad5b7fe23b4648b825fd454ad230a3 (patch) | |
tree | 0c122b3e323769ecfb3c1223b3d876e389712ad4 /actionpack/lib | |
parent | 76f947edf755f57ec721b412c6cef9a9c2c8f4b5 (diff) | |
download | rails-a9f22dc272ad5b7fe23b4648b825fd454ad230a3.tar.gz rails-a9f22dc272ad5b7fe23b4648b825fd454ad230a3.tar.bz2 rails-a9f22dc272ad5b7fe23b4648b825fd454ad230a3.zip |
Move the last pockets of Sprockets stuff into the Sprockets directory
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/sprockets_helper.rb | 14 | ||||
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 21 | ||||
-rw-r--r-- | actionpack/lib/sprockets/railtie.rb | 1 |
4 files changed, 15 insertions, 23 deletions
diff --git a/actionpack/lib/action_view/helpers.rb b/actionpack/lib/action_view/helpers.rb index 78a68db282..262e0f1010 100644 --- a/actionpack/lib/action_view/helpers.rb +++ b/actionpack/lib/action_view/helpers.rb @@ -22,7 +22,6 @@ module ActionView #:nodoc: autoload :RecordTagHelper autoload :RenderingHelper autoload :SanitizeHelper - autoload :SprocketsHelper autoload :TagHelper autoload :TextHelper autoload :TranslationHelper @@ -53,7 +52,6 @@ module ActionView #:nodoc: include RecordTagHelper include RenderingHelper include SanitizeHelper - include SprocketsHelper include TagHelper include TextHelper include TranslationHelper diff --git a/actionpack/lib/action_view/helpers/sprockets_helper.rb b/actionpack/lib/action_view/helpers/sprockets_helper.rb deleted file mode 100644 index 04558438f7..0000000000 --- a/actionpack/lib/action_view/helpers/sprockets_helper.rb +++ /dev/null @@ -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 diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 5f2854995f..3b64be67d9 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/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 @@ module Sprockets 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 @@ module Sprockets 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) diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index 66354c9789..43ebf529e9 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -35,7 +35,6 @@ module Sprockets ActiveSupport.on_load(:action_view) do app.assets.context_class.instance_eval do - include ::ActionView::Helpers::SprocketsHelper include ::Sprockets::Helpers::RailsHelper end end |