vvm-rb 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80ebe5ef4e32f2933efe5727f345798146602003
4
- data.tar.gz: bf5d4af88468594a2f9efb52c195ee07c1e96340
3
+ metadata.gz: 73e14a90f5be3f1bf0a37ddd611a6c639d0d13c2
4
+ data.tar.gz: 15cff45395ac493061e1ddbe63e5109a20bf9e72
5
5
  SHA512:
6
- metadata.gz: 39f33e0a8caec985a264bd290072ebae78962fbf2985570a88c5e2aea1470036813ee1ad864fa835116dba48bb7d783849b6a5076abe5ae07017c54a77a7c869
7
- data.tar.gz: 78bba39052f745552cdf662fe8a71fe024f00b88f0e70d526bdc335b3dafa8d83ef99d5a6e01544791a1684511d75f23a546c6b7c816aaf1f4f1546f7ea80fe7
6
+ metadata.gz: ff9d9bf9b3d1296a636764b9a8485e156e36a4e0ba2079523741436a883e0614c43ad03c7c4c29304702aab5242a78e1b08ac6d9850d5c8cec3ffdcc2e3c3dd8
7
+ data.tar.gz: 8ca000a8edc886b54ccec1cf9917f6de1f81d5966d1ab7799065af40e7bdbf82e5480ca0de2d7fe0c42b06b9f9e980dd001682c0dc5291a13e713495ef3dff0d
data/README.rdoc CHANGED
@@ -45,6 +45,7 @@ you can set your default options of configure.
45
45
  $ vvm-rb list
46
46
  $ vvm-rb versions
47
47
  $ vvm-rb uninstall 7.4.103
48
+ $ vvm-rb update
48
49
 
49
50
  after use command, you have to reload shell.
50
51
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
data/lib/vvm-rb/cli.rb CHANGED
@@ -20,10 +20,15 @@ class Cli < Thor
20
20
 
21
21
  desc 'update', 'Update to latest version of Vim'
22
22
  def update
23
- current = Version.versions.last
24
- run 'vvm-rb use system'
25
- run 'vvm-rb install --use latest'
26
- run "vvm-rb #{$?.success? ? 'uninstall' : 'use'} #{current}"
23
+ current = Version.current
24
+ if current == 'system'
25
+ run 'vvm-rb install --use latest'
26
+ run 'vvm-rb use system' unless $?.success?
27
+ else
28
+ run 'vvm-rb use system'
29
+ run 'vvm-rb install --use latest'
30
+ run "vvm-rb #{$?.success? ? 'uninstall' : 'use'} #{current}"
31
+ end
27
32
  end
28
33
 
29
34
  desc 'reinstall [VERSION] [CONFIGURE_OPTS]', 'Reinstall a specific version'
@@ -20,6 +20,11 @@ class Version
20
20
  return list.select { |v| v =~ /^v7-.+$/ }.last
21
21
  end
22
22
 
23
+ def self.current
24
+ c = get_current_dir
25
+ return File.exists?(c) ? File.basename(File.readlink(c)) : 'system'
26
+ end
27
+
23
28
  def self.convert(version)
24
29
  return "v#{version.gsub(/\./, '-')}"
25
30
  end
data/spec/version_spec.rb CHANGED
@@ -39,6 +39,22 @@ describe 'Version' do
39
39
  end
40
40
  end
41
41
 
42
+ describe 'current' do
43
+ context 'current version is system' do
44
+ before { Switcher.new('system').use }
45
+ it 'return current vim version' do
46
+ expect(Version.current).to eq 'system'
47
+ end
48
+ end
49
+
50
+ context 'current version is not system' do
51
+ before { Switcher.new('v7-4-083').use }
52
+ it 'return current vim version' do
53
+ expect(Version.current).to eq 'v7-4-083'
54
+ end
55
+ end
56
+ end
57
+
42
58
  describe 'convert' do
43
59
  it 'version to tag' do
44
60
  expect(Version.convert('7.4.112')).to eq 'v7-4-112'
data/vvm-rb.gemspec CHANGED
@@ -2,16 +2,16 @@
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.1.5 ruby lib
5
+ # stub: vvm-rb 0.1.6 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "vvm-rb"
9
- s.version = "0.1.5"
9
+ s.version = "0.1.6"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Yuu Shigetani"]
14
- s.date = "2014-01-18"
14
+ s.date = "2014-01-19"
15
15
  s.description = "vim version manager."
16
16
  s.email = "s2g4t1n2@gmail.com"
17
17
  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.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuu Shigetani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-18 00:00:00.000000000 Z
11
+ date: 2014-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake