sprockets-rails 1.0.0 → 2.0.0.backport1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +155 -0
  3. data/lib/sprockets/rails.rb +3 -0
  4. data/lib/sprockets/rails/helper.rb +145 -0
  5. data/lib/sprockets/rails/legacy_asset_tag_helper.rb +32 -0
  6. data/lib/sprockets/rails/legacy_asset_url_helper.rb +130 -0
  7. data/lib/sprockets/rails/task.rb +82 -0
  8. data/lib/sprockets/railtie.rb +125 -0
  9. metadata +52 -81
  10. data/MIT-LICENSE +0 -20
  11. data/README.rdoc +0 -3
  12. data/Rakefile +0 -24
  13. data/lib/sprockets-rails.rb +0 -7
  14. data/lib/sprockets/rails/bootstrap.rb +0 -41
  15. data/lib/sprockets/rails/compressors.rb +0 -87
  16. data/lib/sprockets/rails/helpers.rb +0 -8
  17. data/lib/sprockets/rails/helpers/isolated_helper.rb +0 -15
  18. data/lib/sprockets/rails/helpers/rails_helper.rb +0 -169
  19. data/lib/sprockets/rails/railtie.rb +0 -64
  20. data/lib/sprockets/rails/static_compiler.rb +0 -64
  21. data/lib/sprockets/rails/version.rb +0 -5
  22. data/lib/tasks/assets.rake +0 -105
  23. data/test/abstract_unit.rb +0 -145
  24. data/test/assets_debugging_test.rb +0 -65
  25. data/test/assets_test.rb +0 -532
  26. data/test/fixtures/alternate/stylesheets/style.css +0 -1
  27. data/test/fixtures/app/fonts/dir/font.ttf +0 -0
  28. data/test/fixtures/app/fonts/font.ttf +0 -0
  29. data/test/fixtures/app/images/logo.png +0 -0
  30. data/test/fixtures/app/javascripts/application.js +0 -1
  31. data/test/fixtures/app/javascripts/dir/xmlhr.js +0 -0
  32. data/test/fixtures/app/javascripts/extra.js +0 -0
  33. data/test/fixtures/app/javascripts/xmlhr.js +0 -0
  34. data/test/fixtures/app/stylesheets/application.css +0 -1
  35. data/test/fixtures/app/stylesheets/dir/style.css +0 -0
  36. data/test/fixtures/app/stylesheets/extra.css +0 -0
  37. data/test/fixtures/app/stylesheets/style.css +0 -0
  38. data/test/sprockets_compressors_test.rb +0 -27
  39. data/test/sprockets_helper_test.rb +0 -345
  40. data/test/sprockets_helper_with_routes_test.rb +0 -60
  41. data/test/test_helper.rb +0 -84
data/test/test_helper.rb DELETED
@@ -1,84 +0,0 @@
1
- lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
2
- $:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
3
-
4
- require 'minitest/autorun'
5
- require 'sprockets-rails'
6
- require 'action_controller'
7
- require 'mocha'
8
- require 'active_support/dependencies'
9
- require 'action_controller/vendor/html-scanner'
10
-
11
- FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
12
- FIXTURES = Pathname.new(FIXTURE_LOAD_PATH)
13
-
14
- module Rails
15
- class << self
16
- def env
17
- @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
18
- end
19
- end
20
- end
21
-
22
- ActiveSupport::Dependencies.hook!
23
-
24
- module SetupOnce
25
- extend ActiveSupport::Concern
26
-
27
- included do
28
- cattr_accessor :setup_once_block
29
- self.setup_once_block = nil
30
-
31
- setup :run_setup_once
32
- end
33
-
34
- module ClassMethods
35
- def setup_once(&block)
36
- self.setup_once_block = block
37
- end
38
- end
39
-
40
- private
41
- def run_setup_once
42
- if self.setup_once_block
43
- self.setup_once_block.call
44
- self.setup_once_block = nil
45
- end
46
- end
47
- end
48
-
49
- SharedTestRoutes = ActionDispatch::Routing::RouteSet.new
50
-
51
- module ActiveSupport
52
- class TestCase
53
- include SetupOnce
54
- # Hold off drawing routes until all the possible controller classes
55
- # have been loaded.
56
- setup_once do
57
- SharedTestRoutes.draw do
58
- match ':controller(/:action)'
59
- end
60
- end
61
-
62
- def assert_dom_equal(expected, actual, message = "")
63
- expected_dom = HTML::Document.new(expected).root
64
- actual_dom = HTML::Document.new(actual).root
65
- assert_equal expected_dom, actual_dom
66
- end
67
- end
68
- end
69
-
70
- class BasicController
71
- attr_accessor :request
72
-
73
- def config
74
- @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config|
75
- # VIEW TODO: View tests should not require a controller
76
- public_dir = File.expand_path("../fixtures/public", __FILE__)
77
- config.assets_dir = public_dir
78
- config.javascripts_dir = "#{public_dir}/javascripts"
79
- config.stylesheets_dir = "#{public_dir}/stylesheets"
80
- config.assets = ActiveSupport::InheritableOptions.new({ :prefix => "assets" })
81
- config
82
- end
83
- end
84
- end