Re: Literal notation for Pathnames

2013-01-03 Thread Heesob Park
Hi, 2013/1/4 Intransition > > One thing I would like Ruby to have is a concise literal notation for > pathnames. So maybe Ruby could have a literal notation as follows: > > /foo/bar#=> # > ./foo/bar #=> # > ../foo/bar #=> # > > and/or > > /"foo/bar"#=> # > ./"foo/ba

Literal notation for Pathnames

2013-01-03 Thread Intransition
One thing I would like Ruby to have is a concise literal notation for pathnames. So maybe Ruby could have a literal notation as follows: /foo/bar#=> # ./foo/bar #=> # ../foo/bar #=> # and/or /"foo/bar"#=> # ./"foo/bar" #=> # ../"foo/bar" #=> # So, `/`, `./

respond_to_missing?

2013-01-03 Thread Intransition
Can anyone explain `#respond_to_missing?`. -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to ruby-talk-google+unsubscr...@goog

Re: Cross-platform gems / conditional loading of gems

2013-01-03 Thread Intransition
Try something like: if RUBY_PLATFORM =~ /(win|ming)/ ... else ... end -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this gr

Re: Keep temporary files

2013-01-03 Thread Robert Klemme
On Tue, Jan 1, 2013 at 11:14 PM, Jérôme R. wrote: > In a project I am working on, Tempfile objects are used. Fine, but I > would like to add an option "keep temp file", in order to facilitate > debug in case of error. > > It seems that Tempfile object doesn't provide any way to do that. Would > yo

Re: Require a ruby project to automatically include the modules in classes defined in the same .rb file

2013-01-03 Thread Robert Klemme
On Thu, Jan 3, 2013 at 4:58 AM, Marc Heiler wrote: > I would like to know how I could save one line of code. > However, what I now want to do is, use only require, > and have this module included into ALL classes of > the .rb file. In other words: > Is this possible? Is it desirable? Wouldn't

Re: Block given to Array::join

2013-01-03 Thread Robert Klemme
On Thu, Jan 3, 2013 at 9:37 PM, Salvatore nashcrash wrote: > Hi. > I'm a newby in this Forum and in Ruby, but I want give my contribution. > > class Array > alias oldJoin join > def join(sep='') > res=self > res=self.map {|el| yield el} if block_given? > res.oldJoin(sep) > end >