evm 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/emacs +5 -2
- data/lib/evm/builder.rb +6 -6
- data/lib/evm/cli.rb +4 -4
- data/lib/evm/git.rb +3 -3
- data/lib/evm/package.rb +17 -15
- data/lib/evm/recipe.rb +2 -2
- data/lib/evm/remote_file.rb +1 -1
- data/lib/evm/system.rb +1 -1
- data/lib/evm/tar_file.rb +1 -1
- data/lib/evm.rb +7 -15
- data/recipes/emacs-23.4.rb +1 -1
- data/recipes/emacs-24.1.rb +1 -1
- data/recipes/emacs-24.2.rb +1 -1
- data/recipes/emacs-24.3.rb +1 -1
- data/recipes/emacs-git-snapshot.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA512:
|
3
|
-
|
4
|
-
|
3
|
+
metadata.gz: 5c19e7ab6e93b6890668373889e4b95f8a770ad2fb9b1fe6d46c3e397fee76b4d866a5a5c873051f40fc2630c701142f890f1a69463c801cc1c3f3d2937e1622
|
4
|
+
data.tar.gz: 70d68f0c0f4d0f8037b86b6e0f50967c48395998227a9677212ee9e697203e1ca50ef5676ece268964be38a0fc61e167441933e2efe09d8b6349bac2b72dd1d3
|
5
5
|
SHA1:
|
6
|
-
|
7
|
-
|
6
|
+
metadata.gz: 73e49dcdb060f4b283993c8aa3bcad6cb4c97128
|
7
|
+
data.tar.gz: 0af6f5750c6045bbd6110e54fe98f09fab4b5898
|
data/bin/emacs
CHANGED
@@ -4,5 +4,8 @@ $: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
4
4
|
|
5
5
|
require 'evm'
|
6
6
|
|
7
|
-
|
8
|
-
|
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/lib/evm/builder.rb
CHANGED
@@ -24,7 +24,7 @@ module Evm
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def tar_gz(url)
|
27
|
-
tar_file_path =
|
27
|
+
tar_file_path = File.join(builds_path, @name + '.tar.gz')
|
28
28
|
|
29
29
|
remote_file = Evm::RemoteFile.new(url)
|
30
30
|
remote_file.download(tar_file_path) do |progress|
|
@@ -66,19 +66,19 @@ module Evm
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def builds_path
|
69
|
-
|
69
|
+
File.join(Evm::LOCAL_PATH, 'tmp')
|
70
70
|
end
|
71
71
|
|
72
72
|
def build_path
|
73
|
-
|
73
|
+
File.join(builds_path, @name)
|
74
74
|
end
|
75
75
|
|
76
76
|
def installations_path
|
77
|
-
Evm
|
77
|
+
Evm::LOCAL_PATH
|
78
78
|
end
|
79
79
|
|
80
80
|
def installation_path
|
81
|
-
|
81
|
+
File.join(installations_path, @name)
|
82
82
|
end
|
83
83
|
|
84
84
|
def platform_name
|
@@ -98,7 +98,7 @@ module Evm
|
|
98
98
|
def run_command(command, *args)
|
99
99
|
Dir.chdir(build_path) do
|
100
100
|
system = Evm::System.new(command)
|
101
|
-
system.run(args)
|
101
|
+
system.run(*args)
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
data/lib/evm/cli.rb
CHANGED
@@ -12,7 +12,7 @@ module Evm
|
|
12
12
|
end
|
13
13
|
|
14
14
|
if argv.include?('--help') || argv.include?('-h')
|
15
|
-
Evm.
|
15
|
+
Evm.print_usage_and_exit
|
16
16
|
end
|
17
17
|
|
18
18
|
command, argument = argv
|
@@ -20,13 +20,13 @@ module Evm
|
|
20
20
|
begin
|
21
21
|
const = Evm::Command.const_get(command.capitalize)
|
22
22
|
rescue NameError => exception
|
23
|
-
Evm.
|
23
|
+
Evm.abort 'No such command:', command
|
24
24
|
end
|
25
25
|
|
26
26
|
begin
|
27
27
|
const.new(argument, options)
|
28
|
-
rescue => exception
|
29
|
-
Evm.
|
28
|
+
rescue Evm::Exception => exception
|
29
|
+
Evm.abort exception.message
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
data/lib/evm/git.rb
CHANGED
@@ -5,15 +5,15 @@ module Evm
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def exist?
|
8
|
-
|
8
|
+
File.exist?(@path)
|
9
9
|
end
|
10
10
|
|
11
11
|
def clone(url)
|
12
|
-
git 'clone', url, @path
|
12
|
+
git 'clone', url, @path
|
13
13
|
end
|
14
14
|
|
15
15
|
def pull
|
16
|
-
Dir.chdir(@path
|
16
|
+
Dir.chdir(@path) do
|
17
17
|
git 'pull'
|
18
18
|
end
|
19
19
|
end
|
data/lib/evm/package.rb
CHANGED
@@ -11,14 +11,14 @@ module Evm
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def installed?
|
14
|
-
|
14
|
+
File.exist?(path)
|
15
15
|
end
|
16
16
|
|
17
17
|
def bin
|
18
|
-
if Evm::Os.osx? &&
|
19
|
-
|
18
|
+
if Evm::Os.osx? && File.exist?(File.join(path, 'Emacs.app'))
|
19
|
+
File.join(path, 'Emacs.app', 'Contents', 'MacOS', 'Emacs')
|
20
20
|
else
|
21
|
-
|
21
|
+
File.join(path, 'bin', 'emacs')
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -29,22 +29,24 @@ module Evm
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def install!
|
32
|
-
unless
|
33
|
-
|
32
|
+
unless File.exist?(path)
|
33
|
+
Dir.mkdir(path)
|
34
34
|
end
|
35
35
|
|
36
|
-
unless
|
37
|
-
|
36
|
+
unless File.exist?(tmp_path)
|
37
|
+
Dir.mkdir(tmp_path)
|
38
38
|
end
|
39
39
|
|
40
40
|
Evm::Builder.new(recipe).build!
|
41
41
|
end
|
42
42
|
|
43
43
|
def uninstall!
|
44
|
-
|
44
|
+
if File.exist?(path)
|
45
|
+
FileUtils.rm_r(path)
|
46
|
+
end
|
45
47
|
|
46
48
|
if current?
|
47
|
-
Package.current_file
|
49
|
+
File.delete(Package.current_file)
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
@@ -57,21 +59,21 @@ module Evm
|
|
57
59
|
end
|
58
60
|
|
59
61
|
def path
|
60
|
-
|
62
|
+
File.join(Evm::LOCAL_PATH, @name)
|
61
63
|
end
|
62
64
|
|
63
65
|
def tmp_path
|
64
|
-
|
66
|
+
File.join(Evm::LOCAL_PATH, 'tmp')
|
65
67
|
end
|
66
68
|
|
67
69
|
class << self
|
68
70
|
def current_file
|
69
|
-
|
71
|
+
File.join(Evm::LOCAL_PATH, 'current')
|
70
72
|
end
|
71
73
|
|
72
74
|
def current
|
73
|
-
if
|
74
|
-
find(current_file
|
75
|
+
if File.exist?(current_file)
|
76
|
+
find File.read(current_file)
|
75
77
|
end
|
76
78
|
end
|
77
79
|
|
data/lib/evm/recipe.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Evm
|
2
2
|
class Recipe
|
3
|
-
|
3
|
+
RECIPES_PATH = File.join(Evm::ROOT_PATH, 'recipes')
|
4
4
|
|
5
5
|
attr_reader :name
|
6
6
|
|
@@ -31,7 +31,7 @@ module Evm
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def all
|
34
|
-
Dir.glob(
|
34
|
+
Dir.glob(File.join(RECIPES_PATH, '*.rb')).map do |recipe_file|
|
35
35
|
Recipe.new(recipe_file)
|
36
36
|
end
|
37
37
|
end
|
data/lib/evm/remote_file.rb
CHANGED
data/lib/evm/system.rb
CHANGED
data/lib/evm/tar_file.rb
CHANGED
data/lib/evm.rb
CHANGED
@@ -1,25 +1,17 @@
|
|
1
|
-
require '
|
1
|
+
require 'fileutils'
|
2
2
|
|
3
3
|
module Evm
|
4
|
-
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.local
|
9
|
-
Pathname.new('/').join('usr', 'local', 'evm')
|
10
|
-
end
|
4
|
+
ROOT_PATH = File.expand_path('..', File.dirname(__FILE__))
|
5
|
+
LOCAL_PATH = File.join('/', 'usr', 'local', 'evm')
|
11
6
|
|
12
|
-
def self.
|
13
|
-
args.
|
14
|
-
STDERR.print(arg)
|
15
|
-
STDERR.puts
|
16
|
-
end
|
7
|
+
def self.abort(*args)
|
8
|
+
STDERR.puts args.join(' ')
|
17
9
|
|
18
10
|
exit 1
|
19
11
|
end
|
20
12
|
|
21
|
-
def self.
|
22
|
-
|
13
|
+
def self.print_usage_and_exit
|
14
|
+
Evm.abort <<-EOS
|
23
15
|
USAGE: evm COMMAND [OPTIONS]
|
24
16
|
|
25
17
|
Emacs Version Manager
|
data/recipes/emacs-23.4.rb
CHANGED
data/recipes/emacs-24.1.rb
CHANGED
data/recipes/emacs-24.2.rb
CHANGED
data/recipes/emacs-24.3.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Andersson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-08 00:00:00 Z
|
13
13
|
dependencies: []
|
14
14
|
|
15
15
|
description: EVM is a command-line tool that allows you to install multiple Emacs versions.
|