提交 783007a8 编写于 作者: J Joost Baaij

Replace example hostname with "example.com".

The hostname used in these comments actually exists, which is
undesirable. See also RFC 2606.
上级 2f0dca5e
......@@ -268,7 +268,7 @@ def favicon_link_tag(source='/favicon.ico', options={})
# image_path("edit.png") # => "/images/edit.png"
# image_path("icons/edit.png") # => "/images/icons/edit.png"
# image_path("/icons/edit.png") # => "/icons/edit.png"
# image_path("http://www.railsapplication.com/img/edit.png") # => "http://www.railsapplication.com/img/edit.png"
# image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png"
#
# If you have images as application resources this method may conflict with their named routes.
# The alias +path_to_image+ is provided to avoid that. Rails uses the alias internally, and
......@@ -291,7 +291,7 @@ def image_path(source)
# video_path("hd.avi") # => /videos/hd.avi
# video_path("trailers/hd.avi") # => /videos/trailers/hd.avi
# video_path("/trailers/hd.avi") # => /trailers/hd.avi
# video_path("http://www.railsapplication.com/vid/hd.avi") # => http://www.railsapplication.com/vid/hd.avi
# video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi
def video_path(source)
if config.use_sprockets
asset_path(source)
......@@ -310,7 +310,7 @@ def video_path(source)
# audio_path("horse.wav") # => /audios/horse.wav
# audio_path("sounds/horse.wav") # => /audios/sounds/horse.wav
# audio_path("/sounds/horse.wav") # => /sounds/horse.wav
# audio_path("http://www.railsapplication.com/sounds/horse.wav") # => http://www.railsapplication.com/sounds/horse.wav
# audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav
def audio_path(source)
if config.use_sprockets
asset_path(source)
......
......@@ -77,11 +77,11 @@ def register_javascript_expansion(expansions)
# Used internally by javascript_include_tag to build the script path.
#
# ==== Examples
# javascript_path "xmlhr" # => /javascripts/xmlhr.js
# javascript_path "dir/xmlhr.js" # => /javascripts/dir/xmlhr.js
# javascript_path "/dir/xmlhr" # => /dir/xmlhr.js
# javascript_path "http://www.railsapplication.com/js/xmlhr" # => http://www.railsapplication.com/js/xmlhr
# javascript_path "http://www.railsapplication.com/js/xmlhr.js" # => http://www.railsapplication.com/js/xmlhr.js
# javascript_path "xmlhr" # => /javascripts/xmlhr.js
# javascript_path "dir/xmlhr.js" # => /javascripts/dir/xmlhr.js
# javascript_path "/dir/xmlhr" # => /dir/xmlhr.js
# javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr
# javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js
def javascript_path(source)
if config.use_sprockets
asset_path(source, 'js')
......@@ -123,11 +123,11 @@ def javascript_path(source)
# # => <script type="text/javascript" src="/javascripts/common.javascript?1284139606"></script>
# # <script type="text/javascript" src="/elsewhere/cools.js?1423139606"></script>
#
# javascript_include_tag "http://www.railsapplication.com/xmlhr"
# # => <script type="text/javascript" src="http://www.railsapplication.com/xmlhr.js?1284139606"></script>
# javascript_include_tag "http://www.example.com/xmlhr"
# # => <script type="text/javascript" src="http://www.example.com/xmlhr.js?1284139606"></script>
#
# javascript_include_tag "http://www.railsapplication.com/xmlhr.js"
# # => <script type="text/javascript" src="http://www.railsapplication.com/xmlhr.js?1284139606"></script>
# javascript_include_tag "http://www.example.com/xmlhr.js"
# # => <script type="text/javascript" src="http://www.example.com/xmlhr.js?1284139606"></script>
#
# javascript_include_tag :defaults
# # => <script type="text/javascript" src="/javascripts/jquery.js?1284139606"></script>
......
......@@ -54,11 +54,11 @@ def register_stylesheet_expansion(expansions)
# Used internally by +stylesheet_link_tag+ to build the stylesheet path.
#
# ==== Examples
# stylesheet_path "style" # => /stylesheets/style.css
# stylesheet_path "dir/style.css" # => /stylesheets/dir/style.css
# stylesheet_path "/dir/style.css" # => /dir/style.css
# stylesheet_path "http://www.railsapplication.com/css/style" # => http://www.railsapplication.com/css/style
# stylesheet_path "http://www.railsapplication.com/css/style.css" # => http://www.railsapplication.com/css/style.css
# stylesheet_path "style" # => /stylesheets/style.css
# stylesheet_path "dir/style.css" # => /stylesheets/dir/style.css
# stylesheet_path "/dir/style.css" # => /dir/style.css
# stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style
# stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css
def stylesheet_path(source)
if config.use_sprockets
asset_path(source, 'css')
......@@ -79,8 +79,8 @@ def stylesheet_path(source)
# stylesheet_link_tag "style.css" # =>
# <link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "http://www.railsapplication.com/style.css" # =>
# <link href="http://www.railsapplication.com/style.css" media="screen" rel="stylesheet" type="text/css" />
# stylesheet_link_tag "http://www.example.com/style.css" # =>
# <link href="http://www.example.com/style.css" media="screen" rel="stylesheet" type="text/css" />
#
# stylesheet_link_tag "style", :media => "all" # =>
# <link href="/stylesheets/style.css" media="all" rel="stylesheet" type="text/css" />
......
......@@ -68,7 +68,7 @@ def url_options
# # => /books/find
#
# <%= url_for(:action => 'login', :controller => 'members', :only_path => false, :protocol => 'https') %>
# # => https://www.railsapplication.com/members/login/
# # => https://www.example.com/members/login/
#
# <%= url_for(:action => 'play', :anchor => 'player') %>
# # => /messages/play/#player
......
......@@ -69,10 +69,10 @@ def url_for(*args)
assert_equal "/dir/xmlhr.js",
asset_path("/dir/xmlhr", "js")
assert_equal "http://www.railsapplication.com/js/xmlhr",
asset_path("http://www.railsapplication.com/js/xmlhr", "js")
assert_equal "http://www.railsapplication.com/js/xmlhr.js",
asset_path("http://www.railsapplication.com/js/xmlhr.js", "js")
assert_equal "http://www.example.com/js/xmlhr",
asset_path("http://www.example.com/js/xmlhr", "js")
assert_equal "http://www.example.com/js/xmlhr.js",
asset_path("http://www.example.com/js/xmlhr.js", "js")
end
test "javascript include tag" do
......@@ -83,8 +83,8 @@ def url_for(*args)
sprockets_javascript_include_tag("xmlhr")
assert_equal '<script src="/assets/xmlhr-d41d8cd98f00b204e9800998ecf8427e.js" type="text/javascript"></script>',
sprockets_javascript_include_tag("xmlhr.js")
assert_equal '<script src="http://www.railsapplication.com/xmlhr" type="text/javascript"></script>',
sprockets_javascript_include_tag("http://www.railsapplication.com/xmlhr")
assert_equal '<script src="http://www.example.com/xmlhr" type="text/javascript"></script>',
sprockets_javascript_include_tag("http://www.example.com/xmlhr")
end
test "stylesheet path" do
......@@ -94,10 +94,10 @@ def url_for(*args)
assert_equal "/assets/dir/style-d41d8cd98f00b204e9800998ecf8427e.css", asset_path("dir/style.css", "css")
assert_equal "/dir/style.css", asset_path("/dir/style.css", "css")
assert_equal "http://www.railsapplication.com/css/style",
asset_path("http://www.railsapplication.com/css/style", "css")
assert_equal "http://www.railsapplication.com/css/style.css",
asset_path("http://www.railsapplication.com/css/style.css", "css")
assert_equal "http://www.example.com/css/style",
asset_path("http://www.example.com/css/style", "css")
assert_equal "http://www.example.com/css/style.css",
asset_path("http://www.example.com/css/style.css", "css")
end
test "stylesheet link tag" do
......@@ -109,8 +109,8 @@ def url_for(*args)
assert_equal '<link href="/assets/style-d41d8cd98f00b204e9800998ecf8427e.css" media="screen" rel="stylesheet" type="text/css" />',
sprockets_stylesheet_link_tag("style.css")
assert_equal '<link href="http://www.railsapplication.com/style.css" media="screen" rel="stylesheet" type="text/css" />',
sprockets_stylesheet_link_tag("http://www.railsapplication.com/style.css")
assert_equal '<link href="http://www.example.com/style.css" media="screen" rel="stylesheet" type="text/css" />',
sprockets_stylesheet_link_tag("http://www.example.com/style.css")
assert_equal '<link href="/assets/style-d41d8cd98f00b204e9800998ecf8427e.css" media="all" rel="stylesheet" type="text/css" />',
sprockets_stylesheet_link_tag("style", :media => "all")
assert_equal '<link href="/assets/style-d41d8cd98f00b204e9800998ecf8427e.css" media="print" rel="stylesheet" type="text/css" />',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册