nvvm 0.1.1
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 +7 -0
- data/.coveralls.yml +1 -0
- data/.document +5 -0
- data/.rspec +4 -0
- data/.rubocop.yml +27 -0
- data/.travis.yml +12 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +123 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +66 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/bin/nvvm +13 -0
- data/etc/login +18 -0
- data/lib/nvvm.rb +10 -0
- data/lib/nvvm/accessor.rb +29 -0
- data/lib/nvvm/cli.rb +74 -0
- data/lib/nvvm/constants.rb +3 -0
- data/lib/nvvm/ext/mkmf.rb +8 -0
- data/lib/nvvm/installer.rb +77 -0
- data/lib/nvvm/switcher.rb +18 -0
- data/lib/nvvm/uninstaller.rb +23 -0
- data/lib/nvvm/validator.rb +64 -0
- data/lib/nvvm/version.rb +44 -0
- data/nvvm.gemspec +91 -0
- data/spec/accessor_spec.rb +32 -0
- data/spec/installer_spec.rb +136 -0
- data/spec/spec_helper.rb +77 -0
- data/spec/switcher_spec.rb +42 -0
- data/spec/uninstaller_spec.rb +33 -0
- data/spec/validator_spec.rb +292 -0
- data/spec/version_spec.rb +93 -0
- metadata +175 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 66b82b86fe0ac4caa55dc17096a6d7671fddc096
|
4
|
+
data.tar.gz: 9db129185e595b58a306cdca4c454341c5d82164
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a0fc8f0a73f451a1e4ba1a2b4baf3c9733fe8364814455960010936f3dff4b5d94e4c98edf237221b0a3e6d30d4b87e43969eee6b7b84c095615274a4c6fe7b0
|
7
|
+
data.tar.gz: 2cfea0b69c42c8dbe21ad9aefac184ef361eb39001f7f3d487855104bb7041a312966d804964352b62ad0ae6035ac96454dd3006022c2b2856fdd5e9a7512948
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.document
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- .bundle/**/*
|
4
|
+
- .git/**/*
|
5
|
+
- .nvvm_cache/**/*
|
6
|
+
- coverage/**/*
|
7
|
+
- etc/**/*
|
8
|
+
- pkg/**/*
|
9
|
+
- vendor/**/*
|
10
|
+
- Rakefile
|
11
|
+
- nvvm.gemspec
|
12
|
+
LineLength:
|
13
|
+
Max: 90
|
14
|
+
Documentation:
|
15
|
+
Enabled: false
|
16
|
+
SpecialGlobalVars:
|
17
|
+
Enabled: false
|
18
|
+
AssignmentInCondition:
|
19
|
+
Enabled: false
|
20
|
+
Style/FrozenStringLiteralComment:
|
21
|
+
Enabled: false
|
22
|
+
Metrics/BlockLength:
|
23
|
+
Exclude:
|
24
|
+
- 'spec/**/*'
|
25
|
+
Style/MixinUsage:
|
26
|
+
Exclude:
|
27
|
+
- 'lib/nvvm.rb'
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
|
+
|
7
|
+
gem 'thor', '~> 0.20.0'
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem 'coveralls', '~> 0.7.1', require: false
|
11
|
+
gem 'jeweler', '~> 2.0'
|
12
|
+
gem 'rdoc', '~> 6.0'
|
13
|
+
gem 'rspec', '~> 3.0'
|
14
|
+
gem 'rubocop', '~> 0.52.0'
|
15
|
+
gem 'simplecov', '~> 0.15.1'
|
16
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.4.0)
|
5
|
+
ast (2.3.0)
|
6
|
+
builder (3.2.3)
|
7
|
+
coveralls (0.7.1)
|
8
|
+
multi_json (~> 1.3)
|
9
|
+
rest-client
|
10
|
+
simplecov (>= 0.7)
|
11
|
+
term-ansicolor
|
12
|
+
thor
|
13
|
+
descendants_tracker (0.0.4)
|
14
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
docile (1.1.5)
|
17
|
+
domain_name (0.5.20170404)
|
18
|
+
unf (>= 0.0.5, < 1.0.0)
|
19
|
+
faraday (0.9.2)
|
20
|
+
multipart-post (>= 1.2, < 3)
|
21
|
+
git (1.3.0)
|
22
|
+
github_api (0.16.0)
|
23
|
+
addressable (~> 2.4.0)
|
24
|
+
descendants_tracker (~> 0.0.4)
|
25
|
+
faraday (~> 0.8, < 0.10)
|
26
|
+
hashie (>= 3.4)
|
27
|
+
mime-types (>= 1.16, < 3.0)
|
28
|
+
oauth2 (~> 1.0)
|
29
|
+
hashie (3.5.7)
|
30
|
+
highline (1.7.10)
|
31
|
+
http-cookie (1.0.3)
|
32
|
+
domain_name (~> 0.5)
|
33
|
+
jeweler (2.3.7)
|
34
|
+
builder
|
35
|
+
bundler (>= 1)
|
36
|
+
git (>= 1.2.5)
|
37
|
+
github_api (~> 0.16.0)
|
38
|
+
highline (>= 1.6.15)
|
39
|
+
nokogiri (>= 1.5.10)
|
40
|
+
psych (~> 2.2)
|
41
|
+
rake
|
42
|
+
rdoc
|
43
|
+
semver2
|
44
|
+
json (2.1.0)
|
45
|
+
jwt (1.5.6)
|
46
|
+
mime-types (2.99.3)
|
47
|
+
mini_portile2 (2.3.0)
|
48
|
+
multi_json (1.12.2)
|
49
|
+
multi_xml (0.6.0)
|
50
|
+
multipart-post (2.0.0)
|
51
|
+
netrc (0.11.0)
|
52
|
+
nokogiri (1.8.1)
|
53
|
+
mini_portile2 (~> 2.3.0)
|
54
|
+
oauth2 (1.4.0)
|
55
|
+
faraday (>= 0.8, < 0.13)
|
56
|
+
jwt (~> 1.0)
|
57
|
+
multi_json (~> 1.3)
|
58
|
+
multi_xml (~> 0.5)
|
59
|
+
rack (>= 1.2, < 3)
|
60
|
+
parallel (1.12.1)
|
61
|
+
parser (2.4.0.2)
|
62
|
+
ast (~> 2.3)
|
63
|
+
powerpack (0.1.1)
|
64
|
+
psych (2.2.4)
|
65
|
+
rack (2.0.3)
|
66
|
+
rainbow (3.0.0)
|
67
|
+
rake (12.3.0)
|
68
|
+
rdoc (6.0.1)
|
69
|
+
rest-client (2.0.2)
|
70
|
+
http-cookie (>= 1.0.2, < 2.0)
|
71
|
+
mime-types (>= 1.16, < 4.0)
|
72
|
+
netrc (~> 0.8)
|
73
|
+
rspec (3.7.0)
|
74
|
+
rspec-core (~> 3.7.0)
|
75
|
+
rspec-expectations (~> 3.7.0)
|
76
|
+
rspec-mocks (~> 3.7.0)
|
77
|
+
rspec-core (3.7.0)
|
78
|
+
rspec-support (~> 3.7.0)
|
79
|
+
rspec-expectations (3.7.0)
|
80
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
+
rspec-support (~> 3.7.0)
|
82
|
+
rspec-mocks (3.7.0)
|
83
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
84
|
+
rspec-support (~> 3.7.0)
|
85
|
+
rspec-support (3.7.0)
|
86
|
+
rubocop (0.52.0)
|
87
|
+
parallel (~> 1.10)
|
88
|
+
parser (>= 2.4.0.2, < 3.0)
|
89
|
+
powerpack (~> 0.1)
|
90
|
+
rainbow (>= 2.2.2, < 4.0)
|
91
|
+
ruby-progressbar (~> 1.7)
|
92
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
93
|
+
ruby-progressbar (1.9.0)
|
94
|
+
semver2 (3.4.2)
|
95
|
+
simplecov (0.15.1)
|
96
|
+
docile (~> 1.1.0)
|
97
|
+
json (>= 1.8, < 3)
|
98
|
+
simplecov-html (~> 0.10.0)
|
99
|
+
simplecov-html (0.10.2)
|
100
|
+
term-ansicolor (1.6.0)
|
101
|
+
tins (~> 1.0)
|
102
|
+
thor (0.20.0)
|
103
|
+
thread_safe (0.3.6)
|
104
|
+
tins (1.16.3)
|
105
|
+
unf (0.1.4)
|
106
|
+
unf_ext
|
107
|
+
unf_ext (0.0.7.4)
|
108
|
+
unicode-display_width (1.3.0)
|
109
|
+
|
110
|
+
PLATFORMS
|
111
|
+
ruby
|
112
|
+
|
113
|
+
DEPENDENCIES
|
114
|
+
coveralls (~> 0.7.1)
|
115
|
+
jeweler (~> 2.0)
|
116
|
+
rdoc (~> 6.0)
|
117
|
+
rspec (~> 3.0)
|
118
|
+
rubocop (~> 0.52.0)
|
119
|
+
simplecov (~> 0.15.1)
|
120
|
+
thor (~> 0.20.0)
|
121
|
+
|
122
|
+
BUNDLED WITH
|
123
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2017 YuuShigetani
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
= nvvm
|
2
|
+
|
3
|
+
Neovim version manager : forked from https://github.com/calorie/vvm-rb
|
4
|
+
|
5
|
+
== Requirements
|
6
|
+
|
7
|
+
ruby >= 1.9
|
8
|
+
|
9
|
+
== Install
|
10
|
+
|
11
|
+
$ gem install nvvm
|
12
|
+
|
13
|
+
or
|
14
|
+
|
15
|
+
$ git clone https://github.com/calorie/nvvm.git
|
16
|
+
$ cd nvvm
|
17
|
+
$ bundle install
|
18
|
+
$ rake install
|
19
|
+
|
20
|
+
== Setup
|
21
|
+
please add the following line into your ~/.bash_login etc:
|
22
|
+
|
23
|
+
test -f ~/.nvvm/etc/login && source ~/.nvvm/etc/login
|
24
|
+
|
25
|
+
you can set own root:
|
26
|
+
|
27
|
+
export NVVMROOT=/your/nvvm/root/path
|
28
|
+
test -f $NVVMROOT/etc/login && source $NVVMROOT/etc/login
|
29
|
+
|
30
|
+
== Usage
|
31
|
+
|
32
|
+
$ nvvm help
|
33
|
+
$ nvvm install 0.2.2
|
34
|
+
$ nvvm install --use latest
|
35
|
+
$ nvvm reinstall 0.2.2
|
36
|
+
$ nvvm rebuild 0.2.2
|
37
|
+
$ nvvm use 0.2.2
|
38
|
+
$ nvvm list
|
39
|
+
$ nvvm versions
|
40
|
+
$ nvvm uninstall 0.2.2
|
41
|
+
$ nvvm update
|
42
|
+
|
43
|
+
after `nvvm use`, you have to reload shell:
|
44
|
+
|
45
|
+
$ exec $SHELL
|
46
|
+
|
47
|
+
== Uninstall
|
48
|
+
|
49
|
+
$ gem uninstall nvvm
|
50
|
+
$ rm -rf ~/.nvvm
|
51
|
+
|
52
|
+
== Contributing to nvvm
|
53
|
+
|
54
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
55
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
56
|
+
* Fork the project.
|
57
|
+
* Start a feature/bugfix branch.
|
58
|
+
* Commit and push until you are happy with your contribution.
|
59
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
60
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
61
|
+
|
62
|
+
== Copyright
|
63
|
+
|
64
|
+
Copyright (c) 2017 YuuShigetani. See LICENSE.txt for
|
65
|
+
further details.
|
66
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = "nvvm"
|
18
|
+
gem.homepage = "http://github.com/calorie/nvvm"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Neovim version manager}
|
21
|
+
gem.description = %Q{Neovim version manager.}
|
22
|
+
gem.email = "s2g4t1n2@gmail.com"
|
23
|
+
gem.authors = ["YuuShigetani"]
|
24
|
+
gem.required_ruby_version = '>= 1.9'
|
25
|
+
# dependencies defined in Gemfile
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rspec/core'
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Code coverage detail"
|
36
|
+
task :simplecov do
|
37
|
+
ENV['COVERAGE'] = "true"
|
38
|
+
Rake::Task['spec'].execute
|
39
|
+
end
|
40
|
+
|
41
|
+
task :default => :spec
|
42
|
+
|
43
|
+
require 'rdoc/task'
|
44
|
+
Rake::RDocTask.new do |rdoc|
|
45
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
46
|
+
|
47
|
+
rdoc.rdoc_dir = 'rdoc'
|
48
|
+
rdoc.title = "nvvm #{version}"
|
49
|
+
rdoc.rdoc_files.include('README*')
|
50
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
51
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.1
|
data/bin/nvvm
ADDED
data/etc/login
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
__nvvm_path_remove ()
|
4
|
+
{
|
5
|
+
export PATH=`echo -n $PATH | awk -v RS=: -v ORS=: '$0 != "'$1'"' | sed 's/:$//'`;
|
6
|
+
}
|
7
|
+
__nvvm_configure_path()
|
8
|
+
{
|
9
|
+
local nvvm_root_path="$HOME/.nvvm"
|
10
|
+
[ -z $NVVMROOT ] || nvvm_root_path=$NVVMROOT
|
11
|
+
local nvvm_bin_path="$nvvm_root_path/src/current/build/bin"
|
12
|
+
__nvvm_path_remove $nvvm_bin_path
|
13
|
+
export PATH="$nvvm_bin_path:$PATH"
|
14
|
+
}
|
15
|
+
|
16
|
+
__nvvm_configure_path
|
17
|
+
|
18
|
+
# __END__
|
data/lib/nvvm.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require_relative 'nvvm/ext/mkmf'
|
2
|
+
require_relative 'nvvm/constants'
|
3
|
+
require_relative 'nvvm/installer'
|
4
|
+
require_relative 'nvvm/uninstaller'
|
5
|
+
require_relative 'nvvm/switcher'
|
6
|
+
require_relative 'nvvm/validator'
|
7
|
+
require_relative 'nvvm/accessor'
|
8
|
+
require_relative 'nvvm/version'
|
9
|
+
|
10
|
+
include Nvvm::Accessor
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Nvvm
|
2
|
+
module Accessor
|
3
|
+
module_function
|
4
|
+
|
5
|
+
def dot_dir
|
6
|
+
File.expand_path(ENV['NVVMROOT'] || '~/.nvvm')
|
7
|
+
end
|
8
|
+
|
9
|
+
def etc_dir
|
10
|
+
File.join(dot_dir, 'etc')
|
11
|
+
end
|
12
|
+
|
13
|
+
def repo_dir
|
14
|
+
File.join(dot_dir, 'repo')
|
15
|
+
end
|
16
|
+
|
17
|
+
def src_dir(version = '')
|
18
|
+
File.join(dot_dir, 'src', version)
|
19
|
+
end
|
20
|
+
|
21
|
+
def login_file
|
22
|
+
File.join(etc_dir, 'login')
|
23
|
+
end
|
24
|
+
|
25
|
+
def current_dir
|
26
|
+
File.join(src_dir, 'current')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/nvvm/cli.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module Nvvm
|
4
|
+
class Cli < Thor
|
5
|
+
include Thor::Actions
|
6
|
+
include Validator
|
7
|
+
|
8
|
+
desc 'install [VERSION]', 'Install a specific version of Neovim'
|
9
|
+
method_option :use, type: :boolean, aliases: '-u', banner: 'Use installed Neovim'
|
10
|
+
def install(version, *conf)
|
11
|
+
installer = Installer.new(Version.format(version), conf)
|
12
|
+
installer.checkout
|
13
|
+
installer.make_install
|
14
|
+
Installer.cp_etc
|
15
|
+
invoke :use, [version], {} if options[:use]
|
16
|
+
installer.message
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'update', 'Update to latest version of Neovim'
|
20
|
+
def update
|
21
|
+
Installer.pull
|
22
|
+
if (current = Version.current) == 'system'
|
23
|
+
run 'nvvm install --use latest'
|
24
|
+
run 'nvvm use system' unless $?.success?
|
25
|
+
else
|
26
|
+
run 'nvvm use system'
|
27
|
+
run 'nvvm install --use latest'
|
28
|
+
action = $?.success? ? 'uninstall' : 'use'
|
29
|
+
run "nvvm #{action} #{current}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'reinstall [VERSION]', 'Reinstall a specific version'
|
34
|
+
def reinstall(version, *conf)
|
35
|
+
invoke :uninstall, [version]
|
36
|
+
invoke :install, [version, *conf]
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'rebuild [VERSION]', 'Rebuild a specific version of Neovim'
|
40
|
+
def rebuild(version, *conf)
|
41
|
+
installer = Installer.new(Version.format(version), conf)
|
42
|
+
installer.make_clean
|
43
|
+
installer.make_install
|
44
|
+
end
|
45
|
+
|
46
|
+
desc 'use [VERSION]', 'Use a specific version of Noevim as the default one.'
|
47
|
+
def use(version)
|
48
|
+
Switcher.new(Version.format(version)).use
|
49
|
+
end
|
50
|
+
|
51
|
+
desc 'list', 'Look available versions of Neovim.'
|
52
|
+
def list
|
53
|
+
Installer.pull
|
54
|
+
puts Version.list.join("\n")
|
55
|
+
end
|
56
|
+
|
57
|
+
desc 'versions', 'Look installed versions of Neovim.'
|
58
|
+
def versions
|
59
|
+
puts Version.versions.join("\n")
|
60
|
+
end
|
61
|
+
|
62
|
+
desc 'uninstall [VERSION]', 'Uninstall a specific version of Neovim.'
|
63
|
+
def uninstall(version)
|
64
|
+
Uninstaller.new(Version.format(version)).uninstall
|
65
|
+
end
|
66
|
+
|
67
|
+
no_commands do
|
68
|
+
def invoke_command(command, *args)
|
69
|
+
validate_before_invoke(command.name)
|
70
|
+
super
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|