ENV

Discussion in 'Ruby' started by RVC planning, Feb 7, 2008.

  1. RVC planning

    RVC planning Guest

    Mac OS X example scripts have the command (directive/statement/?)...
    ENV['BRIDGE_SUPPORT_PATH'] = '/Volumes/Data/src/svn-rubycocoa-apple/
    framework/bridge-support'

    I can't find any write-up of this line anywhere. It's in
    RSSPhotoViewer in Developer/Examples/Ruby/RubyCocoa/RSSPhotoViewer/
    rb_main.rb

    Can someone please explain what this is, what it does, and where it is
    documented?
    RVC planning, Feb 7, 2008
    #1
    1. Advertising

  2. RVC planning

    Reacher Guest

    On Feb 7, 9:52 am, RVC planning <> wrote:
    > Mac OS X example scripts have the command (directive/statement/?)...
    > ENV['BRIDGE_SUPPORT_PATH'] = '/Volumes/Data/src/svn-rubycocoa-apple/
    > framework/bridge-support'
    >
    > I can't find any write-up of this line anywhere. It's in
    > RSSPhotoViewer in Developer/Examples/Ruby/RubyCocoa/RSSPhotoViewer/
    > rb_main.rb
    >
    > Can someone please explain what this is, what it does, and where it is
    > documented?


    I've never worked on a Mac, but the ENV hash en ruby is a mechanism
    for accessing environment variables.

    This:

    # in ruby
    ENV['PATH'] = '/usr/bin'

    is equivalent to this:

    /* in csh */
    setenv PATH "/usr/bin"
    Reacher, Feb 7, 2008
    #2
    1. Advertising

  3. RVC planning wrote:
    > ENV['BRIDGE_SUPPORT_PATH'] = '/Volumes/Data/src/svn-rubycocoa-apple/
    > framework/bridge-support'
    > [...]
    > Can someone please explain what this is, what it does, and where it is
    > documented?


    ENV is a Hash-like object (but not a hash) that contains the environment
    variables of your environment. ENV['BRIDGE_SUPPORT_PATH'] = '...' sets the
    environment variable BRIDGE_SUPPORT_PATH to '...' for you and all processes
    inheriting your environment.

    HTH,
    Sebastian
    --
    NP: Nevermore - Narcosynthesis
    Jabber:
    ICQ: 205544826
    Sebastian Hungerecker, Feb 7, 2008
    #3
  4. RVC planning

    John Joyce Guest

    On Feb 7, 2008, at 10:05 AM, Sebastian Hungerecker wrote:

    > RVC planning wrote:
    >> ENV['BRIDGE_SUPPORT_PATH'] = '/Volumes/Data/src/svn-rubycocoa-apple/
    >> framework/bridge-support'
    >> [...]
    >> Can someone please explain what this is, what it does, and where
    >> it is
    >> documented?

    >
    > ENV is a Hash-like object (but not a hash) that contains the
    > environment
    > variables of your environment. ENV['BRIDGE_SUPPORT_PATH'] = '...'
    > sets the
    > environment variable BRIDGE_SUPPORT_PATH to '...' for you and all
    > processes
    > inheriting your environment.
    >
    > HTH,
    > Sebastian
    > --
    > NP: Nevermore - Narcosynthesis
    > Jabber:
    > ICQ: 205544826
    >

    indeed,
    all this is doing is setting the path to the rubycocoa bridge,
    they're setting that based on the location of the bridge as it is
    with the shipped version of Leopard (10.5)
    John Joyce, Feb 7, 2008
    #4
  5. John Joyce wrote:
    > On Feb 7, 2008, at 10:05 AM, Sebastian Hungerecker wrote:
    >
    >> variables of your environment. ENV['BRIDGE_SUPPORT_PATH'] = '...'
    >> ICQ: 205544826
    >>

    > indeed,
    > all this is doing is setting the path to the rubycocoa bridge,
    > they're setting that based on the location of the bridge as it is
    > with the shipped version of Leopard (10.5)


    Actually, that was the developer’s path. You can (and should) safely
    remove this line to use it on your machine, or set the path to a custom
    version of BridgeSupport if you have one.
    --
    Posted via http://www.ruby-forum.com/.
    Benjamin Stiglitz, Feb 7, 2008
    #5
  6. On Feb 7, 2008 1:56 PM, Benjamin Stiglitz <> wrote:
    > John Joyce wrote:
    > > On Feb 7, 2008, at 10:05 AM, Sebastian Hungerecker wrote:
    > >
    > >> variables of your environment. ENV['BRIDGE_SUPPORT_PATH'] = '...'
    > >> ICQ: 205544826
    > >>

    > > indeed,
    > > all this is doing is setting the path to the rubycocoa bridge,
    > > they're setting that based on the location of the bridge as it is
    > > with the shipped version of Leopard (10.5)

    >
    > Actually, that was the developer's path. You can (and should) safely
    > remove this line to use it on your machine, or set the path to a custom
    > version of BridgeSupport if you have one.


    These lines were unfortunately left by error after a debugging
    session, I just removed them :)

    Laurent
    Laurent Sansonetti, Feb 7, 2008
    #6
  7. RVC planning

    John Joyce Guest

    On Feb 7, 2008, at 5:25 PM, Laurent Sansonetti wrote:

    > On Feb 7, 2008 1:56 PM, Benjamin Stiglitz <> wrote:
    >> John Joyce wrote:
    >>> On Feb 7, 2008, at 10:05 AM, Sebastian Hungerecker wrote:
    >>>
    >>>> variables of your environment. ENV['BRIDGE_SUPPORT_PATH'] = '...'
    >>>> ICQ: 205544826
    >>>>
    >>> indeed,
    >>> all this is doing is setting the path to the rubycocoa bridge,
    >>> they're setting that based on the location of the bridge as it is
    >>> with the shipped version of Leopard (10.5)

    >>
    >> Actually, that was the developer's path. You can (and should) safely
    >> remove this line to use it on your machine, or set the path to a
    >> custom
    >> version of BridgeSupport if you have one.

    >
    > These lines were unfortunately left by error after a debugging
    > session, I just removed them :)
    >
    > Laurent
    >

    Thanks Laurent!
    It's great to know that people at Apple are paying attention to
    things outside of Apple!
    John Joyce, Feb 8, 2008
    #7
    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. Himmat Dhange
    Replies:
    0
    Views:
    418
    Himmat Dhange
    Aug 26, 2003
  2. Shikari Shambu
    Replies:
    1
    Views:
    292
    bruce barker
    Oct 29, 2004
  3. Phil Powell
    Replies:
    0
    Views:
    403
    Phil Powell
    Sep 17, 2003
  4. Ankit Mehta
    Replies:
    1
    Views:
    1,395
    Simon Brooke
    Sep 29, 2006
  5. TDR
    Replies:
    3
    Views:
    164
    Daniel Berger
    Aug 31, 2007
Loading...

Share This Page