How to proceed?

Discussion in 'Ruby' started by railsfid@gmail.com, Jul 27, 2010.

  1. Guest

    I am a fairly new member to RoR community and programming for that
    matter. I want to create a Rails app that pulls info from a file on a
    computer every time that file changes.
    -So I'm thinking I need to have some code installed on the client
    computer?
    -the installed code would have to be at the admin level incase any
    user causes the file to change?
    -the installed code would then report back to a Rails application
    after each change of the file
    -the program would need to run in the background no matter who is
    logged in.

    Would a Ruby written program be the correct choice on the client
    computer or should that part of the equation be written in something
    else?
    Anyone see in problems with trying to create this or can offer
    suggestions where to start?
    , Jul 27, 2010
    #1
    1. Advertising

  2. On Monday, July 26, 2010 08:50:09 pm wrote:
    > I am a fairly new member to RoR community and programming for that
    > matter. I want to create a Rails app that pulls info from a file on a
    > computer every time that file changes.


    That sounds like a really fragile approach.

    What are you actually trying to do?

    Since you've admitted to being new to programming, the above question is one
    of the most important ones you should ask yourself when faced with any
    problem. There is such a thing as too much context, but explaining something
    about _why_ you want to pull info from that file, _what_ info you want to
    pull, maybe even some other solutions that you've tried but don't think will
    work, would be helpful.

    But if you do want to do it this way:

    > -So I'm thinking I need to have some code installed on the client
    > computer?


    Yes.

    Technically, it depends, but web apps have only a tiny amount of access to the
    local machine -- basically cookies and slightly more advanced cookies (like
    the local SQL storage in some newer browsers).

    > -the installed code would have to be at the admin level incase any
    > user causes the file to change?


    That depends on your OS, but no, I don't think so. It just needs read rights
    on that file.

    It also depends what kind of tools your OS has for notification, unless you
    intend to just poll.

    On Unix-like OSes, you should be able to run this code as a completely
    deprivileged user, just one who has read access. On Linux, inotify and dnotify
    just need read access -- or, technically, execute access on directories --
    unless I'm missing something.

    However, depending on the file, you may need administrator access in order to
    set up permissions like that.

    > -the installed code would then report back to a Rails application
    > after each change of the file


    Yes.

    > -the program would need to run in the background no matter who is
    > logged in.


    That depends. Do you want it to report no matter who is logged in?

    > Would a Ruby written program be the correct choice on the client
    > computer or should that part of the equation be written in something
    > else?


    That depends what your priorities are, and what your needs are. You haven't
    told us nearly enough, so I can't possibly answer that, but here are some
    guesses:

    Do you control the client? That is, are you just trying to have something
    automatically happen on your own computer? Then yes, Ruby makes a fine client-
    side language.

    Are you hoping to make a simple installer that anyone can use? In that case,
    Rawr looks promising, but if you need it running in the background all the
    time, you may end up having to look into some OS-specific installers -- and
    those aren't likely to be written in Ruby. You may still be able to write some
    Ruby code, but it may also not be worth the effort if the client side is
    really, really, ridiculously simple. But if you're having to do a lot of
    parsing and interpreting (instead of just uploading the file), it may yet be
    worth it...

    Is there an existing solution you could adapt? Rails is pretty easy to talk to
    -- if you can find any sort of simple background service that polls a file and
    transmits it via REST, that'd probably talk to Rails. In that case, it almost
    doesn't matter what the implementation language is.

    > Anyone see in problems with trying to create this or can offer
    > suggestions where to start?


    Ask again, but with more details.
    David Masover, Jul 27, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff User

    Best way to proceed

    Jeff User, Dec 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    405
    Robbe Morris [C# MVP]
    Dec 7, 2005
  2. Replies:
    0
    Views:
    529
  3. Daniel Mark
    Replies:
    9
    Views:
    12,448
    Simon Brunning
    Sep 19, 2006
  4. Osiris
    Replies:
    0
    Views:
    251
    Osiris
    Jan 1, 2007
  5. sanjay
    Replies:
    1
    Views:
    233
    Bob Barrows [MVP]
    Feb 22, 2005
Loading...

Share This Page