another (!) mini-framework experiment for Ruby and Rack
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
lib
test
README
Rakefile

README

=Dot
Another (!) mini-framework experiment for Ruby and Rack.

==Example

In a file called my_app.rb, put the following

	require 'dot'

	class MyApp

		include Dot::App

		map :index
		map :status, 'status/:type', :rules=>{:type=>/\d+/}, :defaults=>{:type=>1}
		map :foward, 'forward'

		def index
			'My app has action!'
		end

		def status
			throw(:halt, :status=>500, :body=>'type param required!') unless @request.params['type']
			"Status for #{@request.params['type]}..."
		end
		
		def forward
			forward_to MySubApp
		end
		
	end

	class MySubApp
		include Dot::App
		map :index
		def index
			self.class.to_s
		end
	end

Go to the directory where you saved your my_app.rb file.

Create a config.ru file like:
	
	require 'my_app.rb'
	run MyApp.new

Start the server:
	
	rackup

Now "browse" to:
	
	http://localhost:9292/
	http://localhost:9292/status/100
	http://localhost:9292/status (bad request)
	http://localhost:9292/foward

==Other cool Ruby mini-frameworks

	Camping
	Sinatra