Regarding this feature recently added to Ruby 1.9, how about including it on Rails core extension when not defined? http://redmine.ruby-lang.org/issues/show/1081 http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=26816 This allows File.write(''file.txt'', ''Content of the file'') instead of File.open(''file.txt''){|f| f.write ''Content of the file''} What do you think? Regards, Rodrigo. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Sat, Mar 6, 2010 at 4:50 AM, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:> Regarding this feature recently added to Ruby 1.9, how about including it on > Rails core extension when not defined? > > http://redmine.ruby-lang.org/issues/show/1081 > http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=26816 > > This allows File.write(''file.txt'', ''Content of the file'') instead of > File.open(''file.txt''){|f| f.write ''Content of the file''} > > What do you think?Sounds good. Do you have a patch? jeremy -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
>> Regarding this feature recently added to Ruby 1.9, how about including it on >> Rails core extension when not defined? >> >> http://redmine.ruby-lang.org/issues/show/1081 >> http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=26816 >> >> This allows File.write(''file.txt'', ''Content of the file'') instead of >> File.open(''file.txt''){|f| f.write ''Content of the file''} >> >> What do you think? > > Sounds good. Do you have a patch? > > jeremyIf you look at the ticket ( http://redmine.ruby-lang.org/issues/show/1081 ) the feature was backed out today, there were some implementation errors that might not be resolved in time for this method to make it into 1.9.2. Might be worthwhile to hold off on adding as a core ext in Rails until there''s a stable implementation to copy a method signature from. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Em 06-03-2010 14:13, Jim Lindley escreveu:>>> Regarding this feature recently added to Ruby 1.9, how about including it on >>> Rails core extension when not defined? >>> >>> http://redmine.ruby-lang.org/issues/show/1081 >>> http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=26816 >>> >>> This allows File.write(''file.txt'', ''Content of the file'') instead of >>> File.open(''file.txt''){|f| f.write ''Content of the file''} >>> >>> What do you think? >>> >> Sounds good. Do you have a patch? >> >> jeremy >> > If you look at the ticket ( > http://redmine.ruby-lang.org/issues/show/1081 ) the feature was backed > out today, there were some implementation errors that might not be > resolved in time for this method to make it into 1.9.2. > > Might be worthwhile to hold off on adding as a core ext in Rails until > there''s a stable implementation to copy a method signature from. >Well, apparently Matz has already agreed on the API, and this is just an issue with the implementation. But I don''t see any problem in waiting a bit more until this issue is closed in Redmine... Jeremy, I didn''t prepare any patch yet, but since it is a trivial one, as soon as we agree in adding it to Rails core, I''ll prepare it. Rodrigo. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.