interactive_editor 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +5 -3
- data/interactive_editor.gemspec +2 -2
- data/lib/interactive_editor.rb +10 -2
- metadata +3 -3
data/README.md
CHANGED
@@ -15,9 +15,11 @@ Put the following in your .irbrc:
|
|
15
15
|
Then, from within irb:
|
16
16
|
|
17
17
|
$ irb
|
18
|
-
> vi
|
19
|
-
> vi 'filename.rb'
|
20
|
-
>
|
18
|
+
> vi # (use vi w/ temp file)
|
19
|
+
> vi 'filename.rb' # (open filename.rb in vi)
|
20
|
+
> ed # (use EDITOR env variable)
|
21
|
+
> [emacs|vim|nano|mate] # (other editors)
|
22
|
+
|
21
23
|
|
22
24
|
To try it out without installing the gem:
|
23
25
|
|
data/interactive_editor.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
8
|
## the sub! line in the Rakefile
|
9
9
|
s.name = 'interactive_editor'
|
10
|
-
s.version = '0.0.
|
11
|
-
s.date = '2010-05-
|
10
|
+
s.version = '0.0.4'
|
11
|
+
s.date = '2010-05-19'
|
12
12
|
s.rubyforge_project = 'interactive_editor'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
data/lib/interactive_editor.rb
CHANGED
@@ -7,7 +7,7 @@ require 'fileutils'
|
|
7
7
|
require 'tempfile'
|
8
8
|
|
9
9
|
class InteractiveEditor
|
10
|
-
VERSION = '0.0.
|
10
|
+
VERSION = '0.0.4'
|
11
11
|
|
12
12
|
attr_accessor :editor
|
13
13
|
|
@@ -74,7 +74,15 @@ class InteractiveEditor
|
|
74
74
|
InteractiveEditor.edit(v || k, *args)
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
def ed(*args)
|
79
|
+
if ENV['EDITOR'].to_s.size > 0
|
80
|
+
InteractiveEditor.edit(ENV['EDITOR'], *args)
|
81
|
+
else
|
82
|
+
raise "You need to set the EDITOR environment variable first"
|
83
|
+
end
|
84
|
+
end
|
77
85
|
end
|
78
86
|
end
|
79
87
|
|
80
|
-
include InteractiveEditor::Editors
|
88
|
+
include InteractiveEditor::Editors
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jan Berkel
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-19 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|