Display 'gem install curses' when curses cannot be loaded

This commit is contained in:
Junegunn Choi
2014-07-27 01:08:30 +09:00
parent 22989b0488
commit a54784cd53
2 changed files with 9 additions and 4 deletions

9
fzf
View File

@@ -7,7 +7,7 @@
# / __/ / /_/ __/
# /_/ /___/_/ Fuzzy finder for your shell
#
# Version: 0.8.7 (Jul 18, 2014)
# Version: 0.8.7 (Jul 27, 2014)
#
# Author: Junegunn Choi
# URL: https://github.com/junegunn/fzf
@@ -36,8 +36,13 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
begin
require 'curses'
rescue LoadError
$stderr.puts 'curses gem is not installed. Try `gem install curses`.'
exit 1
end
require 'thread'
require 'curses'
require 'set'
unless String.method_defined? :force_encoding