Sha256: 9ac6990c000ae4701d10cfe70f26e73cca0e2b2d024ac350dda0983b3eae921e
Contents?: true
Size: 1.04 KB
Versions: 2
Compression:
Stored size: 1.04 KB
Contents
require 'rubygems' require 'benchmark' $: << 'lib' require 'renee' router = Renee::Core.new { path 'test/time' do query_string 'ok' do get { halt "ok" } post { halt [200, {}, ['POSTED!']] } end end variable do |id1, id2| path 'more' do get { halt [200, {}, "this is the id1: #{id1} id2: #{id2}" ] } end end remainder do |rest| halt "the rest is #{rest}" end }.setup { view_path('views') environment(:development) } app = Renee do path "add" do variable Integer do |first, second| "#{first} + #{second} = #{first + second}" end end end p router.call(Rack::MockRequest.env_for('/add/3/4')) # => "3 + 4 = 7" p router.call(Rack::MockRequest.env_for('/test/time?ok')) p router.call(Rack::MockRequest.env_for('/test/josh/more')) p router.call(Rack::MockRequest.env_for('/')) #puts Benchmark.measure { #50_000.times do # router.call(Rack::MockRequest.env_for('/test/josh/more')) #router.call(Rack::MockRequest.env_for('/test/time?ok', :method => 'POST' )) #end #}
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
renee-core-0.1.0 | ideal.rb |
renee-core-0.0.1 | ideal.rb |