0.0
No commit activity in last 3 years
No release in over 3 years
Use vim (or any other text editor) from a console app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.0.1
 Project Readme

Console editor

Based almost entirely on interactive_editor, written by Jan Berkel. See the original GitHub project for details.

The only difference between this project and interactive_editor is its behaviour: the original project is intended for use in irb, and eval()'s the contents of your editor upon exit. The purpose of console_editor is to let console application users edit text files that are not intended for evaluation by the script.

Usage

$ gem install console_editor

Put the following in your console script:

require 'rubygems'
require 'console_editor'

Then, in your console application:

> nano                       # (use nano w/ temp file)
> nano 'filename.rb'         # (open filename.rb in nano)
> ed                         # (use EDITOR env variable)
> [emacs|vim|mvim|nano|mate] # (other editors)

When you exit the editor, your script can continue its execution.

To try it out without installing the gem:

$ git clone git://github.com/aaronvegh/console_editor.git

Include the lib/console_editor.rb file in your script.

Disclaimer

This is a quick and dirty rip from the interactive_editor gem, so any legacy code from that project is due only to my haste and ignorance. Cheers!