Permalink
Browse files

Remove component.json support

  • Loading branch information...
1 parent f22526f commit 6db01c9d1d9674434465d95d36120609de2d182b @josh josh committed Dec 11, 2013
Showing with 8 additions and 10 deletions.
  1. +0 −2 lib/sprockets/asset_attributes.rb
  2. +1 −1 lib/sprockets/base.rb
  3. +5 −5 test/test_asset_attributes.rb
  4. +2 −2 test/test_environment.rb
View
2 lib/sprockets/asset_attributes.rb
@@ -25,8 +25,6 @@ def search_paths
# optimization: bower.json can only be nested one level deep
if !path_without_extension.to_s.index('/')
paths << path_without_extension.join("bower.json").to_s
- # DEPRECATED bower configuration file
- paths << path_without_extension.join("component.json").to_s
end
if pathname.basename(extension.to_s).to_s != 'index'
View
2 lib/sprockets/base.rb
@@ -130,7 +130,7 @@ def resolve(logical_path, options = {})
args = attributes_for(logical_path).search_paths + [options]
@trail.find(*args) do |path|
pathname = Pathname.new(path)
- if %w( bower.json component.json ).include?(pathname.basename.to_s)
+ if pathname.basename.to_s == "bower.json"
bower = json_decode(pathname.read)
case bower['main']
when String
View
10 test/test_asset_attributes.rb
@@ -2,17 +2,17 @@
class TestAssetAttributes < Sprockets::TestCase
test "search paths" do
- assert_equal ["index.js", "index/bower.json", "index/component.json"],
+ assert_equal ["index.js", "index/bower.json"],
pathname("index.js").search_paths
- assert_equal ["foo.js", "foo/bower.json", "foo/component.json", "foo/index.js"],
+ assert_equal ["foo.js", "foo/bower.json", "foo/index.js"],
pathname("foo.js").search_paths
- assert_equal ["foo", "foo/bower.json", "foo/component.json", "foo/index"],
+ assert_equal ["foo", "foo/bower.json", "foo/index"],
pathname("foo").search_paths
assert_equal ["foo/bar.js", "foo/bar/index.js"],
pathname("foo/bar.js").search_paths
- assert_equal ["jquery.foo.js", "jquery.foo/bower.json", "jquery.foo/component.json", "jquery.foo/index.js"],
+ assert_equal ["jquery.foo.js", "jquery.foo/bower.json", "jquery.foo/index.js"],
pathname("jquery.foo.js").search_paths
- assert_equal ["jquery.foo", "jquery.foo/bower.json", "jquery.foo/component.json", "jquery.foo/index"],
+ assert_equal ["jquery.foo", "jquery.foo/bower.json", "jquery.foo/index"],
pathname("jquery.foo").search_paths
end
View
4 test/test_environment.rb
@@ -137,11 +137,11 @@ def self.test(name, &block)
assert_equal ".c {}\n.d {}\n/*\n\n */\n\n", @env["mobile.css"].to_s
end
- test "find component.json in directory" do
+ test "find bower.json in directory" do
assert_equal "var bower;\n", @env["bower.js"].to_s
end
- test "find multiple component.json in directory" do
+ test "find multiple bower.json in directory" do
assert_equal "var qunit;\n", @env["qunit.js"].to_s
assert_equal ".qunit {}\n", @env["qunit.css"].to_s
end

0 comments on commit 6db01c9

Please sign in to comment.