[ruby-talk:00195] Re: auto-loaded script?

From: matz@... (Yukihiro Matsumoto)
Date: 1999-01-18 02:55:33 UTC
List: ruby-talk #195
Hi.

In message "[ruby-talk:00194] Re: auto-loaded script?"
    on 99/01/17, Julian Fondren <julian@imaji.net> writes:

|No, that won't work because /etc/passwd doesn't like dashes or flags
|in the command part - right now the closest I can get is to have a ruby
|script as the shell, which doesn't seem very safe to me.

Well, are you going to use ruby as login shell?  I do not recomment
it, because Ruby is a script language, like Perl.

Anyway, to load script before executing, you'd better re-compile
ruby to do so.  Modify main.c as below, and re-compile.

  int
  main(argc, argv, envp)
      int argc;
      char **argv, **envp;
  {
  #if defined(NT)
      NtInitialize(&argc, &argv);
  #endif

      ruby_init();
      ruby_options(argc, argv);
      rb_load_file("/home/julian/.rubyrc");  /* this line added */
      ruby_run();
  }

Hope this helps.

I'm not really sure whether plain Ruby should load particular script
before executing.  But I feel it is not required.

                                                matz.

In This Thread