diff options
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 11 | ||||
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/buffered_logger.rb | 5 | ||||
-rw-r--r-- | railties/guides/source/asset_pipeline.textile | 4 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 10 |
5 files changed, 17 insertions, 15 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index cad9417216..d8340bf1c9 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -22,8 +22,6 @@ else end end -class FixturesFileNotFound < StandardError; end - module ActiveRecord # \Fixtures are a way of organizing data that you want to test against; in short, sample data. # @@ -644,14 +642,6 @@ module ActiveRecord end def read_fixture_files - if ::File.file?(yaml_file_path) - read_yaml_fixture_files - else - raise FixturesFileNotFound, "Could not find #{yaml_file_path}" - end - end - - def read_yaml_fixture_files yaml_files = Dir["#{@fixture_path}/**/*.yml"].select { |f| ::File.file?(f) } + [yaml_file_path] @@ -832,6 +822,7 @@ module ActiveRecord end @fixture_cache = {} + @fixture_connections = [] @@already_loaded_fixtures ||= {} # Load fixtures once and begin transaction. diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 7e2dafcd01..99dd74c561 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -179,7 +179,7 @@ class FixturesTest < ActiveRecord::TestCase #sanity check to make sure that this file never exists assert Dir[nonexistent_fixture_path+"*"].empty? - assert_raise(FixturesFileNotFound) do + assert_raise(Errno::ENOENT) do ActiveRecord::Fixtures.new( Account.connection, "companies", 'Company', nonexistent_fixture_path) end end diff --git a/activesupport/lib/active_support/buffered_logger.rb b/activesupport/lib/active_support/buffered_logger.rb index fc01225966..71308eed67 100644 --- a/activesupport/lib/active_support/buffered_logger.rb +++ b/activesupport/lib/active_support/buffered_logger.rb @@ -107,6 +107,11 @@ Automatic directory creation for '#{log}' is deprecated. Please make sure the d end deprecate :flush + def respond_to?(method, include_private = false) + return false if method.to_s == "flush" + super + end + def close @log.close end diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index 8ff1035a1c..d03d7f4a7d 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -369,10 +369,10 @@ It is important that this folder is shared between deployments so that remotely NOTE. If you are precompiling your assets locally, you can use +bundle install --without assets+ on the server to avoid installing the assets gems (the gems in the assets group in the Gemfile). -The default matcher for compiling files includes +application.js+, +application.css+ and all files that do not end in +js+ or +css+: +The default matcher for compiling files includes +application.js+, +application.css+ and all non-JS/CSS files (ie. +.coffee+ and +.scss+ files are *not* automatically included as they compile to JS/CSS): <ruby> -[ /\w<plus>\.(?!js|css).<plus>/, /application.(css|js)$/ ] +[ Proc.new{ |path| !File.extname(path).in?(['.js', '.css']) }, /application.(css|js)$/ ] </ruby> If you have other manifests or individual stylesheets and JavaScript files to include, you can add them to the +precompile+ array: diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index a22013f81c..392bef3fd1 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -72,7 +72,7 @@ module ApplicationTests end end - test "precompile application.js and application.css and all other files not ending with .js or .css by default" do + test "precompile application.js and application.css and all other non JS/CSS files" do app_file "app/assets/javascripts/application.js", "alert();" app_file "app/assets/stylesheets/application.css", "body{}" @@ -82,8 +82,11 @@ module ApplicationTests app_file "app/assets/javascripts/something.min.js", "alert();" app_file "app/assets/stylesheets/something.min.css", "body{}" + app_file "app/assets/javascripts/something.else.js.erb", "alert();" + app_file "app/assets/stylesheets/something.else.css.erb", "body{}" + images_should_compile = ["a.png", "happyface.png", "happy_face.png", "happy.face.png", - "happy-face.png", "happy.happy_face.png", "happy_happy.face.png", + "happy-face.png", "happy.happy_face.png", "happy_happy.face.png", "happy.happy.face.png", "happy", "happy.face", "-happyface", "-happy.png", "-happy.face.png", "_happyface", "_happy.face.png", "_happy.png"] @@ -106,6 +109,9 @@ module ApplicationTests assert !File.exists?("#{app_path}/public/assets/something.min.js") assert !File.exists?("#{app_path}/public/assets/something.min.css") + + assert !File.exists?("#{app_path}/public/assets/something.else.js") + assert !File.exists?("#{app_path}/public/assets/something.else.css") end test "asset pipeline should use a Sprockets::Index when config.assets.digest is true" do |