Permalink
Browse files

some fixes

  • Loading branch information...
1 parent e583d6e commit 199d687ef51dc4699860ef97141f30fc619c61c9 @daddz daddz committed Feb 6, 2011
Showing with 36 additions and 13 deletions.
  1. +5 −0 README.md
  2. +0 −5 apps/bar.rb
  3. +0 −5 apps/foo.rb
  4. +3 −3 config/boot.rb
  5. +14 −0 lib/bar.rb
  6. +14 −0 lib/foo.rb
View
@@ -15,3 +15,8 @@ So here it is.
- run `rspec spec/` (just for fun)
- start building your project
+
+- modify app function in config/boot.rb to map your apps to the routes
+
+## Why
+
View
@@ -1,5 +0,0 @@
-class Bar < Sinatra::Base
- get '/' do
- "Hello from bar"
- end
-end
View
@@ -1,5 +0,0 @@
-class Foo < Sinatra::Base
- get '/' do
- "Hello from foo"
- end
-end
View
@@ -5,12 +5,12 @@
Bundler.require(:default, ENV["RACK_ENV"].to_sym)
-Dir["./apps/*.rb"].each { |f| require f }
+Dir["./lib/*.rb"].each { |f| require f }
def app
Rack::URLMap.new({
- "/" => Foo.new,
- "/bar" => Bar.new
+ "/" => Foobar::Foo.new,
+ "/bar" => Foobar::Bar.new
})
end
View
@@ -0,0 +1,14 @@
+module Foobar
+ class Bar < Sinatra::Base
+
+ #configure do
+ # set app specific settings
+ # for example different view folders
+ #end
+
+ get '/' do
+ "Hello from bar"
+ end
+
+ end
+end
View
@@ -0,0 +1,14 @@
+module Foobar
+ class Foo < Sinatra::Base
+
+ #configure do
+ # set app specific settings
+ # for example different view folders
+ #end
+
+ get '/' do
+ "Hello from foo"
+ end
+
+ end
+end

0 comments on commit 199d687

Please sign in to comment.