Skip to content

Commit

Permalink
Whitespace fixing.
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanbergen committed Sep 26, 2009
1 parent a50f160 commit 84a821b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.rdoc
Expand Up @@ -4,14 +4,14 @@ This simple plugin will register exception classes for all HTTP status. These ex
which a response will be send back to the client with the desired HTTP status, possible with some other content.

You can use this plugin to access control mechanisms. You can simply raise a HTTPStatus::Forbidden if a user is not allowed to
perform a certain action. A nice looking error page will be the result. See the example below
perform a certain action. A nice looking error page will be the result. See the example below:

See the project wiki (http://github.com/wvanbergen/http_status_exceptions/wikis) for additional documentation.

== Installation

Installation is simple. Simply add the gem in your <tt>environment.rb</tt>:

Rails::Initializer.run do |config|
...
config.gem 'wvanbergen-http_status_exceptions', :lib => 'http_status_exceptions', :source => 'http://gems.github.com'
Expand All @@ -22,12 +22,12 @@ Run <tt>rake gems:install</tt> to install the gem if needed.
== Configuration

You can modify where HTTP status exception looks for its template files like so:

class ApplicationController < ActionController::Base
...
HTTPStatus::Base.template_path = 'path_to/http_status_templates'
end

You can also modify which layout is used when rendering a template by setting the <tt>template_layout</tt>:

class ApplicationController < ActionController::Base
Expand Down Expand Up @@ -56,5 +56,5 @@ to the response as well, create the following view: <tt>shared/http_status/forbi
<hr />
<p>HTTP status code <small> <%= @exception.status_code %>: <%= @exception.status.to_s.humanize %></small></p>

The response will only be sent if the request format is HTML because of the name of the view file. In theory you
The response will only be sent if the request format is HTML because of the name of the view file. In theory you
could make a response for XML requests as well by using <tt>shared/http_status/forbidden.xml.builder</tt> as filename
2 changes: 1 addition & 1 deletion Rakefile
@@ -1,5 +1,5 @@
Dir[File.dirname(__FILE__) + "/tasks/*.rake"].each { |file| load(file) }

GithubGem::RakeTasks.new(:gem)
GithubGem::RakeTasks.new(:gem)

task :default => :spec
8 changes: 4 additions & 4 deletions http_status_exceptions.gemspec
Expand Up @@ -2,17 +2,17 @@ Gem::Specification.new do |s|
s.name = 'http_status_exceptions'
s.version = "0.1.6"
s.date = "2009-09-26"

s.summary = "A Rails plugin to use exceptions for generating HTTP status responses"
s.description = "Clean up your controller code by raising exceptions that generate responses with different HTTP status codes."

s.add_runtime_dependency('action_controller')
s.add_development_dependency('rspec')

s.authors = ['Willem van Bergen']
s.email = ['willem@vanbergen.org']
s.homepage = 'http://github.com/wvanbergen/http_status_exceptions/wikis'

s.files = %w(spec/spec_helper.rb http_status_exceptions.gemspec .gitignore init.rb lib/http_status_exceptions.rb Rakefile MIT-LICENSE tasks/github-gem.rake README.rdoc spec/http_status_exception_spec.rb)
s.test_files = %w(spec/http_status_exception_spec.rb)
end

0 comments on commit 84a821b

Please sign in to comment.