diff options
14 files changed, 42 insertions, 42 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb index e1ee0d0e1a..0f8a63901e 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb @@ -187,12 +187,8 @@ module ActionView # # javascript_include_tag :all, :cache => true, :recursive => true def javascript_include_tag(*sources) - if config.use_sprockets - sprockets_javascript_include_tag(*sources) - else - @javascript_include ||= JavascriptIncludeTag.new(config, asset_paths) - @javascript_include.include_tag(*sources) - end + @javascript_include ||= JavascriptIncludeTag.new(config, asset_paths) + @javascript_include.include_tag(*sources) end end end diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb index a95eb221be..e4f11c9bc7 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb @@ -137,12 +137,8 @@ module ActionView # stylesheet_link_tag :all, :concat => true # def stylesheet_link_tag(*sources) - if config.use_sprockets - sprockets_stylesheet_link_tag(*sources) - else - @stylesheet_include ||= StylesheetIncludeTag.new(config, asset_paths) - @stylesheet_include.include_tag(*sources) - end + @stylesheet_include ||= StylesheetIncludeTag.new(config, asset_paths) + @stylesheet_include.include_tag(*sources) end end diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 3b64be67d9..a99dcad81d 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -4,6 +4,9 @@ require "action_view/helpers/asset_tag_helper" module Sprockets module Helpers module RailsHelper + extend ActiveSupport::Concern + include ActionView::Helpers::AssetTagHelper + def asset_paths @asset_paths ||= begin config = self.config if respond_to?(:config) diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index da5cb320a6..db0f02a6ab 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -36,6 +36,8 @@ module Sprockets app.assets = asset_environment(app) ActiveSupport.on_load(:action_view) do + include ::Sprockets::Helpers::RailsHelper + app.assets.context_class.instance_eval do include ::Sprockets::Helpers::RailsHelper end diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 49df63d585..1f31722a7c 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -385,11 +385,11 @@ class FixturesFileNotFound < StandardError; end # # first: # name: Smurf -# <<: *DEFAULTS +# *DEFAULTS # # second: # name: Fraggle -# <<: *DEFAULTS +# *DEFAULTS # # Any fixture labeled "DEFAULTS" is safely ignored. diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 089bbed08a..2c7298e220 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -27,7 +27,7 @@ db_namespace = namespace :db do # # development: # database: blog_development - # <<: *defaults + # *defaults next unless config['database'] # Only connect to local databases local_database?(config) { create_database(config) } diff --git a/activerecord/test/fixtures/parrots.yml b/activerecord/test/fixtures/parrots.yml index 8b73b8cdf6..8425ef98e0 100644 --- a/activerecord/test/fixtures/parrots.yml +++ b/activerecord/test/fixtures/parrots.yml @@ -24,4 +24,4 @@ DEFAULTS: &DEFAULTS parrot_sti_class: LiveParrot davey: - <<: *DEFAULTS + *DEFAULTS diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index 8ff80c6fd3..a097c77391 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -39,17 +39,6 @@ module <%= app_const_base %> # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de - # Please note that JavaScript expansions are *ignored altogether* if the asset - # pipeline is enabled (see config.assets.enabled below). Put your defaults in - # app/assets/javascripts/application.js in that case. - # - # JavaScript files you want as :defaults (application.js is always included). -<% if options[:skip_javascript] -%> - # config.action_view.javascript_expansions[:defaults] = %w() -<% else -%> - # config.action_view.javascript_expansions[:defaults] = %w(prototype prototype_ujs) -<% end -%> - # Configure the default encoding used in templates for Ruby 1.9. config.encoding = "utf-8" diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index 9ddb3cae33..4967d1793c 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -202,7 +202,7 @@ task :default => :test end def create_test_dummy_files - return if options[:skip_test_unit] + return if options[:skip_test_unit] && options[:dummy_path] == 'test/dummy' create_dummy_app end diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec index 3d9bfb22c7..15299ddb9f 100644 --- a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec +++ b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec @@ -4,6 +4,6 @@ Gem::Specification.new do |s| s.name = "<%= name %>" s.summary = "Insert <%= camelized %> summary." s.description = "Insert <%= camelized %> description." - s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] + s.files = Dir["{app,config,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.version = "0.0.1" end diff --git a/railties/test/application/initializers/notifications_test.rb b/railties/test/application/initializers/notifications_test.rb index 7e035be764..c87433db0d 100644 --- a/railties/test/application/initializers/notifications_test.rb +++ b/railties/test/application/initializers/notifications_test.rb @@ -33,7 +33,7 @@ module ApplicationTests wait assert_equal 1, logger.logged(:debug).size - assert_match /SHOW tables/, logger.logged(:debug).last + assert_match(/SHOW tables/, logger.logged(:debug).last) end end end diff --git a/railties/test/application/rack/logger_test.rb b/railties/test/application/rack/logger_test.rb index a29244357c..715af5c642 100644 --- a/railties/test/application/rack/logger_test.rb +++ b/railties/test/application/rack/logger_test.rb @@ -21,19 +21,19 @@ module ApplicationTests test "logger logs proper HTTP verb and path" do get "/blah" wait - assert_match /^Started GET "\/blah"/, logs[0] + assert_match(/^Started GET "\/blah"/, logs[0]) end test "logger logs HTTP verb override" do post "/", {:_method => 'put'} wait - assert_match /^Started PUT "\/"/, logs[0] + assert_match(/^Started PUT "\/"/, logs[0]) end test "logger logs HEAD requests" do post "/", {:_method => 'head'} wait - assert_match /^Started HEAD "\/"/, logs[0] + assert_match(/^Started HEAD "\/"/, logs[0]) end end end diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index d77c2d14ab..ab36ace5e5 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -31,7 +31,7 @@ module ApplicationTests AppTemplate::Application.initialize! RUBY - assert_match "SuperMiddleware", Dir.chdir(app_path){ `rake middleware` } + assert_match("SuperMiddleware", Dir.chdir(app_path){ `rake middleware` }) end def test_initializers_are_executed_in_rake_tasks @@ -93,16 +93,16 @@ module ApplicationTests end output = Dir.chdir(app_path){ `rake db:migrate` } - assert_match /create_table\(:users\)/, output - assert_match /CreateUsers: migrated/, output - assert_match /add_column\(:users, :email, :string\)/, output - assert_match /AddEmailToUsers: migrated/, output + assert_match(/create_table\(:users\)/, output) + assert_match(/CreateUsers: migrated/, output) + assert_match(/add_column\(:users, :email, :string\)/, output) + assert_match(/AddEmailToUsers: migrated/, output) output = Dir.chdir(app_path){ `rake db:rollback STEP=2` } - assert_match /drop_table\("users"\)/, output - assert_match /CreateUsers: reverted/, output - assert_match /remove_column\("users", :email\)/, output - assert_match /AddEmailToUsers: reverted/, output + assert_match(/drop_table\("users"\)/, output) + assert_match(/CreateUsers: reverted/, output) + assert_match(/remove_column\("users", :email\)/, output) + assert_match(/AddEmailToUsers: reverted/, output) end def test_loading_specific_fixtures diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index 297ac5d238..5ffc2501cd 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -169,12 +169,26 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_file "app/views/layouts/bukkits/application.html.erb", /<title>Bukkits<\/title>/ end + def test_creating_gemspec + run_generator + assert_file "bukkits.gemspec", /s.name = "bukkits"/ + assert_file "bukkits.gemspec", /s.files = Dir\["\{app,config,lib\}\/\*\*\/\*"\]/ + assert_file "bukkits.gemspec", /s.version = "0.0.1"/ + end + def test_passing_dummy_path_as_a_parameter run_generator [destination_root, "--dummy_path", "spec/dummy"] assert_file "spec/dummy" assert_file "spec/dummy/config/application.rb" assert_no_file "test/dummy" end + + def test_creating_dummy_without_tests_but_with_dummy_path + run_generator [destination_root, "--dummy_path", "spec/dummy", "--skip-test-unit"] + assert_file "spec/dummy" + assert_file "spec/dummy/config/application.rb" + assert_no_file "test" + end def test_skipping_gemspec run_generator [destination_root, "--skip-gemspec"] |