Prev: Missing base64 library in Ruby1.9, cannot run cloudkit
Next: Variable number of arguments for methods called with "send"
From: Intransition on 27 Apr 2010 09:26 On Apr 27, 8:01 am, Brian Candler <b.cand...(a)pobox.com> wrote: > It's pretty reasonable to use eval in the code you provide. I think the > method it defines will be faster because there is no closure created. +1 In cases like this, when you can use a string eval, it is usually the best approach. There are cases where you cannot do this b/c you need access to a local variable.
From: kevid on 27 Apr 2010 13:15 Thanks all. Brian Candle solution just did for me. Please, not to be asking too much, I need to make use of "Hpricot gem" files. I don't want to install it as a gem. I copied lib/hpricot/*{all files} and lib/hpricot.rb to my application. below is lib/hpricot.rb begin require 'encoding/character/utf-8' rescue LoadError end #require 'hpricot_scan' require 'hpricot/tag' require 'hpricot/modules' require 'hpricot/traverse' require 'hpricot/inspect' require 'hpricot/parse' require 'hpricot/builder' ALL files loaded properly except "hpricot_scan". i can't find anything like hpricot_scan.rb in the gem's folder. Any help is highly appreciated.
From: kevid on 27 Apr 2010 13:15 Thanks all. Brian Candle solution just did for me. Please, not to be asking too much, I need to make use of "Hpricot gem" files. I don't want to install it as a gem. I copied lib/hpricot/*{all files} and lib/hpricot.rb to my application. below is lib/hpricot.rb begin require 'encoding/character/utf-8' rescue LoadError end #require 'hpricot_scan' require 'hpricot/tag' require 'hpricot/modules' require 'hpricot/traverse' require 'hpricot/inspect' require 'hpricot/parse' require 'hpricot/builder' ALL files loaded properly except "hpricot_scan". i can't find anything like hpricot_scan.rb in the gem's folder. Any help is highly appreciated.
From: Roger Pack on 27 Apr 2010 13:27 > ALL files loaded properly except "hpricot_scan". i can't find anything > like hpricot_scan.rb in the gem's folder. doing a $ gem which hpricot_scan might help you locate it. -rp -- Posted via http://www.ruby-forum.com/.
From: kevid on 27 Apr 2010 13:52
On Apr 27, 6:27 pm, Roger Pack <rogerpack2...(a)gmail.com> wrote: > > ALL files loaded properly except "hpricot_scan". i can't find anything > > like hpricot_scan.rb in the gem's folder. > > doing a > $ gem which hpricot_scan > > might help you locate it. > -rp > -- > Posted viahttp://www.ruby-forum.com/. thanks,, But this provided "hpricot_scan.so" {i.e /usr/lib/ruby/gems/1.8/gems/ hpricot-0.8.2/lib/hpricot_scan.so } I have added this file but no luck |