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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9954bd5a373cc6a42f6fb4c0ac0474feafe9d8e9
4
- data.tar.gz: 2727006e4ad2ee6ff29a27cb395f03342d5f8790
3
+ metadata.gz: 27f2905781c72059e8fffaaae72dddb511fda306
4
+ data.tar.gz: '0585f4046b6b476cfe198509d333b507ea909784'
5
5
  SHA512:
6
- metadata.gz: 79c54e4f1692467ca425666f6de7bc6d7b9b5a2486e8f6abb2e513e3d83dc68767bfc6abfd83633524c8119ba6e3c623562c9719c712d245bf4ebe17fe85d248
7
- data.tar.gz: 7039ce9fe5e4ad685a748d85470526c1ae92d6efd0356aa8fb5fe0a9b09e5fee4801a05b4faac29d7796a47af6a15259fda791cecc5181193af25204a84c8807
6
+ metadata.gz: c731ee5a480c727c6e24c4d10f10b2e7ac1b1dbca047b626ac65df357098fc7bf9feabb73b7300213640397ef9f2bd4abb823df601a4698e87a128c49f048981
7
+ data.tar.gz: 8953da79d7386f789e63dcb5a2c072ce55c121a943d936926e51f215661e1739397d1799934e2c0ba7c3c92a87eefeb45ab246a69fc9b99b362ebab13198260c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- infect (1.1.0)
4
+ infect (1.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -42,4 +42,4 @@ DEPENDENCIES
42
42
  rspec
43
43
 
44
44
  BUNDLED WITH
45
- 1.13.6
45
+ 1.15.3
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 'plugin`, infect will put that in the `default` package's `start` directory. That will cause it to automatically be loaded when vim is started.
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 hanyd if you don't want to proactivly load up some plugins.
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 trailertrash when requested:
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)
@@ -28,8 +28,7 @@ module Infect
28
28
  def update
29
29
  notice "Updating #{name}..."
30
30
  chdir location
31
- git "fetch"
32
- git "checkout master"
31
+ git "pull"
33
32
  end
34
33
 
35
34
  def call
@@ -6,7 +6,7 @@ module Infect
6
6
 
7
7
  class Runner
8
8
  def self.call(*args)
9
- self.new.call(args)
9
+ self.new.call(*args)
10
10
  end
11
11
 
12
12
  def call(*args)
@@ -1,3 +1,3 @@
1
1
  module Infect
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -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
 
@@ -7,7 +7,7 @@
7
7
  #
8
8
 
9
9
  module Infect
10
- VERSION = "1.0.0"
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) { "default" }
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 "fetch"
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
- Dir["#{PACK_DIR}*/*/*"].each do |path|
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.0
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-05-20 00:00:00.000000000 Z
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.5.1
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