Non-traditional rails app

I’d like to convert some simple, general ruby scripts I have into rails
apps just for testing purposes. Many of these apps are not DB driven, so
the whole CRUD concept does not apply to them… here’s a sample:

require ‘socket’

server = TCPServer.new(‘12345’)

while (session = server.accept)

Thread.new(session) do |this_session|

data = this_session.gets

public_ip = this_session.peeraddr[3]

this_session.close

puts Time.now.strftime(’%Y-%m-%d’)

puts Time.now.strftime(’%H:%M:%S’)

puts public_ip

puts data.strip

puts data.strip.length

end

end

How easy would it be to make this into a rails app?

Many thanks!
Brad

Can we assume you want to handle this via
HTTP?

If so, then it’s trivial, once you know and
understand Rails.

Rails controllers and views have absolutely
no inherent dependencies on database backends.


– Tom M.

On 6/28/06, Tom M. [email protected] wrote:

Can we assume you want to handle this via
HTTP?

If so, then it’s trivial, once you know and
understand Rails.

Rails controllers and views have absolutely
no inherent dependencies on database backends.

I have used non AR classes in rails without any problem. I wasn’t using
Threads though. From what I’ve read I think there may be some issues
using
threads within the rails environment.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs