Permalink
Browse files

Fixed that script/server running against Mongrel should tail the prop…

…er log regardless of the environment [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5652 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ec75642 commit 8dca6586ded76d5950b4fccfb720e2861efede6d @dhh dhh committed Nov 30, 2006
@@ -223,6 +223,11 @@ def check_box(object_name, method, options = {}, checked_value = "1", unchecked_
def radio_button(object_name, method, tag_value, options = {})
InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_radio_button_tag(tag_value, options)
end
+
+
+ def label(object_name, method, options = {})
+ InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_label_tag(options)
+ end
end
class InstanceTag #:nodoc:
@@ -328,6 +333,10 @@ def to_boolean_select_tag(options = {})
tag_text << ">True</option></select>"
end
+ def to_label_tag(options = {})
+ label_tag(options.delete(:text) || value(object).humanize, options.reverse_merge(:for => tag_id))
+ end
+
def to_content_tag(tag_name, options = {})
content_tag(tag_name, value(object), options)
end
@@ -153,6 +153,11 @@ def radio_button_tag(name, value, checked = false, options = {})
tag :input, html_options
end
+ # Creates a label tag.
+ def label_tag(text, options = {})
+ content_tag :label, text, options
+ end
+
# Creates a submit button with the text <tt>value</tt> as the caption. If options contains a pair with the key of "disable_with",
# then the value will be used to rename a disabled version of the submit button.
def submit_tag(value = "Save changes", options = {})
@@ -163,6 +163,12 @@ def test_date_selects
)
end
+ def test_label
+ assert_dom_equal('<label for="post_body">Body</label>', label("post", "body"))
+ assert_dom_equal('<label for="post_body">Super body</label>', label("post", "body", :text => "Super body"))
+ assert_dom_equal('<label for="post_body" class="strong">Super body</label>', label("post", "body", :text => "Super body", :class => "strong"))
+ end
+
def test_explicit_name
assert_dom_equal(
'<input id="post_title" name="dont guess" size="30" type="text" value="Hello World" />', text_field("post", "title", "name" => "dont guess")
View
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that script/server running against Mongrel should tail the proper log regardless of the environment [DHH]
+
* Update initializer to load Rails::VERSION as soon as possible. Closes #6698. [Nicholas Seckar]
* Added ActiveRecord::Base.clear_active_connections! in development mode so the database connection is not carried over from request to request. Some databases won't reread the schema if that doesn't happen (I'm looking at you SQLite), so you have to restart the server after each migration (= no fun) [DHH]
@@ -11,10 +11,6 @@
exit 1
end
-require 'initializer'
-configuration = Rails::Initializer.run(:initialize_logger).configuration
-default_config_file = config_file = Pathname.new("#{RAILS_ROOT}/config/lighttpd.conf").cleanpath
-
require 'optparse'
detach = false
@@ -67,6 +63,10 @@
tail_thread = nil
if !detach
+ require 'initializer'
+ configuration = Rails::Initializer.run(:initialize_logger).configuration
+ default_config_file = config_file = Pathname.new("#{RAILS_ROOT}/config/lighttpd.conf").cleanpath
+
puts "=> Call with -d to detach"
puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)"
detach = false
@@ -33,8 +33,11 @@
puts "=> Rails application starting on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
if OPTIONS[:detach]
- `mongrel_rails start -d -p #{OPTIONS[:port]} -a #{OPTIONS[:ip]} -e #{OPTIONS[:environment]}`
+ `mongrel_rails start -d -p #{OPTIONS[:port]} -a #{OPTIONS[:ip]} -e #{OPTIONS[:environment]} -P #{RAILS_ROOT}/tmp/pids/mongrel.pid`
else
+ ENV["RAILS_ENV"] = OPTIONS[:environment]
+ RAILS_ENV.replace(OPTIONS[:environment]) if defined?(RAILS_ENV)
+
require 'initializer'
Rails::Initializer.run(:initialize_logger)

0 comments on commit 8dca658

Please sign in to comment.