[ANN] Getopt-Declare 1.12 (gem/zip) and GGEnv (gem/zip)

Discussion in 'Ruby' started by gga, Jul 18, 2005.

  1. gga

    gga Guest

    Getopt-Declare
    --------------
    There's a new bug fix release of Getopt-Declare, the port of Perl's
    module by the same name.
    This is a simple command parser using regexes where the help
    documentation *is* the parser.
    This version fixes some casting bug with private types and improves the
    performance of parsing isolated flags a little.

    GGEnv
    -----
    This is a simple for manipulation of environment variables that deals
    with paths, using all of ruby's array functionality.
    It should work properly across different platforms.

    When loaded, it creates a module called Env.

    Within it, it defines methods for [] and []=, so that you can do the
    following:


    Env.check_directories = false # turn off verification that
    # directories exist (default: true)
    path = Env['PATH']

    path << "C:/newpath" # As path is modified, so
    # is ENV['PATH']

    path.delete_if { |x| x =~ /maya/ } # remove all paths that have maya

    path.unshift ["C:/", "E:/bin"] # add these paths at start

    Env['PATH'] = path[0,2] + path[4,6] # concat two slices

    path.check_directories # check existance of directories
    # for this variable only (unlike
    # Env.check_directories = true)
     
    gga, Jul 18, 2005
    #1
    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. GGarramuno
    Replies:
    4
    Views:
    136
    Pit Capitain
    Jan 11, 2004
  2. Nexos
    Replies:
    0
    Views:
    106
    Nexos
    May 11, 2006
  3. gga
    Replies:
    6
    Views:
    148
  4. Nexos
    Replies:
    4
    Views:
    119
    Nexos
    Mar 21, 2007
  5. gga
    Replies:
    1
    Views:
    108
    Duane Johnson
    Mar 21, 2007
Loading...

Share This Page