Skip to content

Commit

Permalink
Readline somewhere does STDXXX.fileno and we redefine std{in,out,err}…
Browse files Browse the repository at this point in the history
…. Also change constants in addition to globals
  • Loading branch information
enebo committed Apr 28, 2015
1 parent 59b4ba4 commit a5c372d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/jirb_swing
Expand Up @@ -39,6 +39,16 @@ frame = JFrame.new(FRAME_TITLE).tap do |frame|

tar = org.jruby.demo.readline.TextAreaReadline.new(text, HEADER)
tar.hook_into_runtime_with_streams(JRuby.runtime)

# Ruby does not like redefining constants but we do not want the warnings
# readline reads constants and not the globals so we need to reassign
# the globals.
saved_verbose = $VERBOSE
$VERBOSE = nil
STDIN = $stdin
STDOUT = $stdout
STDERR = $stderr
$VERBOSE = saved_verbose
end
end)

Expand Down

1 comment on commit a5c372d

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no idea this existed. Nifty.

Please sign in to comment.