infect 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +3 -3
- data/bin/infect +17 -0
- data/lib/infect/command/plugin.rb +1 -2
- data/lib/infect/runner.rb +1 -1
- data/lib/infect/version.rb +1 -1
- data/spec/runner_spec.rb +2 -2
- data/standalone/infect +19 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27f2905781c72059e8fffaaae72dddb511fda306
|
4
|
+
data.tar.gz: '0585f4046b6b476cfe198509d333b507ea909784'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c731ee5a480c727c6e24c4d10f10b2e7ac1b1dbca047b626ac65df357098fc7bf9feabb73b7300213640397ef9f2bd4abb823df601a4698e87a128c49f048981
|
7
|
+
data.tar.gz: 8953da79d7386f789e63dcb5a2c072ce55c121a943d936926e51f215661e1739397d1799934e2c0ba7c3c92a87eefeb45ab246a69fc9b99b362ebab13198260c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -56,7 +56,7 @@ Some plugins have binaries that need to be compiled, and infect can automaticall
|
|
56
56
|
|
57
57
|
Packages are collections of plugins. Introduced in Vim 8, they provide a way to combine a number of plugins together and have Vim load them for you. One of the nice upsides to this is you don't need any external plugin manager to be able to load plugin bundles, just have to put them in the right folder.
|
58
58
|
|
59
|
-
Infect will do this for you. If you declare a
|
59
|
+
Infect will do this for you. If you declare a `plugin`, infect will put that in the default package called `plugins`. That will cause it to automatically be loaded when vim is started.
|
60
60
|
|
61
61
|
## Loading automatically or optionally
|
62
62
|
|
@@ -66,9 +66,9 @@ According to Vim docs:
|
|
66
66
|
ones under "pack/foo/start". See |pack-add| below for how the "opt" directory
|
67
67
|
is used.
|
68
68
|
|
69
|
-
This means you have to call `:packadd` to load any optional plugins. This can be
|
69
|
+
This means you have to call `:packadd` to load any optional plugins. This can be handy if you don't want to proactively load up some plugins.
|
70
70
|
|
71
|
-
Tell vim to only load
|
71
|
+
Tell vim to only load Trailer Trash when requested:
|
72
72
|
|
73
73
|
"=plugin csexton/trailertrash.vim load: opt
|
74
74
|
|
data/bin/infect
CHANGED
@@ -1,4 +1,21 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "#{File.dirname(__FILE__)}/../lib/infect"
|
3
3
|
|
4
|
+
unless (ARGV & %w[-v --version]).empty?
|
5
|
+
puts "infect version #{Infect::VERSION}"
|
6
|
+
exit 0
|
7
|
+
end
|
8
|
+
|
9
|
+
unless (ARGV & %w[-h --help]).empty?
|
10
|
+
puts "Command line tool for installing packages for Vim"
|
11
|
+
puts "Usage: infect [options]"
|
12
|
+
puts "Options:"
|
13
|
+
puts " -f Force removal of old packages without prompting"
|
14
|
+
puts " -v/--version Print the version"
|
15
|
+
puts " -h/--help Print this message"
|
16
|
+
puts ""
|
17
|
+
puts "See https://github.com/csexton/infect for instructions"
|
18
|
+
exit 0
|
19
|
+
end
|
20
|
+
|
4
21
|
Infect::Runner.call(*ARGV)
|
data/lib/infect/runner.rb
CHANGED
data/lib/infect/version.rb
CHANGED
data/spec/runner_spec.rb
CHANGED
@@ -18,7 +18,7 @@ describe Infect::Runner do
|
|
18
18
|
|
19
19
|
Infect::Command.stub(:builder)
|
20
20
|
Infect::Command.should_receive(:build).with("bundle", "NoParams", {})
|
21
|
-
Infect::Runner.call
|
21
|
+
Infect::Runner.call("-f")
|
22
22
|
end
|
23
23
|
|
24
24
|
it "reads bundle command" do
|
@@ -27,7 +27,7 @@ describe Infect::Runner do
|
|
27
27
|
|
28
28
|
Infect::Command.stub(:builder)
|
29
29
|
Infect::Command.should_receive(:build).with("bundle", "ExtraParams", {param1:"val1", param2:"val2"})
|
30
|
-
Infect::Runner.call
|
30
|
+
Infect::Runner.call("-f")
|
31
31
|
end
|
32
32
|
|
33
33
|
|
data/standalone/infect
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
#
|
8
8
|
|
9
9
|
module Infect
|
10
|
-
VERSION = "1.
|
10
|
+
VERSION = "1.1.0"
|
11
11
|
end
|
12
12
|
|
13
13
|
require 'open-uri'
|
@@ -74,11 +74,13 @@ require 'open3'
|
|
74
74
|
module Infect
|
75
75
|
class Command
|
76
76
|
class Plugin < Command
|
77
|
+
DEFAULT_DIR = "plugins"
|
78
|
+
|
77
79
|
attr_reader :build, :location, :name, :options, :url
|
78
80
|
|
79
81
|
def initialize(arg, opts)
|
80
82
|
load = opts.fetch(:load) { "start" }
|
81
|
-
package = opts.fetch(:package) {
|
83
|
+
package = opts.fetch(:package) { DEFAULT_DIR }
|
82
84
|
|
83
85
|
@name = File.basename(arg)
|
84
86
|
@url = "git@github.com:#{arg}.git"
|
@@ -97,8 +99,7 @@ module Infect
|
|
97
99
|
def update
|
98
100
|
notice "Updating #{name}..."
|
99
101
|
chdir location
|
100
|
-
git "
|
101
|
-
git "checkout master"
|
102
|
+
git "pull"
|
102
103
|
end
|
103
104
|
|
104
105
|
def call
|
@@ -178,7 +179,7 @@ module Infect
|
|
178
179
|
end
|
179
180
|
|
180
181
|
def call
|
181
|
-
|
182
|
+
install_paths.each do |path|
|
182
183
|
unless names.include? File.basename(path)
|
183
184
|
if confirm(path)
|
184
185
|
notice "Deleting #{path}"
|
@@ -206,6 +207,18 @@ module Infect
|
|
206
207
|
end
|
207
208
|
end
|
208
209
|
|
210
|
+
private
|
211
|
+
|
212
|
+
def install_paths
|
213
|
+
|
214
|
+
default_dir = Command::Plugin::DEFAULT_DIR
|
215
|
+
plugins = Dir["#{PACK_DIR}#{default_dir}/*/*"]
|
216
|
+
packages = Dir["#{PACK_DIR}*"]
|
217
|
+
packages.delete("#{PACK_DIR}#{default_dir}")
|
218
|
+
|
219
|
+
plugins + packages
|
220
|
+
end
|
221
|
+
|
209
222
|
end
|
210
223
|
end
|
211
224
|
|
@@ -216,7 +229,7 @@ module Infect
|
|
216
229
|
|
217
230
|
class Runner
|
218
231
|
def self.call(*args)
|
219
|
-
self.new.call(args)
|
232
|
+
self.new.call(*args)
|
220
233
|
end
|
221
234
|
|
222
235
|
def call(*args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Sexton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.6.11
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Asset Pipeline for Vim and Pathogen, install vim bundles included in your
|