vimgem 0.1.0 → 0.1.1
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/bin/vimgem +1 -3
- data/lib/vimgem/version.rb +1 -1
- data/lib/vimgem.rb +19 -4
- data/vimgem-0.1.0.gem +0 -0
- metadata +4 -3
data/bin/vimgem
CHANGED
data/lib/vimgem/version.rb
CHANGED
data/lib/vimgem.rb
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
require 'rbconfig'
|
|
2
|
+
|
|
1
3
|
module Vimgem
|
|
2
|
-
|
|
4
|
+
extend self
|
|
5
|
+
|
|
6
|
+
def browse(gem)
|
|
7
|
+
return unless gem
|
|
8
|
+
spec = get_gemspec(gem)
|
|
9
|
+
exec_vim spec.full_gem_path
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def get_gemspec(gem)
|
|
3
13
|
matches = Gem.source_index.find_name(gem_name)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
14
|
+
matches.first
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def exec_vim(path)
|
|
18
|
+
case Config::CONFIG['target_os'].to_sym
|
|
19
|
+
when :linux
|
|
20
|
+
`gvim #{spec.full_gem_path}`
|
|
21
|
+
end
|
|
7
22
|
end
|
|
8
23
|
end
|
data/vimgem-0.1.0.gem
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vimgem
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 25
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.1.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Lim Chanmann
|
|
@@ -36,6 +36,7 @@ files:
|
|
|
36
36
|
- bin/vimgem
|
|
37
37
|
- lib/vimgem.rb
|
|
38
38
|
- lib/vimgem/version.rb
|
|
39
|
+
- vimgem-0.1.0.gem
|
|
39
40
|
- vimgem.gemspec
|
|
40
41
|
has_rdoc: true
|
|
41
42
|
homepage: http://rubygems.org/gems/vimgem
|