[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to use Plist ???

pere.noel

7/14/2006 7:50:00 AM


i try to use the gem plist by :
#!/usr/bin/env ruby

require 'plist'
plist=Plist.parse_xml(my_info_path)

and i get :

NameError: uninitialized constant Plist

how do i initialize this constant, i thought it was done into "plist.rb"
starting with :

class Plist

def Plist::parse_xml( filename )
listener = Listener.new
#parser = REXML::Parsers::StreamParser.new(File.new(filename),
listener)
parser = StreamParser.new(filename, listener)
parser.parse
listener.result
end



i've allready tested :

plist=Plist::parse_xml(my_info_path)
with the same error message ???
--
une bévue
3 Answers

pere.noel

7/14/2006 8:01:00 AM

0

Une bévue <pere.noel@laponie.com.invalid> wrote:

> i've allready tested :
>
> plist=Plist::parse_xml(my_info_path)
> with the same error message ???

also i should say i have the same prob running "test_plist.rb" included
in the gem package of Plist.

also, i should say i was unable to update Plist and have an old version
: 1...
--
une bévue

pere.noel

7/14/2006 10:09:00 AM

0

Une bévue <pere.noel@laponie.com.invalid> wrote:

> also i should say i have the same prob running "test_plist.rb" included
> in the gem package of Plist.

in fact, this has nothing to do with ruby nor ruby_gems, it comes from
my editor (TextMate) not understanding (?) some env vars...
--
une bévue

Clayton Smith

7/14/2006 1:58:00 PM

0


Une bévue wrote:
> Une bévue <pere.noel@laponie.com.invalid> wrote:
>
> > also i should say i have the same prob running "test_plist.rb" included
> > in the gem package of Plist.

Try
require 'rubygems'
require_gem 'plist'

Clayton

>
> in fact, this has nothing to do with ruby nor ruby_gems, it comes from
> my editor (TextMate) not understanding (?) some env vars...
> --
> une bévue