Skip to content

Commit f9e109c

Browse files
committed
changed the usher for http_router, liked it because it has no direct dependency with rack
1 parent a0833ca commit f9e109c

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

Gemfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ gem 'activesupport', '3.0.0.beta3'
44
gem 'activemodel', '3.0.0.beta3'
55
gem 'cramp', :path => File.dirname(__FILE__)
66

7-
gem 'activesupport', '3.0.0.beta4'
87
gem 'rack', '~> 1.1.0'
98
gem 'eventmachine', '~> 0.12.10'
109

1110
group :test do
12-
gem 'usher'
11+
gem 'http_router'
1312
end
1413

1514
group :example do
16-
gem 'usher'
15+
gem 'http_router'
1716
gem 'tramp', '~> 0.1'
1817
gem 'thin', '~> 1.2.7'
1918
end

examples/full.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
require 'cramp'
77
require 'tramp'
8-
require 'usher'
8+
require 'http_router'
99
require 'thin'
1010

1111
Tramp.init(:username => 'root', :database => 'arel_development', :socket => '/tmp/mysql.sock')
@@ -67,7 +67,7 @@ def stop_benchmark
6767
end
6868
end
6969

70-
routes = Usher::Interface.for(:rack) do
70+
routes = HttpRouter.new do
7171
add('/users/:id').to(UsersController)
7272
end
7373

examples/with_usher.rb renamed to examples/with_http_router.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Bundler.setup(:default, :example)
44

55
require 'cramp'
6-
require 'usher'
6+
require 'http_router'
77
require 'thin'
88

99
class HomeController < Cramp::Action
@@ -25,7 +25,7 @@ def on_finish
2525

2626
end
2727

28-
routes = Usher::Interface.for(:rack) do
28+
routes = HttpRouter.new do
2929
add('/(:password)').to(HomeController)
3030
end
3131

lib/cramp/abstract.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def request
6262
end
6363

6464
def params
65-
@params ||= request.params.update(@env['usher.params']).symbolize_keys
65+
@params ||= request.params.update(@env['router.params']).symbolize_keys
6666
end
6767

6868
end

test/controller/callback_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def write_logs
3232

3333
end
3434

35-
App = Usher::Interface.for(:rack) do
35+
App = HttpRouter.new do
3636
add('/:id').to(CallbackController)
3737
end
3838

test/controller/periodic_timer_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def finish_soon
1919
end
2020
end
2121

22-
App = Usher::Interface.for(:rack) do
22+
App = HttpRouter.new do
2323
add('/send_data').to(SendDataController)
2424
add('/finishing_timer').to(FinishingTimerController)
2525
end

test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
require 'cramp'
88
require 'test/unit'
9-
require 'usher'
9+
require 'http_router'
1010

1111
require 'active_support/buffered_logger'
1212
logger = ActiveSupport::BufferedLogger.new(File.join(File.dirname(__FILE__), "tests.log"))

0 commit comments

Comments
 (0)