Skip to content

Commit

Permalink
Rescue LoadError to require 'fiddle'
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Oct 11, 2021
1 parent 5f3ccda commit fe504bb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/reline/terminfo.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
require 'fiddle'
require 'fiddle/import'
begin
require 'fiddle'
require 'fiddle/import'
rescue LoadError
module Reline::Terminfo
def self.curses_dl
false
end
end
end

module Reline::Terminfo
extend Fiddle::Importer
Expand Down Expand Up @@ -50,7 +58,7 @@ def self.curses_dl
@curses_dl = nil if @curses_dl == false
@curses_dl
end
end
end if not Reline.const_defined?(:Terminfo) or not Reline::Terminfo.respond_to?(:curses_dl)

module Reline::Terminfo
dlload curses_dl
Expand Down

0 comments on commit fe504bb

Please sign in to comment.