pvim 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/lib/pvim/plugin.rb +31 -23
- data/lib/pvim/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3697c02422c62529465f90fd003e4b862d0d4283
|
4
|
+
data.tar.gz: 0a2d3bc8c0e48f5b24ee3ae0cd91827b21f504d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39404ea93a170dd61a8648dbca35397918dd1178c67a24a49502ca281605176a23af0023329abeb2fd5aff4227dc2529a9c86510eeb009d374b46056210a017b
|
7
|
+
data.tar.gz: a1202d82a8e4c047997f8f66d86a5b90c3496f9e49b84ac37e3cf2ca05712be553a86bc6ea81380583ed8c8b477c0d04f53e96ae3ae147de85c9f0b848eb7afb
|
data/lib/pvim/plugin.rb
CHANGED
@@ -27,32 +27,40 @@ module Pvim
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
desc 'add
|
31
|
-
def add(url)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
desc 'add URLS', 'Add vim plugins'
|
31
|
+
def add(url, *urls)
|
32
|
+
urls.unshift url
|
33
|
+
urls.uniq!
|
34
|
+
urls.each do |u|
|
35
|
+
u = add_github_prefix(u)
|
36
|
+
check_url(u)
|
37
|
+
inside pvim do
|
38
|
+
empty_directory bundle_dir unless Dir.exists?(bundle_dir)
|
39
|
+
run "git submodule add #{u.inspect} #{installed_dir(u).inspect}"
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
40
|
-
desc 'remove
|
41
|
-
def remove(url)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
44
|
+
desc 'remove URLS', 'Remove vim plugins'
|
45
|
+
def remove(url, *urls)
|
46
|
+
urls.unshift url
|
47
|
+
urls.uniq!
|
48
|
+
urls.each do |u|
|
49
|
+
u = add_github_prefix(u)
|
50
|
+
check_url(u)
|
51
|
+
if plugin = find_plugin(u)
|
52
|
+
inside pvim do
|
53
|
+
empty_directory bundle_dir unless Dir.exists?(bundle_dir)
|
54
|
+
path = plugin.last
|
55
|
+
submodule = ['submodule', path].join('.')
|
56
|
+
run "git submodule deinit -f #{path.inspect}"
|
57
|
+
run "git rm -rf #{path.inspect}"
|
58
|
+
run "git config -f .gitmodules --remove-section #{submodule.inspect}"
|
59
|
+
remove_file File.join('.git', 'modules', path)
|
60
|
+
end
|
61
|
+
else
|
62
|
+
say "#{url} is not installed", Color::RED
|
53
63
|
end
|
54
|
-
else
|
55
|
-
say "#{url} is not installed", Color::RED
|
56
64
|
end
|
57
65
|
end
|
58
66
|
|
@@ -124,7 +132,7 @@ module Pvim
|
|
124
132
|
end
|
125
133
|
|
126
134
|
def is_github_url?(url)
|
127
|
-
!!url.match(/^https?\:\/\/github\.com\/[a-
|
135
|
+
!!url.match(/^https?\:\/\/github\.com\/[a-zA-Z0-9\-\._]+\/[a-zA-Z0-9\-\._]+$/)
|
128
136
|
end
|
129
137
|
|
130
138
|
def value(s)
|
data/lib/pvim/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pvim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phong Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|