Skip to content

Commit

Permalink
Added class declaration for the MissingFile exception rails#388 [Kent…
Browse files Browse the repository at this point in the history
… Sibilev]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@297 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Jan 1, 2005
1 parent 7ad83b8 commit 250a570
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*

* Added class declaration for the MissingFile exception #388 [Kent Sibilev]

* Added "short hypertext note with a hyperlink to the new URI(s)" to redirects to fulfill compliance with RFC 2616 (HTTP/1.1) section 10.3.3 #397 [Tim Bates]

* Added second boolean parameter to Base.redirect_to_url and Response#redirect to control whether the redirect is permanent or not (301 vs 302) #375 [Hodel]
Expand Down
4 changes: 3 additions & 1 deletion actionpack/lib/action_controller/base.rb
Expand Up @@ -14,6 +14,8 @@ class MissingTemplate < ActionControllerError #:nodoc:
end
class UnknownAction < ActionControllerError #:nodoc:
end
class MissingFile < ActionControllerError #:nodoc:
end

# Action Controllers are made up of one or more actions that performs its purpose and then either renders a template or
# redirects to another action. An action is defined as a public method on the controller, which will automatically be
Expand Down Expand Up @@ -432,7 +434,7 @@ def render_text(text = nil, status = nil, &block) #:doc:
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
# for the Cache-Control header spec.
def send_file(path, options = {}) #:doc:
raise MissingFile unless File.file?(path) and File.readable?(path)
raise MissingFile, path unless File.file?(path) and File.readable?(path)

options[:length] ||= File.size(path)
options[:filename] ||= File.basename(path)
Expand Down

0 comments on commit 250a570

Please sign in to comment.