tdiary/tdiary-core — Issue #128: ArgumentError with Rack
Author: tdtds
Created: 2012-01-14 08:59:23+00:00
State: open

Copied this ticket from http://www.cozmixng.org/retro/projects/tdiary/tickets/205

----

I found that tDiary (3.1.1) seems to support Rack.

```
## tdiary/request.rb
module TDiary
if Object.const_defined?( :Rack )
Request = ::Rack::Request
class ::Rack::Request
alias remote_addr ip
end
Request.class_eval { include RequestExtension }
```

But ArgumentError raised when I tried with rack.

```
wrong number of arguments (2 for 1) (ArgumentError)

/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/request.rb:20:in `initialize'
/usr/local/apache2/htdocs/tdiary/index.cgi:38:in `new'
/usr/local/apache2/htdocs/tdiary/index.cgi:38:in `

'
This is because Rack::Request.new() takes only an argument but two arguments are passed to TDiary::Request.new() in index.rb at line 35.
```

Question: does tdiary support Rack? I want to run it with unicorn. (If it doesn't, I hope to remove code related to Rack from stable version.)

Thanks.