vvm-rb 0.0.9 → 0.0.10
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/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/vvm-rb/cli.rb +5 -5
- data/lib/vvm-rb/validator.rb +12 -12
- data/spec/validator_spec.rb +2 -2
- data/vvm-rb.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1150e5f700dc9ab2a34f1533a1757e9a6f5bde16
|
4
|
+
data.tar.gz: 3c59a21e6cde3e77242ec17e846f6b8cab042083
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cef6cb5f351d2270fca2c2240c9fd2c73b123909ddbe7ac71224bcd2872015497f3a280f4190b72bea80cdc6f8585c3951ff3e06de46def6cd87cd7815a1d80
|
7
|
+
data.tar.gz: 49a48476f1cf842509c8f497fd632ec9aca5537c93f4d6a751c3442bc519302a50b2788fbdbf6a6cdcdb89c8cc55070cfba388bde1c50e95e4bf3421b9840820
|
data/README.rdoc
CHANGED
@@ -18,7 +18,6 @@ or
|
|
18
18
|
$ git clone https://github.com/calorie/vvm-rb.git
|
19
19
|
$ cd vvm-rb
|
20
20
|
$ bundle install --path vendor/bundle
|
21
|
-
$ bundle exec rake build
|
22
21
|
$ bundle exec rake install
|
23
22
|
|
24
23
|
== Usage
|
@@ -40,6 +39,7 @@ you can set your default options of configure.
|
|
40
39
|
$ vvm-rb help
|
41
40
|
$ vvm-rb install v7-4 --enable-rubyinterp
|
42
41
|
$ vvm-rb install v7-4-035
|
42
|
+
$ vvm-rb install latest
|
43
43
|
$ vvm-rb reinstall v7-4
|
44
44
|
$ vvm-rb rebuild v7-4 --enable-rubyinterp --enable-pythoninterp
|
45
45
|
$ vvm-rb use v7-4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/lib/vvm-rb/cli.rb
CHANGED
@@ -5,8 +5,10 @@ class Cli < Thor
|
|
5
5
|
include VvmRb::Base
|
6
6
|
|
7
7
|
desc 'install [TAG] [options]', 'Install a specific version of Vim'
|
8
|
+
method_option :use, :type => :boolean, :aliases => '-u'
|
8
9
|
def install(version, *conf)
|
9
10
|
installer(version, conf)
|
11
|
+
use(version) if options[:use]
|
10
12
|
|
11
13
|
print "\e[32m"
|
12
14
|
puts <<-EOS
|
@@ -54,10 +56,8 @@ test -f ~/.vvm-rb/etc/login && source ~/.vvm-rb/etc/login
|
|
54
56
|
|
55
57
|
before_method(:install, :reinstall, :rebuild, :list) { check_hg }
|
56
58
|
before_method(:install, :reinstall, :rebuild, :use, :uninstall) { check_tag }
|
57
|
-
before_method(:install) { new_version?
|
58
|
-
before_method(:reinstall, :rebuild, :use, :uninstall)
|
59
|
-
version_exist?(Version.versions)
|
60
|
-
end
|
59
|
+
before_method(:install) { new_version? }
|
60
|
+
before_method(:reinstall, :rebuild, :use, :uninstall) { version_exist? }
|
61
61
|
|
62
62
|
private
|
63
63
|
|
@@ -65,7 +65,7 @@ test -f ~/.vvm-rb/etc/login && source ~/.vvm-rb/etc/login
|
|
65
65
|
Installer.fetch
|
66
66
|
if version == 'latest'
|
67
67
|
version = Version.list.select { |v| v =~ /^v7-.+$/ }.last
|
68
|
-
new_version?(
|
68
|
+
new_version?(version)
|
69
69
|
end
|
70
70
|
i = Installer.new(version, conf)
|
71
71
|
i.checkout
|
data/lib/vvm-rb/validator.rb
CHANGED
@@ -8,30 +8,30 @@ module Validator
|
|
8
8
|
return true
|
9
9
|
end
|
10
10
|
|
11
|
-
def check_tag
|
12
|
-
unless
|
11
|
+
def check_tag
|
12
|
+
unless get_version
|
13
13
|
abort 'undefined vim version. please run [ vvm-rb list ].'
|
14
14
|
end
|
15
15
|
return true
|
16
16
|
end
|
17
17
|
|
18
|
-
def new_version?(
|
19
|
-
if version_include?(
|
20
|
-
abort "#{version} is already installed."
|
21
|
-
end
|
18
|
+
def new_version?(version = get_version)
|
19
|
+
abort "#{version} is already installed." if version_include?(version)
|
22
20
|
return true
|
23
21
|
end
|
24
22
|
|
25
|
-
def version_exist?(
|
26
|
-
unless version_include?(
|
27
|
-
abort "#{version} is not installed."
|
28
|
-
end
|
23
|
+
def version_exist?(version = get_version)
|
24
|
+
abort "#{version} is not installed." unless version_include?(version)
|
29
25
|
return true
|
30
26
|
end
|
31
27
|
|
32
28
|
private
|
33
29
|
|
34
|
-
def
|
35
|
-
return
|
30
|
+
def get_version
|
31
|
+
return $*.find { |v| v =~ /(^start$|^tip$|^v7-.+$|^system$|^latest$)/ }
|
32
|
+
end
|
33
|
+
|
34
|
+
def version_include?(version)
|
35
|
+
return Version.versions.include?(version)
|
36
36
|
end
|
37
37
|
end
|
data/spec/validator_spec.rb
CHANGED
@@ -51,7 +51,7 @@ describe 'Validator' do
|
|
51
51
|
|
52
52
|
describe 'new_version?' do
|
53
53
|
def dummy_method ; end
|
54
|
-
before_method(:dummy_method) { new_version?
|
54
|
+
before_method(:dummy_method) { new_version? }
|
55
55
|
|
56
56
|
context 'new version' do
|
57
57
|
before { $*[1] = 'v7-4-050' }
|
@@ -72,7 +72,7 @@ describe 'Validator' do
|
|
72
72
|
|
73
73
|
describe 'version_exist?' do
|
74
74
|
def dummy_method ; end
|
75
|
-
before_method(:dummy_method) { version_exist?
|
75
|
+
before_method(:dummy_method) { version_exist? }
|
76
76
|
|
77
77
|
context 'version is installed' do
|
78
78
|
before { $*[1] = 'v7-4-103' }
|
data/vvm-rb.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: vvm-rb 0.0.
|
5
|
+
# stub: vvm-rb 0.0.10 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "vvm-rb"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.10"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Yuu Shigetani"]
|
13
|
-
s.date = "2013-
|
13
|
+
s.date = "2013-12-07"
|
14
14
|
s.description = "vim version manager."
|
15
15
|
s.email = "s2g4t1n2@gmail.com"
|
16
16
|
s.executables = ["vvm-rb"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vvm-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuu Shigetani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|