Can [ruby] on rails do this --- crazy request


#1

Hi all,

Loving the Ruby on Rails world so far.

My web app needs to browse the local file system for file names and
directories to build lists for processing with a commercial application.
I realize this is a no no for web client apps due to security concerns.
One approach is to write signed java applets to integrate this
functionality. While this would work, I was curious if it is possible to
make a signed piece of ruby code to do the same thing?

The code could be RJS based and signed. Is there any way to make this
happen and keep out of the java world? Is jruby a possibility?

Thanks any help is greatly appreciated,
Rick


#2

Rails has nothing to do with this (being the server and all, no
interaction
with client computers). Java applets work because they are run on the
client. Javascript is not allowed to do much in this space, last I
checked,
so you’re basically stuck with a Flash or Java app embedded in the page
that
can post back to the server.

Jason


#3

I do know that Flash 8+ has an upload window but I’m not sure if it
can scour the drive to list all the files. You may want to check that
out. If not, then the java applet is the answer for you.

On 3/22/07, Rick F. removed_email_address@domain.invalid wrote:

make a signed piece of ruby code to do the same thing?

The code could be RJS based and signed. Is there any way to make this
happen and keep out of the java world? Is jruby a possibility?

Thanks any help is greatly appreciated,
Rick


Ramon Miguel M. Tayag


#4

Have you looked at the Ruby shell library? It is part of the standard
installation. On Linux you’ll find it at
/usr/lib/ruby/1.8/shell

You can look up the Shell class and its methods at
http://www.ruby-doc.org/core/

You can do anything you’d from the command line and pass values back and
forth.
You can write your own classes and put the file in the RAILS_ROOT/lib
dir.

I am using it to do some file format conversions. To see how shell is
used you can look into the doc_convert library to see how shell is
used. That’s what I did.
http://raa.ruby-lang.org/project/doc_convert/

Hope this helps,

bakki


#5

Rick F. wrote:

Hi all,

Loving the Ruby on Rails world so far.

My web app needs to browse the local file system for file names and
directories to build lists for processing with a commercial application.
I realize this is a no no for web client apps due to security concerns.
One approach is to write signed java applets to integrate this
functionality. While this would work, I was curious if it is possible to
make a signed piece of ruby code to do the same thing?

The code could be RJS based and signed. Is there any way to make this
happen and keep out of the java world? Is jruby a possibility?

Thanks any help is greatly appreciated,
Rick

When you said your web app needs to browse the local file system, does
it means the file system of the web server or does it means the file
system of the people browsing/access your web page? If it is the
former, it is simple using the File Class. If it is the later, I am not
sure. If it is file upload, you can use the file_field_tag.

On the other hand, if you can run application on the client end, then
you can build one with ruby that look up the workstation’s file system
and send appropriate messages to the server (with backgroundrb?)


#6

When you said your web app needs to browse the local file system, does
it means the file system of the web server or does it means the file
system of the people browsing/access your web page?

Sorry if I wasn’t clear. The file browsing would be on the client end in
the web browser. The user will need to specify lists of files and
directories for processing by the main application.

Although I have seen people do tricks with the file upload, this is a
little clunky for my needs.

Thanks for all the possibilities.