ext/curses/extconf.rb in curses-1.0.0 vs ext/curses/extconf.rb in curses-1.0.1

- old
+ new

@@ -126,8 +126,17 @@ $defs << '-DHAVE_FUNC_CURSES_VERSION' if function_p $defs << '-DHAVE_VAR_CURSES_VERSION' if variable_p else warn "unexpeted value for --with-curses-version: #{with_curses_version}" end - - create_makefile("curses") + + if RUBY_VERSION >= '2.1' + create_makefile("curses") + else + # curses is part of ruby-core pre-2.1.0, so this gem is not required. But + # make pre-2.1.0 a no-op rather than failing or listing as unsupported, to + # aid gems offering multi-version Ruby support. + File.open("Makefile", 'w') do |f| + f.puts dummy_makefile("curses").join + end + end end