Skip to content

Instantly share code, notes, and snippets.

@adilsoncarvalho
Created July 30, 2012 19:21
Show Gist options
  • Save adilsoncarvalho/3209340 to your computer and use it in GitHub Desktop.
Save adilsoncarvalho/3209340 to your computer and use it in GitHub Desktop.
Checking the order Sinatra fire the before events on a request
#!/usr/bin/env ruby
require 'sinatra'
before do
@my_value = 'Adilson'
end
before do
@my_value = "#{@my_value} Carvalho"
end
get '/test' do
@my_value # as expected, it returns 'Adilson Carvalho'... it fires on the same order the events were added
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment