This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/' do | |
"Worked on dreamhost" | |
end | |
get '/foo' do | |
"Foo" | |
end | |
get '/foo/:bar' do | |
"You asked for foo/#{params[:bar]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:.unshift("../sinatra/lib") | |
require 'sinatra' | |
require 'spec/interop/test' | |
require 'sinatra/test/unit' | |
set :views, File.join(File.dirname(__FILE__), '..', 'views') | |
class Rack::MockResponse | |
require 'hpricot' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## TODO: Make this DRY!! | |
get '/:channel' do | |
@channel = params[:channel] | |
redirect "/#{@channel}/#{relative_day('today')}" | |
end | |
## TODO: Make this DRY!! | |
get '/:channel/' do | |
@channel = params[:channel] | |
redirect "/#{@channel}/#{relative_day('today')}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ol> | |
<li> | |
<div class="time">10:30</div> | |
<q><address>John</address> hi</q> | |
</li> | |
<li><q><address>Mary</address> hey!</q></li> | |
<li><q><address>Mary</address> blah</q></li> | |
<li><q><address>John</address> blah blah?</q></li> | |
<li> | |
<div class="time">10:35</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir[File.dirname(__FILE__) + "/vendor/**/lib/"].each { |d| $:.unshift d } | |
require 'sinatra' | |
require 'date' | |
require 'rubygems' | |
require 'models' | |
enable :sessions | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sinatra" | |
require "partials" | |
helpers do | |
include Sinatra::Partials | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Processing ApplicationController#index (for 127.0.0.1 at 2008-11-14 10:32:42) [GET] | |
Session ID: BAh7CToNYWRtaW5faWQwOgxjc3JmX2lkIiU4MDZhNDQyMTI1NzgxNTZkZWQyYThmNzZiYTczNGIzYSIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsGOgplcnJvciIgQ291bGRuJ3QgbG9nIHlvdSBpbiBhcyAnYmEnBjoKQHVzZWR7BjsIRjoMdXNlcl9pZDA=--e1f7343173eeef73cf6a4fda771cada2adcf72a2 | |
Parameters: {} | |
/!\ FAILSAFE /!\ Fri Nov 14 10:32:42 -0700 2008 | |
Status: 500 Internal Server Error | |
No route matches "/sess" with {:method=>:get} | |
/Users/cschneid/CitrusByte/ProjectAlert/palert/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path' | |
/Users/cschneid/CitrusByte/ProjectAlert/palert/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:385:in `recognize' | |
/Users/cschneid/CitrusByte/ProjectAlert/palert/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:181:in `handle_request' | |
/Users/cschneid/CitrusByte/ProjectAlert/palert/vendor/rails/actionpack/l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pa_development=# \d materials_resource_menus | |
Table "public.materials_resource_menus" | |
Column | Type | Modifiers | |
------------------+-----------------------------+----------------------------------------------------------------------- | |
id | integer | not null default nextval('materials_resource_menus_id_seq'::regclass) | |
material_id | integer | | |
resource_menu_id | integer | | |
created_at | timestamp without time zone | | |
updated_at | timestamp without time zone | | |
Indexes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'json' | |
get "/action" do | |
content_type :json | |
{:id => 1, :foo => 'bar'}.to_json | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SpecHelper | |
def session_data | |
cookies = @response.headers["Set-Cookie"] | |
serialised = Rack::Utils::parse_query(cookies)["rack.session"] | |
Marshal.load(serialised.unpack('m*').first) | |
end | |
end |
OlderNewer