Class: Vimdb::Options
- Inherits:
-
Item
- Object
- Item
- Vimdb::Options
show all
- Defined in:
- lib/vimdb/options.rb
Instance Method Summary
collapse
Methods inherited from Item
all, #default_field, inherited, instance, item_name, #key, #search
Instance Method Details
#create ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/vimdb/options.rb', line 10
def create
file = tempfile(:options_help) do |file|
vim 'silent help option-list', 'exe "normal 2_y}"', 'new',
'exe "normal p"', "silent! w! #{file}"
end
opts = File.read(file).scan(/^'(\S+)'\s*('\S*')?\s*(.*$)/).map do |line|
{ name: line[0], alias: line[1] ? line[1][1..-2] : '', desc: line[2] }
end
opts
end
|
#fields ⇒ Object
2
3
4
|
# File 'lib/vimdb/options.rb', line 2
def fields
[:name, :alias, :desc]
end
|
#info ⇒ Object
6
7
8
|
# File 'lib/vimdb/options.rb', line 6
def info
"Created using :help option-list"
end
|