가능한 중복 :IRB 출력을 억제 하시겠습니까?
>> for a in 1..5 do ?> puts a >> end 1 2 3 4 5 => 1..5 >>
가 어떻게 출력
=> 1..5
을 억제 않습니다
Rails console, how to stop output of return value?
은 IRB에서이 세션을 고려? 이것은 내가 레일 콘솔 세션에서이 작업을 수행 할 경우에 중요하다
for post in Post.find(:all) do
if post.submit_time > Time.now
puts "Corrupted post #{post.id} is from the future"
end
end
나는 모든 게시물 마지막에 배열로 인쇄하고 싶지 않아요. 출력을 어떻게 억제합니까?
find_each
또는 Ruby 스크립트와 같은 다른 방법이 있지만 대화식 세션에서이 작업을 수행하는 데 더 많은 관심이 있습니다.
비슷한 질문을 참조하십시오 [여기] (http://stackoverflow.com/questions/10150541/rails-console-how-to-stop-output-of-return-value) , [여기] (http://stackoverflow.com/questions/4678732/how-to-suppress-rails-console-irb-outputs) 및 블로그 게시물 [here] (http://austinruby.com/2006/ 10/6/quieting-irb-s-return-value) – pjumble