bin_install 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bin_install/ruby/rbenv.rb +23 -38
- data/lib/bin_install/version.rb +1 -1
- data/lib/bin_install/zsh/oh_my_zsh.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccab321fa3bcb2267187d697fa107e78e6cefa1f9dac468df3b59dc5d8e83d3a
|
4
|
+
data.tar.gz: 232716b3889599dff4a0e39b75529f0f9f71cf8355f57942ca14a4b4eea99d75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9143db7a2049de8daee6ca59c23839e825af7b42be15a30f2fc9dcaff85a249ec9ab56d8f342fa000675e4f46da79713531473eece229c0dd9af74a7eb05d4d
|
7
|
+
data.tar.gz: c3c4309dd07b50a1ae323ef3a93130bf5304d7047592765213d2085d559798cea2643f7524899f6bca8980d877153aec896c67e53d3af12e6c26ed2c59050629
|
@@ -2,53 +2,23 @@ module BinInstall
|
|
2
2
|
module Ruby
|
3
3
|
module Rbenv
|
4
4
|
def self.install
|
5
|
-
if installed?
|
6
|
-
puts 'rbenv is already installed. Skipping.'.blue
|
7
|
-
Brew::Package.upgrade('rbenv')
|
8
|
-
Brew::Package.install_or_upgrade('ruby-build')
|
9
|
-
else
|
10
|
-
first_install
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.install!
|
15
|
-
if installed?
|
16
|
-
puts 'rbenv is already installed. Skipping.'.blue
|
17
|
-
Brew::Package.upgrade!('rbenv')
|
18
|
-
Brew::Package.install_or_upgrade!('ruby-build')
|
19
|
-
else
|
20
|
-
first_install!
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.first_install
|
25
5
|
puts 'Installing rbenv...'.white
|
26
6
|
Brew::Package.install('rbenv')
|
27
7
|
Brew::Package.install_or_upgrade('ruby-build')
|
28
8
|
Shell.append_to_profiles(%{eval "$(rbenv init -)"\n})
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
doctor
|
33
|
-
puts 'First install done **************************'
|
9
|
+
require_doctor!
|
10
|
+
install_ruby
|
11
|
+
require_doctor!
|
34
12
|
end
|
35
13
|
|
36
|
-
def self.
|
14
|
+
def self.install!
|
37
15
|
puts 'Installing rbenv...'.white
|
38
16
|
Brew::Package.install!('rbenv')
|
39
17
|
Brew::Package.install_or_upgrade!('ruby-build')
|
40
|
-
Shell.append_to_profiles(%{eval "$(rbenv init -)"\n})
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
doctor!
|
45
|
-
end
|
46
|
-
|
47
|
-
def self.reload_shell!
|
48
|
-
puts 'Warning rbenv requires reloading the shell'.yellow
|
49
|
-
puts 'Close this shell and rerun the installer with:'.red
|
50
|
-
puts '$ bin/install'.cyan
|
51
|
-
abort('Can not continue.'.red)
|
18
|
+
Shell.append_to_profiles!(%{eval "$(rbenv init -)"\n})
|
19
|
+
require_doctor!
|
20
|
+
install_ruby!
|
21
|
+
require_doctor!
|
52
22
|
end
|
53
23
|
|
54
24
|
def self.install_ruby(version = nil)
|
@@ -91,6 +61,21 @@ module BinInstall
|
|
91
61
|
BinInstall.system!('curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash')
|
92
62
|
end
|
93
63
|
|
64
|
+
def self.require_doctor!
|
65
|
+
abort_install! unless doctor
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.abort_install!
|
69
|
+
puts 'Warning rbenv-doctor returned a non zero exit status.'.yellow
|
70
|
+
puts 'Correct the error above before continuing.'.yellow
|
71
|
+
puts 'Try closing this window and restarting your shell session.'.yellow
|
72
|
+
puts "\n"
|
73
|
+
puts 'Rerun the installer with:'
|
74
|
+
puts '$ bin/install'.cyan
|
75
|
+
puts "\n"
|
76
|
+
abort('Aborting install.'.red)
|
77
|
+
end
|
78
|
+
|
94
79
|
def self.rehash
|
95
80
|
system('rbenv rehash')
|
96
81
|
end
|
data/lib/bin_install/version.rb
CHANGED
@@ -28,7 +28,9 @@ module BinInstall
|
|
28
28
|
def self.print_reload_warning
|
29
29
|
return if installed?
|
30
30
|
puts 'Warning Oh My Zsh requires reloading the shell.'.yellow
|
31
|
-
puts 'After Oh My Zsh finishes installing
|
31
|
+
puts 'After Oh My Zsh finishes installing.'.red
|
32
|
+
puts 'Close this window and restart your shell session.'.red
|
33
|
+
puts "\n"
|
32
34
|
puts 'Rerun the installer with:'
|
33
35
|
puts '$ bin/install'.cyan
|
34
36
|
end
|