tar2rubyscript: getting the path of the original executable

Discussion in 'Ruby' started by Patrick Gundlach, Jan 23, 2007.

  1. Hi,

    I try using tar2rubyscript and I need to get the path to the original
    executable. oldlocation doesn't seem to help because it referes to the
    original working directory. Any idea?

    Patrick

    --
    Posted via http://www.ruby-forum.com/.
     
    Patrick Gundlach, Jan 23, 2007
    #1
    1. Advertising

  2. ----------------------------------------------------------------

    $ cat application/init.rb
    p $0
    p __FILE__

    $ ruby tar2rubyscript.rb application/
    Creating archive...
    Creating application.rb ...

    $ ruby application.rb
    "...../Temp/tar2rubyscript.d.2900.1/application/init.rb"
    "...../Temp/tar2rubyscript.d.2900.1/application/init.rb"

    ----------------------------------------------------------------
     
    Erik Veenstra, Jan 23, 2007
    #2
    1. Advertising

  3. Re: tar2rubyscript: getting the path of the original executa

    Erik Veenstra wrote:
    > ----------------------------------------------------------------
    >
    > $ cat application/init.rb
    > p $0
    > p __FILE__



    Thanks Erik, but obviously I wasn't clear. I need the path to the old
    rb file, the one that is distributed and contains the tar file, not the
    one in the temporary directory.

    With __FILE__ and $0 I get the new location, with oldlocation I only get
    the last PWD and not the location of the tar/rb file.

    Patrick

    --
    Posted via http://www.ruby-forum.com/.
     
    Patrick Gundlach, Jan 23, 2007
    #3
  4. Re: tar2rubyscript: getting the path of the original executa

    Sorry, I misunderstood your question...

    Currently, it's not possible to determine the path to the RBA.

    Mmm...

    gegroet,
    Erik V. - http://www.erikveen.dds.nl/
     
    Erik Veenstra, Jan 23, 2007
    #4
  5. Re: tar2rubyscript: getting the path of the original executa

    Erik Veenstra wrote:
    > Sorry, I misunderstood your question...
    >
    > Currently, it's not possible to determine the path to the RBA.
    >
    > Mmm...


    Then I have two suggestions for tar2rubyscript:

    1) create an environment variable that points to the RBA
    2) make the filename 'init.rb' configurable

    Thanks in advance,

    Patrick

    --
    Posted via http://www.ruby-forum.com/.
     
    Patrick Gundlach, Jan 26, 2007
    #5
    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. Erik Veenstra

    Tar2RubyScript 0.4.1

    Erik Veenstra, Dec 18, 2004, in forum: Ruby
    Replies:
    2
    Views:
    90
    Erik Veenstra
    Dec 19, 2004
  2. Erik Veenstra

    [ANN] Tar2RubyScript 0.4.2

    Erik Veenstra, Dec 27, 2004, in forum: Ruby
    Replies:
    0
    Views:
    117
    Erik Veenstra
    Dec 27, 2004
  3. Erik Veenstra

    [ANN] Tar2RubyScript 0.4.3

    Erik Veenstra, Jan 13, 2005, in forum: Ruby
    Replies:
    0
    Views:
    120
    Erik Veenstra
    Jan 13, 2005
  4. Erik Veenstra

    [ANN] Tar2RubyScript 0.4.4

    Erik Veenstra, Jan 18, 2005, in forum: Ruby
    Replies:
    0
    Views:
    107
    Erik Veenstra
    Jan 18, 2005
  5. Bart Meyers
    Replies:
    0
    Views:
    84
    Bart Meyers
    Mar 27, 2007
Loading...

Share This Page