This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
repl.vim/autoload/repl/ruby.vim

21 lines
705 B
VimL
Raw Normal View History

2015-12-20 10:53:58 +00:00
scriptencoding utf-8
function! repl#ruby#open_repl() abort
" Setting up the obj file for the current file
if &modified
let l:module_file = tempname() . '.rb'
call writefile(getline(1, expand('$')), l:module_file)
else
let l:module_file = expand('%:p')
endif
let l:repl = repl#get_filetype_repl('ruby')
if !executable(l:repl['repl'])
call repl#echo_error(printf("You don't have repl: '%s'", l:repl['repl']))
2015-12-20 10:53:58 +00:00
return
endif
let l:args = printf('%s %s %s', l:repl['repl'], l:repl['opt'], l:module_file)
2015-12-22 14:36:09 +00:00
let l:vimshell_interactive = ':VimShellInteractive' . printf("--split='%s'", g:repl_split_command)
execute l:vimshell_interactive l:args
2015-12-20 10:53:58 +00:00
endfunction