diff options
Diffstat (limited to 'lib/irb/xmp.rb')
-rw-r--r-- | lib/irb/xmp.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/irb/xmp.rb b/lib/irb/xmp.rb index 947d2cf5a2..2e3fefc4ba 100644 --- a/lib/irb/xmp.rb +++ b/lib/irb/xmp.rb @@ -85,16 +85,16 @@ class XMP if @irb.context.ignore_sigint begin - trap_proc_b = trap("SIGINT"){@irb.signal_handle} - catch(:IRB_EXIT) do - @irb.eval_input - end + trap_proc_b = trap("SIGINT"){@irb.signal_handle} + catch(:IRB_EXIT) do + @irb.eval_input + end ensure - trap("SIGINT", trap_proc_b) + trap("SIGINT", trap_proc_b) end else catch(:IRB_EXIT) do - @irb.eval_input + @irb.eval_input end end end @@ -117,10 +117,10 @@ class XMP # See IO#gets for more information. def gets while l = @exps.shift - next if /^\s+$/ =~ l - l.concat "\n" - print @prompt, l - break + next if /^\s+$/ =~ l + l.concat "\n" + print @prompt, l + break end l end @@ -131,14 +131,14 @@ class XMP # doesn't match the previous expression evaluated. def puts(exps) if @encoding and exps.encoding != @encoding - enc = Encoding.compatible?(@exps.join("\n"), exps) - if enc.nil? - raise Encoding::CompatibilityError, "Encoding in which the passed expression is encoded is not compatible to the preceding's one" - else - @encoding = enc - end + enc = Encoding.compatible?(@exps.join("\n"), exps) + if enc.nil? + raise Encoding::CompatibilityError, "Encoding in which the passed expression is encoded is not compatible to the preceding's one" + else + @encoding = enc + end else - @encoding = exps.encoding + @encoding = exps.encoding end @exps.concat exps.split(/\n/) end |