Skip to content
Permalink
Browse files

Lazy-load io/console to avoid activating the gem unecessarily

  • Loading branch information...
segiddins committed Jan 15, 2017
1 parent 9803cb9 commit 5992cf8449286c0cd2c4a567416e3f557648c986
Showing with 2 additions and 1 deletion.
  1. +2 −0 lib/thor/line_editor/basic.rb
  2. +0 −1 lib/thor/shell/basic.rb
@@ -23,6 +23,8 @@ def get_input
if echo?
$stdin.gets
else
# Lazy-load io/console since it is gem-ified as of 2.3
require "io/console" if RUBY_VERSION > "1.9.2"
$stdin.noecho(&:gets)
end
end
@@ -1,5 +1,4 @@
require "tempfile"
require "io/console" if RUBY_VERSION > "1.9.2"

class Thor
module Shell

0 comments on commit 5992cf8

Please sign in to comment.
You can’t perform that action at this time.