ver-command_t 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,46 @@
1
+ require 'yard'
2
+ unless ::YARD::Registry.class == Module
3
+ warn "To use command_t_yard, you need YARD to be at least 0.6"
4
+ else
5
+
6
+ class VER::Executor::ExCommandTYARD < VER::Executor::Entry
7
+ def choices(text)
8
+ @matcher.sorted_matches_for(text, {})
9
+ end
10
+
11
+ def setup
12
+ @matcher = CommandT::Matcher.new(Registry, always_show_dot_files: true)
13
+ end
14
+
15
+ def action(selected)
16
+ obj = Registry.path_hash[selected] or throw :invalid
17
+ VER.find_or_create_buffer(obj.file, obj.line)
18
+ callback.destroy(false)
19
+ end
20
+
21
+ module ::YARD::Registry
22
+ # @param [Array<String>] YARD database paths to load
23
+ def self.load_files(files=[]) # TODO test it
24
+ files.each do |file|
25
+ if @store.load(file)
26
+ @store.load_yardoc
27
+ @store.instance_variable_set(:@available_objects, 1/0.0) # Infinity
28
+ @store.load_all
29
+ end
30
+ end
31
+ end
32
+
33
+ def self.paths
34
+ @paths ||= all.map(&:path)
35
+ end
36
+
37
+ def self.path_hash
38
+ @path_hash ||= Hash[all.map(&:path).zip(all)]
39
+ end
40
+ end
41
+
42
+ Registry.load!('.yardoc') # TODO use load_files
43
+
44
+ end
45
+
46
+ end
data/lib/ver-command_t.rb CHANGED
@@ -1,9 +1,11 @@
1
1
  # All the ver integration stuff is in here.
2
2
  require 'ver'
3
3
  require 'command_t/ex/command_t'
4
+ require 'command_t/ex/command_t_yard'
4
5
 
5
6
  VER::Executor::ExLabel::COMPLETERS.merge!(
6
- 'command_t' => :ExCommandT
7
+ 'command_t' => :ExCommandT,
8
+ 'command_t_yard' => :ExCommandTYARD
7
9
  )
8
10
 
9
11
  VER::startup_hook do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Simon Hafner
@@ -27,35 +27,34 @@ extensions:
27
27
  extra_rdoc_files: []
28
28
 
29
29
  files:
30
+ - lib/ver-command_t.rb
30
31
  - lib/command_t/settings.rb
31
- - lib/command_t/finder.rb
32
32
  - lib/command_t/scanner.rb
33
+ - lib/command_t/finder.rb
34
+ - lib/command_t/ex/command_t_yard.rb
33
35
  - lib/command_t/ex/command_t.rb
34
- - lib/ver-command_t.rb
35
36
  - ext/command_t/ruby_compat.h
36
- - ext/command_t/mkmf.log
37
- - ext/command_t/ext.so
38
- - ext/command_t/ext.h
37
+ - ext/command_t/matcher.h
38
+ - ext/command_t/matcher.c
39
39
  - ext/command_t/match.h
40
+ - ext/command_t/match.c
41
+ - ext/command_t/extconf.rb
42
+ - ext/command_t/ext.h
40
43
  - ext/command_t/ext.c
41
44
  - ext/command_t/depend
42
- - ext/command_t/extconf.rb
43
- - ext/command_t/match.c
44
- - ext/command_t/matcher.h
45
- - ext/command_t/matcher.c
46
- - spec/command_t/scanner_spec.rb
47
- - spec/command_t/matcher_spec.rb
48
- - spec/command_t/match_spec.rb
49
- - spec/command_t/finder_spec.rb
50
45
  - spec/vim_formatter.rb
51
46
  - spec/spec_helper.rb
52
- - spec/fixtures/baz
53
- - spec/fixtures/bing
54
- - spec/fixtures/bar/abc
55
- - spec/fixtures/bar/xyz
56
47
  - spec/fixtures/foo/beta
57
48
  - spec/fixtures/foo/alpha/t2
58
49
  - spec/fixtures/foo/alpha/t1
50
+ - spec/fixtures/bing
51
+ - spec/fixtures/baz
52
+ - spec/fixtures/bar/xyz
53
+ - spec/fixtures/bar/abc
54
+ - spec/command_t/scanner_spec.rb
55
+ - spec/command_t/matcher_spec.rb
56
+ - spec/command_t/match_spec.rb
57
+ - spec/command_t/finder_spec.rb
59
58
  - LICENSE
60
59
  - README.md
61
60
  has_rdoc: true
@@ -92,16 +91,16 @@ signing_key:
92
91
  specification_version: 3
93
92
  summary: ver adaptation of the CommandT plugin for vim
94
93
  test_files:
95
- - spec/command_t/scanner_spec.rb
96
- - spec/command_t/matcher_spec.rb
97
- - spec/command_t/match_spec.rb
98
- - spec/command_t/finder_spec.rb
99
94
  - spec/vim_formatter.rb
100
95
  - spec/spec_helper.rb
101
- - spec/fixtures/baz
102
- - spec/fixtures/bing
103
- - spec/fixtures/bar/abc
104
- - spec/fixtures/bar/xyz
105
96
  - spec/fixtures/foo/beta
106
97
  - spec/fixtures/foo/alpha/t2
107
98
  - spec/fixtures/foo/alpha/t1
99
+ - spec/fixtures/bing
100
+ - spec/fixtures/baz
101
+ - spec/fixtures/bar/xyz
102
+ - spec/fixtures/bar/abc
103
+ - spec/command_t/scanner_spec.rb
104
+ - spec/command_t/matcher_spec.rb
105
+ - spec/command_t/match_spec.rb
106
+ - spec/command_t/finder_spec.rb
data/ext/command_t/ext.so DELETED
Binary file
@@ -1,20 +0,0 @@
1
- have_header: checking for ruby.h... -------------------- yes
2
-
3
- "gcc -o conftest -I/home/tass/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/x86_64-linux -I/home/tass/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward -I/home/tass/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1 -I. -O2 -g -Wall -fPIC conftest.c -L. -L/home/tass/.rvm/rubies/ruby-1.9.2-p0/lib -Wl,-R/home/tass/.rvm/rubies/ruby-1.9.2-p0/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/home/tass/.rvm/rubies/ruby-1.9.2-p0/lib -L/home/tass/.rvm/rubies/ruby-1.9.2-p0/lib -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc"
4
- checked program was:
5
- /* begin */
6
- 1: #include "ruby.h"
7
- 2:
8
- 3: int main() {return 0;}
9
- /* end */
10
-
11
- "gcc -E -I/home/tass/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/x86_64-linux -I/home/tass/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward -I/home/tass/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1 -I. -O2 -g -Wall -fPIC conftest.c -o conftest.i"
12
- checked program was:
13
- /* begin */
14
- 1: #include "ruby.h"
15
- 2:
16
- 3: #include <ruby.h>
17
- /* end */
18
-
19
- --------------------
20
-