Permalink
Browse files

updated example

  • Loading branch information...
1 parent 25941db commit fe9a8c598ea616cbf83f0de87b71fb181fc061c1 @rkh committed Apr 1, 2010
Showing with 6 additions and 4 deletions.
  1. +5 −3 README.md
  2. +1 −1 lib/sinatra/sugar.rb
View
8 README.md
@@ -41,9 +41,11 @@ Ability to extend command line options
Example:
- require "sinatra"
+ require "sinatra/base"
require "sinatra/sugar"
-
- configure do
+
+ class App < Sinatra::Base
+ register Sinatra::Sugar
run_option_parser.on("-i") { puts "yes, -i is a nice option" }
+ run! if $0 == __FILE__
end
View
2 lib/sinatra/sugar.rb
@@ -128,7 +128,7 @@ def run_option_parser
# Extended #run!, offers an extandable option parser for
# BigBand with the same standard options as the one of
- # Sinatra#Default (see #run_option_parser).
+ # Sinatra::Base (see #run_option_parser).
def run!(options = {})
run_option_parser.parse!(ARGV.dup) unless ARGV.empty?
@running = true

0 comments on commit fe9a8c5

Please sign in to comment.