Module: CommandKit::Edit
- Includes:
- Env
- Defined in:
- lib/command_kit/edit.rb
Overview
Allows invoking the EDITOR
environment variable.
Environment Variables
EDITOR
- The preferred editor command.
Example
if [:edit]
edit CONFIG_FILE
end
Instance Attribute Summary
Attributes included from Env
Instance Method Summary collapse
-
#edit(*arguments) ⇒ Boolean?
Invokes the preferred editor with the additional arguments.
-
#editor ⇒ String
The
EDITOR
environment variable.
Methods included from Env
Instance Method Details
#edit(*arguments) ⇒ Boolean?
Invokes the preferred editor with the additional arguments.
48 49 50 51 52 |
# File 'lib/command_kit/edit.rb', line 48 def edit(*arguments) if editor system(editor,*arguments.map(&:to_s)) end end |
#editor ⇒ String
The EDITOR
environment variable.
32 33 34 |
# File 'lib/command_kit/edit.rb', line 32 def editor env['EDITOR'] || 'nano' end |