vimpk 0.1.1 → 0.1.2
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/vimpk/cli.rb +14 -8
- data/lib/vimpk/options.rb +12 -10
- data/lib/vimpk/version.rb +1 -1
- data/lib/vimpk.rb +1 -1
- metadata +3 -7
- data/README.md +0 -33
- data/Rakefile +0 -10
- data/Steepfile +0 -29
- data/sig/vimpk.rbs +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb0dfb2236f49356b5b50889c8f063c70952ba85fce011400943acc449ca8c5
|
4
|
+
data.tar.gz: 513194b7c2e2bc8b3a3c48393addf328f10834f53568721673484fcd9569343c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c7c9684d5d750c00f31f314d0fe80f3f1cfa6bfa9bcfb135ea39880bd1b2b9ffba8d790550ca563ba74290992f47c77e9b23c20838e82bab21c712a416e95e
|
7
|
+
data.tar.gz: c56b63a7ad96710c7b6fc76a71ba69db43b99d4cba37b12c8a5f60c98dbe9e227556b1a97e6cefa194b29ce8482ea69ec815b3c29a67bcedcbf83b4c688b304a
|
data/lib/vimpk/cli.rb
CHANGED
@@ -4,25 +4,31 @@ module VimPK
|
|
4
4
|
class CLI
|
5
5
|
include Colorizer
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
@
|
7
|
+
attr_reader :command
|
8
|
+
|
9
|
+
def initialize(argv)
|
10
|
+
@argv = argv
|
11
|
+
@parser = Options.new(argv)
|
12
|
+
@options = @parser.parse
|
11
13
|
@command = determine_command
|
14
|
+
rescue OptionParser::MissingArgument, OptionParser::InvalidOption => e
|
15
|
+
puts e.message
|
16
|
+
abort("Use --help for usage information")
|
12
17
|
end
|
13
18
|
|
14
19
|
def call
|
15
20
|
if @command
|
16
|
-
send(@command, *@
|
21
|
+
send(@command, *@argv)
|
17
22
|
else
|
18
23
|
puts @parser.parser
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
22
27
|
def determine_command
|
23
|
-
return nil if @
|
28
|
+
return nil if @argv.empty?
|
24
29
|
|
25
|
-
|
30
|
+
name = @argv.shift&.downcase
|
31
|
+
case name
|
26
32
|
when "i", "install"
|
27
33
|
:install_command
|
28
34
|
when "u", "update"
|
@@ -30,7 +36,7 @@ module VimPK
|
|
30
36
|
when "rm", "remove"
|
31
37
|
:remove_command
|
32
38
|
else
|
33
|
-
raise "Unknown command: #{name}"
|
39
|
+
raise ArgumentError, "Unknown command: #{name}"
|
34
40
|
end
|
35
41
|
end
|
36
42
|
|
data/lib/vimpk/options.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "optparse"
|
2
4
|
|
3
5
|
module VimPK
|
@@ -5,13 +7,15 @@ module VimPK
|
|
5
7
|
attr_reader :options, :parser
|
6
8
|
|
7
9
|
DEFAULT_PATH = File.expand_path("~/.vim/pack").freeze
|
8
|
-
DEFAULT_TYPE = "start"
|
9
|
-
DEFAULT_PACK = "plugins"
|
10
|
+
DEFAULT_TYPE = "start"
|
11
|
+
DEFAULT_PACK = "plugins"
|
10
12
|
|
11
13
|
DefaultOptions = Struct.new(:path, :pack, :type)
|
12
14
|
|
13
|
-
def initialize(
|
15
|
+
def initialize(argv)
|
16
|
+
@argv = argv
|
14
17
|
@options = DefaultOptions.new(DEFAULT_PATH, DEFAULT_PACK, DEFAULT_TYPE)
|
18
|
+
|
15
19
|
@parser = OptionParser.new do |parser|
|
16
20
|
parser.banner = "Usage: #{parser.program_name} [options] [command [options]"
|
17
21
|
parser.separator ""
|
@@ -52,14 +56,12 @@ module VimPK
|
|
52
56
|
parser.separator " i|install REPO/NAME [--opt|--start] [--pack=PATH] [--path=PATH] Install a package"
|
53
57
|
parser.separator " u|update Update all packages"
|
54
58
|
parser.separator " rm|remove NAME Remove all occurrences of a package"
|
55
|
-
|
56
|
-
begin
|
57
|
-
parser.permute!(args)
|
58
|
-
rescue OptionParser::MissingArgument, OptionParser::InvalidOption => e
|
59
|
-
puts e.message
|
60
|
-
abort("Use --help for usage information")
|
61
|
-
end
|
62
59
|
end
|
63
60
|
end
|
61
|
+
|
62
|
+
def parse
|
63
|
+
@parser.permute!(@argv)
|
64
|
+
@options
|
65
|
+
end
|
64
66
|
end
|
65
67
|
end
|
data/lib/vimpk/version.rb
CHANGED
data/lib/vimpk.rb
CHANGED
@@ -12,11 +12,11 @@ module VimPK
|
|
12
12
|
|
13
13
|
autoload :CLI, "vimpk/cli"
|
14
14
|
autoload :Colorizer, "vimpk/colorizer"
|
15
|
-
autoload :Remove, "vimpk/remove"
|
16
15
|
autoload :Git, "vimpk/git"
|
17
16
|
autoload :Install, "vimpk/install"
|
18
17
|
autoload :Job, "vimpk/job"
|
19
18
|
autoload :Options, "vimpk/options"
|
19
|
+
autoload :Remove, "vimpk/remove"
|
20
20
|
autoload :ThreadPool, "vimpk/thread_pool"
|
21
21
|
autoload :Update, "vimpk/update"
|
22
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimpk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Usewicz
|
@@ -19,9 +19,6 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- LICENSE.txt
|
22
|
-
- README.md
|
23
|
-
- Rakefile
|
24
|
-
- Steepfile
|
25
22
|
- exe/vimpk
|
26
23
|
- lib/vimpk.rb
|
27
24
|
- lib/vimpk/cli.rb
|
@@ -34,7 +31,6 @@ files:
|
|
34
31
|
- lib/vimpk/thread_pool.rb
|
35
32
|
- lib/vimpk/update.rb
|
36
33
|
- lib/vimpk/version.rb
|
37
|
-
- sig/vimpk.rbs
|
38
34
|
homepage: https://github.com/pusewicz/vimpk
|
39
35
|
licenses:
|
40
36
|
- MIT
|
@@ -43,7 +39,7 @@ metadata:
|
|
43
39
|
homepage_uri: https://github.com/pusewicz/vimpk
|
44
40
|
source_code_uri: https://github.com/pusewicz/vimpk
|
45
41
|
changelog_uri: https://github.com/pusewicz/vimpk/blob/main/CHANGELOG.md
|
46
|
-
github_repo:
|
42
|
+
github_repo: https://github.com/pusewicz/vimpk.git
|
47
43
|
post_install_message:
|
48
44
|
rdoc_options: []
|
49
45
|
require_paths:
|
@@ -52,7 +48,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
48
|
requirements:
|
53
49
|
- - ">="
|
54
50
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
51
|
+
version: 2.6.0
|
56
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
53
|
requirements:
|
58
54
|
- - ">="
|
data/README.md
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# VimPK
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vimpk`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Install the gem by executing:
|
8
|
-
|
9
|
-
$ gem install vimpk
|
10
|
-
|
11
|
-
## Usage
|
12
|
-
|
13
|
-
To use the gem, you can run the following command:
|
14
|
-
|
15
|
-
$ vimpk
|
16
|
-
|
17
|
-
## Development
|
18
|
-
|
19
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
20
|
-
|
21
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/pusewicz/vimpk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/pusewicz/vimpk/blob/main/CODE_OF_CONDUCT.md).
|
26
|
-
|
27
|
-
## License
|
28
|
-
|
29
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
30
|
-
|
31
|
-
## Code of Conduct
|
32
|
-
|
33
|
-
Everyone interacting in the Vimpk project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pusewicz/vimpk/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
DELETED
data/Steepfile
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# D = Steep::Diagnostic
|
2
|
-
#
|
3
|
-
# target :lib do
|
4
|
-
# signature "sig"
|
5
|
-
#
|
6
|
-
# check "lib" # Directory name
|
7
|
-
# check "Gemfile" # File name
|
8
|
-
# check "app/models/**/*.rb" # Glob
|
9
|
-
# # ignore "lib/templates/*.rb"
|
10
|
-
#
|
11
|
-
# # library "pathname" # Standard libraries
|
12
|
-
# # library "strong_json" # Gems
|
13
|
-
#
|
14
|
-
# # configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
|
15
|
-
# # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting
|
16
|
-
# # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting
|
17
|
-
# # configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting
|
18
|
-
# # configure_code_diagnostics do |hash| # You can setup everything yourself
|
19
|
-
# # hash[D::Ruby::NoMethod] = :information
|
20
|
-
# # end
|
21
|
-
# end
|
22
|
-
|
23
|
-
# target :test do
|
24
|
-
# signature "sig", "sig-private"
|
25
|
-
#
|
26
|
-
# check "test"
|
27
|
-
#
|
28
|
-
# # library "pathname" # Standard libraries
|
29
|
-
# end
|
data/sig/vimpk.rbs
DELETED