Permalink
Browse files

Merge remote branch 'docrails/master'

  • Loading branch information...
2 parents 9362ef6 + b59a8d4 commit dd6efe98b62946ae4d4df0672292449226b8d6fc @fxn fxn committed Sep 14, 2010
@@ -65,7 +65,8 @@ def escape_javascript(javascript)
# //]]>
# </script>
#
- # +html_options+ may be a hash of attributes for the <script> tag. Example:
+ # +html_options+ may be a hash of attributes for the <tt><script></tt>
+ # tag. Example:
# javascript_tag "alert('All is good')", :defer => 'defer'
# # => <script defer="defer" type="text/javascript">alert('All is good')</script>
#
@@ -161,8 +161,8 @@ def include_helpers_from_context
# JavaScriptGenerator generates blocks of JavaScript code that allow you
# to change the content and presentation of multiple DOM elements. Use
- # this in your Ajax response bodies, either in a <script> tag or as plain
- # JavaScript sent with a Content-type of "text/javascript".
+ # this in your Ajax response bodies, either in a <tt><script></tt> tag
+ # or as plain JavaScript sent with a Content-type of "text/javascript".
#
# Create new instances with PrototypeHelper#update_page or with
# ActionController::Base#render, then call +insert_html+, +replace_html+,
@@ -224,7 +224,7 @@ def include_helpers_from_context
#
# You can also use PrototypeHelper#update_page_tag instead of
# PrototypeHelper#update_page to wrap the generated JavaScript in a
- # <script> tag.
+ # <tt><script></tt> tag.
module GeneratorMethods
def to_s #:nodoc:
(@lines * $/).tap do |javascript|
@@ -582,12 +582,12 @@ def update_page(&block)
JavaScriptGenerator.new(self, &block).to_s.html_safe
end
- # Works like update_page but wraps the generated JavaScript in a <script>
- # tag. Use this to include generated JavaScript in an ERb template.
- # See JavaScriptGenerator for more information.
+ # Works like update_page but wraps the generated JavaScript in a
+ # <tt><script></tt> tag. Use this to include generated JavaScript in an
+ # ERb template. See JavaScriptGenerator for more information.
#
- # +html_options+ may be a hash of <script> attributes to be passed
- # to ActionView::Helpers::JavaScriptHelper#javascript_tag.
+ # +html_options+ may be a hash of <tt><script></tt> attributes to be
+ # passed to ActionView::Helpers::JavaScriptHelper#javascript_tag.
def update_page_tag(html_options = {}, &block)
javascript_tag update_page(&block), html_options
end
@@ -83,13 +83,13 @@ def initialize
super { |h,k| h[k] = [] }
end
- # return a list of new constants found since the last call to watch_modules
+ # return a list of new constants found since the last call to watch_namespaces
def new_constants
constants = []
# Grab the list of namespaces that we're looking for new constants under
@watching.last.each do |namespace|
- # Retrieve the constants that were present under the namespace when watch_modules
+ # Retrieve the constants that were present under the namespace when watch_namespaces
# was originally called
original_constants = self[namespace].last
@@ -115,7 +115,7 @@ def new_constants
end
constants
ensure
- # A call to new_constants is always called after a call to watch_modules
+ # A call to new_constants is always called after a call to watch_namespaces
pop_modules(@watching.pop)
end
@@ -241,8 +241,7 @@ h4. Running Tests
Running a test is as simple as invoking the file containing the test cases through Ruby:
<shell>
-$ cd test
-$ ruby unit/post_test.rb
+$ ruby -Itest test/unit/post_test.rb
Loaded suite unit/post_test
Started
@@ -252,12 +251,12 @@ Finished in 0.023513 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
</shell>
-This will run all the test methods from the test case.
+This will run all the test methods from the test case. Note that +test_helper.rb+ is in the +test+ directory, hence this directory needs to be added to the load path using the +-I+ switch.
You can also run a particular test method from the test case by using the +-n+ switch with the +test method name+.
<shell>
-$ ruby unit/post_test.rb -n test_truth
+$ ruby -Itest test/unit/post_test.rb -n test_truth
Loaded suite unit/post_test
Started
@@ -1,5 +1,5 @@
<%= app_const %>.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
@@ -1,5 +1,5 @@
<%= app_const %>.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
@@ -1,5 +1,5 @@
<%= app_const %>.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+ # Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that

0 comments on commit dd6efe9

Please sign in to comment.