-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Avdi Grimm
committed
May 26, 2008
1 parent
bb36507
commit d98c9f6
Showing
9 changed files
with
84 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
# -*- mode: ruby -*- | |||
require File.join(File.dirname(__FILE__), '..', 'lib', 'environment') | |||
|
|||
require 'sinatra' | |||
|
|||
Sinatra::Application.default_options.merge!(:run => false, | |||
:env => :production | |||
) | |||
require 'curator' | |||
require 'application' | |||
require 'curator/middleware/event_machine' | |||
require 'curator/middleware/curator_finder' | |||
require 'socket' | |||
|
|||
use Curator::Middleware::EventMachine | |||
use Curator::Middleware::CuratorFinder, Socket.gethostname | |||
run Sinatra.application |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
require File.join(File.dirname(__FILE__), 'environment') | |||
require 'rubygems' | |||
require 'sinatra' | |||
|
|||
helpers do | |||
def curator | |||
request.env['curator.curator'] | |||
end | |||
end | |||
|
|||
template :layout do | |||
<<-END | |||
xhtml_strict do | |||
head do | |||
title "Curator" | |||
end | |||
body do | |||
self << yield | |||
end | |||
end | |||
END | |||
end | |||
|
|||
get '/' do | |||
mab do | |||
div.foo! "Welcome! #{curator.inspect}" | |||
end | |||
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
require 'pathname' | |||
ROOT = Pathname.new(__FILE__).expand_path.dirname.parent | |||
Pathname.glob(ROOT + 'vendor' + '*' + 'lib').each do |path| | |||
$LOAD_PATH.unshift(path.to_s) | |||
end | |||
$LOAD_PATH.unshift(ROOT + 'lib') |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
require File.dirname(__FILE__) + '/spec_helper.rb' | |||
require 'sinatra' | |||
require 'sinatra/test/spec' | |||
require 'application' | |||
|
|||
describe "curator application" do | |||
describe "GET /" do | |||
before :each do | |||
get_it '/' | |||
end | |||
it "should support getting /" do | |||
@response.should be_ok | |||
body.should =~ /Welcome!/ | |||
end | |||
end | |||
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
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
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,10 +1,10 @@ | |||
require File.dirname(__FILE__) + '/unit' | require File.dirname(__FILE__) + '/unit' | ||
require 'test/spec' | require 'spec/interop/test' | ||
|
|
||
class Test::Unit::TestCase | class Test::Unit::TestCase | ||
|
|||
def should | def should | ||
@response.should | @response.should | ||
end | end | ||
|
|||
end | end |