Skip to content
This repository
Browse code

gsub("css", "CSS") and assorted improvements

  • Loading branch information...
commit 55b995ba6bafdddd01dc8fe6591aaada6e03197f 1 parent 69597df
Xavier Noria authored May 19, 2008
24  actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -11,8 +11,8 @@ module Helpers #:nodoc:
11 11
     # === Using asset hosts
12 12
     # By default, Rails links to these assets on the current host in the public
13 13
     # folder, but you can direct Rails to link to assets from a dedicated assets server by 
14  
-    # setting ActionController::Base.asset_host in your environment.rb.  For example,
15  
-    # let's say your asset host is assets.example.com. 
  14
+    # setting ActionController::Base.asset_host in your <tt>config/environment.rb</tt>.  For example,
  15
+    # let's say your asset host is <tt>assets.example.com</tt>.
16 16
     #
17 17
     #   ActionController::Base.asset_host = "assets.example.com"
18 18
     #   image_tag("rails.png")
@@ -22,8 +22,8 @@ module Helpers #:nodoc:
22 22
     #
23 23
     # This is useful since browsers typically open at most two connections to a single host,
24 24
     # which means your assets often wait in single file for their turn to load.  You can
25  
-    # alleviate this by using a %d wildcard in <tt>asset_host</tt> (for example, "assets%d.example.com") 
26  
-    # to automatically distribute asset requests among four hosts (e.g., assets0.example.com through assets3.example.com)
  25
+    # alleviate this by using a <tt>%d</tt> wildcard in <tt>asset_host</tt> (for example, "assets%d.example.com") 
  26
+    # to automatically distribute asset requests among four hosts (e.g., "assets0.example.com" through "assets3.example.com")
27 27
     # so browsers will open eight connections rather than two.  
28 28
     #
29 29
     #   image_tag("rails.png")
@@ -293,9 +293,9 @@ def self.reset_javascript_include_default #:nodoc:
293 293
       end
294 294
 
295 295
       # Computes the path to a stylesheet asset in the public stylesheets directory.
296  
-      # If the +source+ filename has no extension, .css will be appended.
  296
+      # If the +source+ filename has no extension, <tt>.css</tt> will be appended.
297 297
       # Full paths from the document root will be passed through.
298  
-      # Used internally by stylesheet_link_tag to build the stylesheet path.
  298
+      # Used internally by +stylesheet_link_tag+ to build the stylesheet path.
299 299
       #
300 300
       # ==== Examples
301 301
       #   stylesheet_path "style" # => /stylesheets/style.css
@@ -309,7 +309,7 @@ def stylesheet_path(source)
309 309
       alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with a stylesheet_path named route
310 310
 
311 311
       # Returns a stylesheet link tag for the sources specified as arguments. If
312  
-      # you don't specify an extension, .css will be appended automatically.
  312
+      # you don't specify an extension, <tt>.css</tt> will be appended automatically.
313 313
       # You can modify the link attributes by passing a hash as the last argument.
314 314
       #
315 315
       # ==== Examples
@@ -379,7 +379,7 @@ def stylesheet_link_tag(*sources)
379 379
 
380 380
       # Computes the path to an image asset in the public images directory.
381 381
       # Full paths from the document root will be passed through.
382  
-      # Used internally by image_tag to build the image path.
  382
+      # Used internally by +image_tag+ to build the image path.
383 383
       #
384 384
       # ==== Examples
385 385
       #   image_path("edit")                                         # => /images/edit
@@ -454,8 +454,8 @@ def file_exist?(path)
454 454
           end
455 455
         end
456 456
 
457  
-        # Add the .ext if not present. Return full URLs otherwise untouched.
458  
-        # Prefix with /dir/ if lacking a leading /. Account for relative URL
  457
+        # Add the the extension +ext+ if not present. Return full URLs otherwise untouched.
  458
+        # Prefix with <tt>/dir/</tt> if lacking a leading +/+. Account for relative URL
459 459
         # roots. Rewrite the asset path for cache-busting asset ids. Include
460 460
         # asset host, if configured, with the correct request protocol.
461 461
         def compute_public_path(source, dir, ext = nil, include_host = true)
@@ -502,9 +502,9 @@ def compute_public_path(source, dir, ext = nil, include_host = true)
502 502
             end
503 503
         end
504 504
 
505  
-        # Pick an asset host for this source. Returns nil if no host is set,
  505
+        # Pick an asset host for this source. Returns +nil+ if no host is set,
506 506
         # the host if no wildcard is set, the host interpolated with the
507  
-        # numbers 0-3 if it contains %d (the number is the source hash mod 4),
  507
+        # numbers 0-3 if it contains <tt>%d</tt> (the number is the source hash mod 4),
508 508
         # or the value returned from invoking the proc if it's a proc.
509 509
         def compute_asset_host(source)
510 510
           if host = ActionController::Base.asset_host
2  actionpack/lib/action_view/helpers/sanitize_helper.rb
@@ -194,7 +194,7 @@ def sanitized_allowed_css_properties=(attributes)
194 194
           HTML::WhiteListSanitizer.allowed_css_properties.merge(attributes)
195 195
         end
196 196
 
197  
-        # Adds to the Set of allowed css keywords for the +sanitize+ and +sanitize_css+ helpers.
  197
+        # Adds to the Set of allowed CSS keywords for the +sanitize+ and +sanitize_css+ helpers.
198 198
         #
199 199
         #   Rails::Initializer.run do |config|
200 200
         #     config.action_view.sanitized_allowed_css_keywords = 'expression'
2  railties/test/generators/generator_test_helper.rb
@@ -206,7 +206,7 @@ def assert_generated_module(path)
206 206
     end
207 207
   end
208 208
 
209  
-  # Asserts that the given css stylesheet file was generated.
  209
+  # Asserts that the given CSS stylesheet file was generated.
210 210
   # It takes a path without the <tt>.css</tt> part.
211 211
   # The contents of the stylesheet source file is passed to a block.
212 212
   def assert_generated_stylesheet(path)

0 notes on commit 55b995b

Please sign in to comment.
Something went wrong with that request. Please try again.