diff options
author | wycats <wycats@gmail.com> | 2010-04-13 14:07:46 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-04-13 14:07:46 -0700 |
commit | 8e9df34fa3fd22719d939ba72f19b3ae9ffcc018 (patch) | |
tree | fb7d56ee45fcf33ac78f6591e1fcd8d8de3a54c4 /railties/lib/rails | |
parent | dc251389d1ab4303b80a22642f4241940b73cbe7 (diff) | |
parent | b4fd5e6f1a00b7c2b482de3d3b99a27adeba5920 (diff) | |
download | rails-8e9df34fa3fd22719d939ba72f19b3ae9ffcc018.tar.gz rails-8e9df34fa3fd22719d939ba72f19b3ae9ffcc018.tar.bz2 rails-8e9df34fa3fd22719d939ba72f19b3ae9ffcc018.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'railties/lib/rails')
6 files changed, 16 insertions, 15 deletions
diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index 2df7912741..5634ee0f69 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -18,7 +18,7 @@ ARGV.clone.options do |opts| opts.on("-h", "--help", "Show this help message.") { $stderr.puts opts; exit } - if RUBY_PLATFORM !~ /(:?mswin|mingw)/ + if RUBY_PLATFORM !~ /mswin|mingw/ opts.separator "" opts.separator "You can also use runner as a shebang line for your scripts like this:" opts.separator "-------------------------------------------------------------" diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index c284840a38..0f33b40a13 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -119,7 +119,7 @@ module Rails root = File.exist?("#{root_path}/#{flag}") ? root_path : default raise "Could not find root path for #{self}" unless root - RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? + RUBY_PLATFORM =~ /mswin|mingw/ ? Pathname.new(root).expand_path : Pathname.new(root).realpath end end diff --git a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb index 0615a34a85..9b83207b3f 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb @@ -1,13 +1,14 @@ <%%= form_for(@<%= singular_name %>) do |f| %> <%% if @<%= singular_name %>.errors.any? %> - <div id="errorExplanation"> - <h2><%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:</h2> - <ul> - <%% @<%= singular_name %>.errors.full_messages.each do |msg| %> - <li><%%= msg %></li> - <%% end %> - </ul> - </div> + <div id="error_explanation"> + <h2><%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:</h2> + + <ul> + <%% @<%= singular_name %>.errors.full_messages.each do |msg| %> + <li><%%= msg %></li> + <%% end %> + </ul> + </div> <%% end %> <% for attribute in attributes -%> diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index bb2a080286..6818fafbe9 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -265,7 +265,7 @@ module Rails::Generators "/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4 "/opt/local/var/run/mysql5/mysqld.sock", # mac + darwinports + mysql5 "/opt/lampp/var/mysql/mysql.sock" # xampp for linux - ].find { |f| File.exist?(f) } unless RUBY_PLATFORM =~ /(:?mswin|mingw)/ + ].find { |f| File.exist?(f) } unless RUBY_PLATFORM =~ /mswin|mingw/ end def empty_directory_with_gitkeep(destination, config = {}) diff --git a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css index f3f46d8b98..9f2056a702 100644 --- a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css +++ b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css @@ -34,7 +34,7 @@ div.field, div.actions { display: table; } -#errorExplanation { +#error_explanation { width: 450px; border: 2px solid red; padding: 7px; @@ -43,7 +43,7 @@ div.field, div.actions { background-color: #f0f0f0; } -#errorExplanation h2 { +#error_explanation h2 { text-align: left; font-weight: bold; padding: 5px 5px 5px 15px; @@ -54,7 +54,7 @@ div.field, div.actions { color: #fff; } -#errorExplanation ul li { +#error_explanation ul li { font-size: 12px; list-style: square; } diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 23b8f92abd..83f25506cb 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -30,7 +30,7 @@ end module Kernel def silence_stderr old_stderr = STDERR.dup - STDERR.reopen(RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'NUL:' : '/dev/null') + STDERR.reopen(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null') STDERR.sync = true yield ensure |