On 1 Dec 2008, at 11:44, John Victor wrote:

>
> ---
> my_data.rb code:
> data.each do |line|
>   a.write(line) #--this writes to my_data.dat
>   puts line     #--this puts the same data to STDOUT
> end
> ---
> controller code:
> def index
>   @my_data = `/usr/bin/my_data.rb`   #this causes data to be skewed
>   [EMAIL PROTECTED] = File.open("/usr/bin/my_data.dat").read #this works
> end
> ---
> index.rthml code:
> <pre><%= simple_format @my_data %></pre>
>

puts always appends a carriage return whereas write doesn't. if you  
changed it to STDOUT.write(line) it should be the same

Fred
> Perhaps the way I'm writing to STDOUT in my_data.rb is causing the
> skewing of my data?
>
> thanks
>
> vic
>
>
>
>
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to