evm 0.3.4 → 0.4.0

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
- ---
2
- SHA512:
3
- metadata.gz: 5c19e7ab6e93b6890668373889e4b95f8a770ad2fb9b1fe6d46c3e397fee76b4d866a5a5c873051f40fc2630c701142f890f1a69463c801cc1c3f3d2937e1622
4
- data.tar.gz: 70d68f0c0f4d0f8037b86b6e0f50967c48395998227a9677212ee9e697203e1ca50ef5676ece268964be38a0fc61e167441933e2efe09d8b6349bac2b72dd1d3
5
- SHA1:
6
- metadata.gz: 73e49dcdb060f4b283993c8aa3bcad6cb4c97128
7
- data.tar.gz: 0af6f5750c6045bbd6110e54fe98f09fab4b5898
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 85c1201baf8435e4ffb71e01e7b65ce7a26746c7
4
+ data.tar.gz: 28a30c595841d29dda1914b5f4403daeaad899e4
5
+ SHA512:
6
+ metadata.gz: 23ad9dc361c42c787a797ad4a1d4f82242bd2a08d110c1f8fc4d7056fb2c0e927e4ce3c74c9d8b195b23ef0ed860820ac6196e8996b199b60f6e31601ff91089
7
+ data.tar.gz: 1b5366dc367c7ffed7cc178c2f6cd98d7a6676c8c3655ab4bbe170331c39c4d24bc35b3c9b472ea87baec7b241053cfed73bf4e6d978fa09eb93aa7e6e6d7fd8
data/lib/evm/command.rb CHANGED
@@ -8,3 +8,4 @@ require 'evm/command/uninstall'
8
8
  require 'evm/command/use'
9
9
  require 'evm/command/list'
10
10
  require 'evm/command/bin'
11
+ require 'evm/command/help'
data/lib/evm/package.rb CHANGED
@@ -11,7 +11,7 @@ module Evm
11
11
  end
12
12
 
13
13
  def installed?
14
- File.exist?(path)
14
+ File.file?(bin) && File.executable?(bin)
15
15
  end
16
16
 
17
17
  def bin
@@ -23,8 +23,9 @@ module Evm
23
23
  end
24
24
 
25
25
  def use!
26
- File.open(Package.current_file, 'w') do |file|
27
- file.write(@name)
26
+ FileUtils.ln_sf(bin, Evm::EVM_EMACS_PATH)
27
+ unless File.symlink?(Evm::EMACS_PATH)
28
+ FileUtils.ln_sf(Evm::EVM_EMACS_PATH, Evm::EMACS_PATH)
28
29
  end
29
30
  end
30
31
 
@@ -46,7 +47,7 @@ module Evm
46
47
  end
47
48
 
48
49
  if current?
49
- File.delete(Package.current_file)
50
+ FileUtils.rm(Evm::EVM_EMACS_PATH)
50
51
  end
51
52
  end
52
53
 
@@ -67,13 +68,12 @@ module Evm
67
68
  end
68
69
 
69
70
  class << self
70
- def current_file
71
- File.join(Evm::LOCAL_PATH, 'current')
72
- end
73
-
74
71
  def current
75
- if File.exist?(current_file)
76
- find File.read(current_file)
72
+ if File.symlink?(Evm::EVM_EMACS_PATH)
73
+ current_bin_path = File.readlink(Evm::EVM_EMACS_PATH)
74
+ if (match = Regexp.new("#{Evm::LOCAL_PATH}/?(?<current>[^/]+)/.+").match(current_bin_path))
75
+ find match[:current]
76
+ end
77
77
  end
78
78
  end
79
79
 
data/lib/evm.rb CHANGED
@@ -3,6 +3,8 @@ require 'fileutils'
3
3
  module Evm
4
4
  ROOT_PATH = File.expand_path('..', File.dirname(__FILE__))
5
5
  LOCAL_PATH = File.join('/', 'usr', 'local', 'evm')
6
+ EMACS_PATH = File.join(ROOT_PATH, 'bin', 'emacs')
7
+ EVM_EMACS_PATH = File.join(ROOT_PATH, 'bin', 'evm-emacs')
6
8
 
7
9
  def self.abort(*args)
8
10
  STDERR.puts args.join(' ')
@@ -22,6 +24,7 @@ COMMANDS:
22
24
  bin [name] Show path to Emacs binary for package name
23
25
  list List all available packages
24
26
  use <name> Select name as current package
27
+ help Display this help message
25
28
 
26
29
  OPTIONS:
27
30
  --force Force install even when already installed
metadata CHANGED
@@ -1,27 +1,22 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: evm
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Johan Andersson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2013-12-08 00:00:00 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
13
12
  dependencies: []
14
-
15
- description: EVM is a command-line tool that allows you to install multiple Emacs versions.
13
+ description: EVM is a command-line tool that allows you to install multiple Emacs
14
+ versions.
16
15
  email: johan.rejeep@gmail.com
17
- executables:
18
- - evm
19
- - emacs
16
+ executables: []
20
17
  extensions: []
21
-
22
18
  extra_rdoc_files: []
23
-
24
- files:
19
+ files:
25
20
  - lib/evm.rb
26
21
  - lib/evm/builder.rb
27
22
  - lib/evm/cli.rb
@@ -49,33 +44,28 @@ files:
49
44
  - recipes/emacs-24.3-bin.rb
50
45
  - recipes/emacs-24.3.rb
51
46
  - recipes/emacs-git-snapshot.rb
52
- - bin/evm
53
- - bin/emacs
54
47
  homepage: http://github.com/rejeep/evm
55
- licenses:
48
+ licenses:
56
49
  - MIT
57
50
  metadata: {}
58
-
59
51
  post_install_message:
60
52
  rdoc_options: []
61
-
62
- require_paths:
53
+ require_paths:
63
54
  - lib
64
- required_ruby_version: !ruby/object:Gem::Requirement
65
- requirements:
66
- - &id001
67
- - ">="
68
- - !ruby/object:Gem::Version
69
- version: "0"
70
- required_rubygems_version: !ruby/object:Gem::Requirement
71
- requirements:
72
- - *id001
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
73
65
  requirements: []
74
-
75
66
  rubyforge_project:
76
- rubygems_version: 2.0.14
67
+ rubygems_version: 2.2.1
77
68
  signing_key:
78
69
  specification_version: 4
79
70
  summary: Emacs Version Manager
80
71
  test_files: []
81
-
data/bin/emacs DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
4
-
5
- require 'evm'
6
-
7
- if current = Evm::Package.current
8
- exec current.bin, *ARGV
9
- else
10
- abort 'EVM: No Emacs selected. Select one using "evm use".'
11
- end
data/bin/evm DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
4
-
5
- require 'evm'
6
-
7
- Evm::Cli.parse(ARGV)