pvim 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e23421fa7550e9b6582975999ed19cf497191d0
4
- data.tar.gz: b664311e10c23488c15a8a3a49a10afb062a89f3
3
+ metadata.gz: 3697c02422c62529465f90fd003e4b862d0d4283
4
+ data.tar.gz: 0a2d3bc8c0e48f5b24ee3ae0cd91827b21f504d7
5
5
  SHA512:
6
- metadata.gz: 3376d67a9f779fd81e6ac358c0afa77a05087844bc1b7df69732f5078d422c7aa6ed955b14ce0f859a254ad805c8bc04d27347819dcbaa183fb22cb5795bbe5c
7
- data.tar.gz: 953138d333a88c1bb74eb01574f9b6fc31c655eaed781b44b8f4fc661fbdfbf3d8dfe75cc4fad7a46537c17b52579614429d5cc40f919ef6b005e95e7ad2c994
6
+ metadata.gz: 39404ea93a170dd61a8648dbca35397918dd1178c67a24a49502ca281605176a23af0023329abeb2fd5aff4227dc2529a9c86510eeb009d374b46056210a017b
7
+ data.tar.gz: a1202d82a8e4c047997f8f66d86a5b90c3496f9e49b84ac37e3cf2ca05712be553a86bc6ea81380583ed8c8b477c0d04f53e96ae3ae147de85c9f0b848eb7afb
@@ -27,32 +27,40 @@ module Pvim
27
27
  end
28
28
  end
29
29
 
30
- desc 'add URL', 'Add vim plugins'
31
- def add(url)
32
- url = add_github_prefix(url)
33
- check_url(url)
34
- inside pvim do
35
- empty_directory bundle_dir
36
- run "git submodule add #{url.inspect} #{installed_dir(url).inspect}"
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 URL', 'Remove vim plugins'
41
- def remove(url)
42
- url = add_github_prefix(url)
43
- check_url(url)
44
- if plugin = find_plugin(url)
45
- inside pvim do
46
- empty_directory bundle_dir
47
- path = plugin.last
48
- submodule = ['submodule', path].join('.')
49
- run "git submodule deinit -f #{path.inspect}"
50
- run "git rm -rf #{path.inspect}"
51
- run "git config -f .gitmodules --remove-section #{submodule.inspect}"
52
- remove_file File.join('.git', 'modules', path)
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-z0-9\-\._]+\/[a-z0-9\-\._]+$/)
135
+ !!url.match(/^https?\:\/\/github\.com\/[a-zA-Z0-9\-\._]+\/[a-zA-Z0-9\-\._]+$/)
128
136
  end
129
137
 
130
138
  def value(s)
@@ -1,3 +1,3 @@
1
1
  module Pvim
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-21 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler