Browse files

README: Expand installation instructions

  • Loading branch information...
1 parent add17dd commit 1b3b601902d6dc7c293476cb589296fa7f1e1716 @emk committed Apr 22, 2009
Showing with 15 additions and 3 deletions.
  1. +15 −3 README.rdoc
View
18 README.rdoc
@@ -1,12 +1,23 @@
= sinatra-url-for
<code>sinatra-url-for</code> can be used by a Sinatra application to
-construct absolute paths and full URLs. For example:
+construct absolute paths and full URLs.
+To install it, run:
+
+ sudo gem install emk-sinatra-url-for -s http://gems.github.com
+
+To include it in a Sinatra application, write:
+
+ require 'rubygems'
gem 'emk-sinatra-url-for'
require 'sinatra/url_for'
- # From within a request.
+Once this is done, you should be able to call +url_for+ from within a
+request. Assuming that your application is running on
+<code>example.com</code>, and that it has been mapped to
+<code>/myapp</code>, you should get:
+
url_for "/" # Returns "/myapp/"
url_for "/foo" # Returns "/myapp/foo"
url_for "/foo", :full # Returns "http://example.com/myapp/foo"
@@ -20,7 +31,8 @@ If you're subclassing <code>Sinatra::Base</code>, then you need to call
end
Thanks to "cypher23" on #mephisto and the folks on #rack for pointing me in
-the right direction.
+the right direction. If this gem fails to work correctly on your web
+system, please feel free to submit patches and/or bug reports!
== Copyright

0 comments on commit 1b3b601

Please sign in to comment.