Consuming Ruby through COM?

S

Sam Smoot

We have a spread of ASP Classic (VBScript/JScript) websites that
desperately need some upgrading. We can't use Rails (for now, politics
around using something other than Windows and IIS), we (the developers)
don't want to use ASP.NET, we could live with Monorail, but we'd much
prefer Rails.

If we choose a .NET technology, we have a clear migration path since
there's a low chance of replacing the sites with new ones wholesale: We
can expose a .NET model through COM to the ASP Classic sites. After
enough of this, we'll have basically replaced the whole thing.

Is there a way to expose Ruby classes as COM objects to do the same?

What other integration options (besides WebServices under webrick,
which I'm assuming would be too slow/fragile) might there be to
accomplish this sort of ASP Classic/Ruby integration minus RoR?
 
A

Aemca

Sam Smoot said:
We have a spread of ASP Classic (VBScript/JScript) websites that
desperately need some upgrading. We can't use Rails (for now, politics
around using something other than Windows and IIS), we (the developers)
don't want to use ASP.NET, we could live with Monorail, but we'd much
prefer Rails.

Just setup Rails with IIS under windows:
http://wiki.rubyonrails.com/rails/pages/HowtoSetupIIS

Alternatively have a look at ActiveScriptRuby:
http://arton.hp.infoseek.co.jp/
 
S

Sam Smoot

I don't know if my previous response went through, but thank you very
much for the pointer to ActiveScriptRuby. It looks perfect!

Took me awhile to figure out how to assign to Session and Application
values, but figured out the following syntax (since I couldn't find it
online):

Session['contents', 'test'] = 1
Response.write Session.contents('test')

You can also use:

Session.contents.test = 'something else'

But that only works if you've already set the key with the previous
syntax, so I'd probably avoid it entirely.
 
S

Sam Smoot

Actually, I'm sorry, should have looked first.

It seems that ActiveScriptRuby can be used as ASP+Ruby, but I can't
figure out how to assign values to Application or Session, even though
they're available, and I can view the methods using Session.ole_methods
and view the contents with:

Session.contents('test')

But the following doesn't work:

Session.contents('test') = 'moo'

Any tips? This would be _perfect_ for us.
 
S

Sam Smoot

COM error. :-(

I can use ActiveRecord for the first request, but after that I get a
HTTP500, and I get this error in my Windows Event Log (WinXP-Pro):

The application-specific permission settings do not grant Local
Activation permission for the COM Server application with CLSID
{0C0A3666-30C9-11D0-8F20-00805F2CD064}
to the user LOCAL\IWAM_WS25 SID
(S-1-5-21-823136628-2757595635-467206144-1017). This security
permission can be modified using the Component Services administrative
tool.

I went into the Component Services tool, right-clicked MyComputer,
added the Local Activation permissions (all four) to the specified
user, restarted the IIS pool, and restarted IIS itself, then tried
again, but same deal, same error. Any ideas?
 
A

Aemca

Sam Smoot said:
Actually, I'm sorry, should have looked first.

It seems that ActiveScriptRuby can be used as ASP+Ruby, but I can't
figure out how to assign values to Application or Session, even though
they're available, and I can view the methods using Session.ole_methods
and view the contents with:

Session.contents('test')

But the following doesn't work:

Session.contents('test') = 'moo'

Any tips? This would be _perfect_ for us.

To be honest I would try to go with a ruby web framework instead of going
with active script if you have the chance.

Nitro and Rails are both good options.
 
S

Sam Smoot

I agree, but the bosses are pushing ASP Classic for a new project. It's
enough to make a grown man cry. :)

Still, a bit a Ruby splashed in might make it a bit more bearable.
 
A

Aemca

Sam Smoot said:
I agree, but the bosses are pushing ASP Classic for a new project. It's
enough to make a grown man cry. :)

Still, a bit a Ruby splashed in might make it a bit more bearable.

Ahh well I did it for years :)

It's a nice starting point in learning web tech / programming.
 
S

Sam Smoot

So you've used ActiveScriptRuby on production sites then? It's
something I can depend on you think?

Or is it more of a cool toy, too flaky for "real" usage?

I'd much prefer Ruby over JScript, but it needs to be stable and all
that.
 
M

Méta-MCI

Hello!

*sorry for my bad 'BabelFished' english*

I produced a COM-server which makes it possible to call, publicly, of the
functions and the Ruby methods.
But:
- it is experimental,
- the COM-server is produced in Python,
- the call of Ruby uses active-scripting (ActiveRuby),
- the COM-server being dynamic, it makes it possible to apply a Ruby method
to a Python object. That is one more, compared to simple ActiveScripting
- afflicted, I tested only with Object-PAL and Python (and very small
test/call from Excel/VBA)
- that is now integrated in a larger project
- this message was translated with BabelFish.
- all comments, in the code, are in french
- I will show this realization at the Paradox-Convention, in Eindhoven, at
the end of May.

Lastly, I am complètre overflowed of work

@-salutations
 
A

Aemca

Sam Smoot said:
So you've used ActiveScriptRuby on production sites then? It's
something I can depend on you think?

Or is it more of a cool toy, too flaky for "real" usage?

I'd much prefer Ruby over JScript, but it needs to be stable and all
that.

No, I did classic ASP for years :)

Not ActiveScriptRuby.

Still haven't done anything with Ruby in a production environment.
I might in a while with some kind of bridge or CLR compiler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,811
Members
47,357
Latest member
sitele8746

Latest Threads

Top