Professional Web Applications Themes

In which order are files looked for when loaded/requierd - and what'sthe order of suffixes? - Ruby

Hi all, when I require 'whatever' or load 'something_else' how can I tell in which order the directories are searched for the file in question? And what's the order fo suffixes to the file ( .rb, .so, ...)? Is the directory order the order of the entries in $: (or $LOAD_PATH which I tend to prefer after requiring 'English')? Hmm, probably not, since '.' is the last entry in the current $: (which I didn't change) Thanks for any input and happy rubying! Stephan -- "It's POLYMORPHIC!!!" A fromer colleague...

  1. #1

    Default In which order are files looked for when loaded/requierd - and what'sthe order of suffixes?

    Hi all,

    when I

    require 'whatever'

    or

    load 'something_else'

    how can I tell in which order the directories are searched for the file
    in question? And what's the order fo suffixes to the file ( .rb, .so, ...)?

    Is the directory order the order of the entries in $: (or $LOAD_PATH
    which I tend to prefer after requiring 'English')?
    Hmm, probably not, since '.' is the last entry in the current $: (which
    I didn't change)

    Thanks for any input and happy rubying!

    Stephan


    --
    "It's POLYMORPHIC!!!"
    A fromer colleague
    Stephan Guest

  2. #2

    Default Re: In which order are files looked for when loaded/requierd - and what's the order of suffixes?

    Hi,

    At Sun, 18 Jan 2004 02:45:03 +0900,
    Stephan Kämper wrote: 

    Directories in $:, and suffixes are in order "rb",
    Config::CONFIG["DLEXT"] and Config::CONFIG["DLEXT2"] if
    available. Config::CONFIG is defined in rbconfig.rb.
     

    Yes.
     

    What do you mean?

    --
    Nobu Nakada



    nobu.nokada@softhome.net Guest

  3. #3

    Default Re: In which order are files looked for when loaded/requierd - andwhat's the order of suffixes?

    net wrote: 
    >
    > What do you mean?[/ref]

    Sorry for being unclear. I meant to say that

    a) "." is the last element of $:.

    [715] stktao ~: irb
    irb(main):001:0> $:
    => ["/usr/local/lib/ruby/site_ruby/1.8",
    "/usr/local/lib/ruby/site_ruby/1.8/i686-linux",
    "/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8",
    "/usr/local/lib/ruby/1.8/i686-linux",
    "."]
    irb(main):002:0> $:.last == "."
    => true

    b) I thought "." would be searched first. Apparently I was wrong...

    Thanks for your help!

    Happy rubying everybody

    Stephan


    --
    "It's POLYMORPHIC!!!"
    A fromer colleague
    Stephan Guest

Similar Threads

  1. Replies: 1
    Last Post: February 18th, 01:37 AM
  2. importing files in order?!
    By mark_mazaitis@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 3
    Last Post: July 29th, 03:32 AM
  3. Re : Order ide drivers are loaded?
    By TR in forum Debian
    Replies: 1
    Last Post: August 5th, 10:20 AM
  4. Order ide drivers are loaded?
    By Joan Tur in forum Debian
    Replies: 0
    Last Post: July 8th, 07:30 PM
  5. Choosing in what order programs are loaded
    By Thorsten Matzner in forum Windows XP/2000/ME
    Replies: 1
    Last Post: July 4th, 06:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139