diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-04 23:53:41 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-04 23:53:41 +0000 |
commit | 045f5fd02e8418fedba651b329715a0bb5ea8c68 (patch) | |
tree | fb0826af8880971a69537ddad3a4bd5d800c0adc | |
parent | 55854c4195177d2d5cbf0497c77e63b24cb76074 (diff) | |
download | rails-045f5fd02e8418fedba651b329715a0bb5ea8c68.tar.gz rails-045f5fd02e8418fedba651b329715a0bb5ea8c68.tar.bz2 rails-045f5fd02e8418fedba651b329715a0bb5ea8c68.zip |
Added public/javascripts/application.js as a sample since it'll automatically be included in javascript_include_tag :defaults [DHH] (backed out of -a/--with-assets, not worth it)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/Rakefile | 2 | ||||
-rw-r--r-- | railties/assets/application.css | 1 | ||||
-rw-r--r-- | railties/assets/application.js | 1 | ||||
-rw-r--r-- | railties/assets/application.rhtml | 15 | ||||
-rw-r--r-- | railties/html/javascripts/application.js | 2 | ||||
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 21 |
7 files changed, 10 insertions, 34 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 4155b1d539..23c4d190bd 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,6 +1,6 @@ *SVN* -* Added -a/--with-assets option to rails generator that will include default assets for application layout, javascript, and stylesheet (this an experiment and may go away at any time!) [DHH] +* Added public/javascripts/application.js as a sample since it'll automatically be included in javascript_include_tag :defaults [DHH] * Added socket cleanup for lighttpd, both before and after [DHH] diff --git a/railties/Rakefile b/railties/Rakefile index 823837585a..74cd67bc07 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -39,7 +39,7 @@ TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test ) LOG_FILES = %w( server.log development.log test.log production.log ) HTML_FILES = %w( 404.html 500.html index.html robots.txt favicon.ico images/rails.png - javascripts/prototype.js + javascripts/prototype.js javascripts/application.js javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js ) BIN_FILES = %w( about breakpointer console destroy generate performance/benchmarker performance/profiler process/reaper process/spawner runner server plugin ) diff --git a/railties/assets/application.css b/railties/assets/application.css deleted file mode 100644 index bf0bd539b8..0000000000 --- a/railties/assets/application.css +++ /dev/null @@ -1 +0,0 @@ -/* Place your application-specific styles here */ diff --git a/railties/assets/application.js b/railties/assets/application.js deleted file mode 100644 index c963741545..0000000000 --- a/railties/assets/application.js +++ /dev/null @@ -1 +0,0 @@ -// Place your application-specific JavaScript functions and classes here diff --git a/railties/assets/application.rhtml b/railties/assets/application.rhtml deleted file mode 100644 index 5c796f3bd4..0000000000 --- a/railties/assets/application.rhtml +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title><%=h @title || "Rails Application" %></title> - <%= javascript_include_tag :defaults %> - <%= stylesheet_link_tag "application" %> - </head> - - <body> - <%= yield %> - </body> -</html>
\ No newline at end of file diff --git a/railties/html/javascripts/application.js b/railties/html/javascripts/application.js new file mode 100644 index 0000000000..fe4577696b --- /dev/null +++ b/railties/html/javascripts/application.js @@ -0,0 +1,2 @@ +// Place your application-specific JavaScript functions and classes here +// This file is automatically included by javascript_include_tag :defaults diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index 8e40127dce..2a71c35599 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -6,7 +6,7 @@ class AppGenerator < Rails::Generator::Base DATABASES = %w( mysql oracle postgresql sqlite2 sqlite3 ) - default_options :db => "mysql", :shebang => DEFAULT_SHEBANG, :include_assets => false + default_options :db => "mysql", :shebang => DEFAULT_SHEBANG mandatory_options :source => "#{File.dirname(__FILE__)}/../../../../.." def initialize(runtime_args, runtime_options = {}) @@ -69,10 +69,11 @@ class AppGenerator < Rails::Generator::Base m.file "html/images/rails.png", "public/images/rails.png" # Javascripts - m.file "html/javascripts/prototype.js", "public/javascripts/prototype.js" - m.file "html/javascripts/effects.js", "public/javascripts/effects.js" - m.file "html/javascripts/dragdrop.js", "public/javascripts/dragdrop.js" - m.file "html/javascripts/controls.js", "public/javascripts/controls.js" + m.file "html/javascripts/prototype.js", "public/javascripts/prototype.js" + m.file "html/javascripts/effects.js", "public/javascripts/effects.js" + m.file "html/javascripts/dragdrop.js", "public/javascripts/dragdrop.js" + m.file "html/javascripts/controls.js", "public/javascripts/controls.js" + m.file "html/javascripts/application.js", "public/javascripts/application.js" # Docs m.file "doc/README_FOR_APP", "doc/README_FOR_APP" @@ -81,13 +82,6 @@ class AppGenerator < Rails::Generator::Base %w(server production development test).each { |file| m.file "configs/empty.log", "log/#{file}.log", :chmod => 0666 } - - # Default assets - if options[:include_assets] - m.file "assets/application.css", "public/stylesheets/application.css" - m.file "assets/application.js", "public/javascripts/application.css" - m.file "assets/application.rhtml", "app/views/layouts/application.rhtml" - end end end @@ -106,9 +100,6 @@ class AppGenerator < Rails::Generator::Base opt.on("-d", "--database=name", String, "Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).", "Default: mysql") { |options[:db]| } - - opt.on("-a", "--with-assets", - "Include default assets for layout, javascript, and stylesheet.") { |options[:include_assets]| } end def mysql_socket_location |