bin_install 0.0.15 → 0.0.16

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
  SHA256:
3
- metadata.gz: cf520e85a67139400ac80332f8c75edcc4d3963670c88befc29e2f18add01ce2
4
- data.tar.gz: 5290b4fd34eed30a1f53e77008dd05e3386b0841b4f38eb7fc966004d2dbd71c
3
+ metadata.gz: ccab321fa3bcb2267187d697fa107e78e6cefa1f9dac468df3b59dc5d8e83d3a
4
+ data.tar.gz: 232716b3889599dff4a0e39b75529f0f9f71cf8355f57942ca14a4b4eea99d75
5
5
  SHA512:
6
- metadata.gz: 0d42687f1281e5b05564ad718f5c328ff6b61ca9b2100b11c5b96ad5d950d6b4b0bae1b0d1282363ed12a128c21e00063568082265780942242c51867657a9ee
7
- data.tar.gz: 983e45d53b549124507dc7d8b1a5c793fc692f10fdd1a0ccf1d672d2b9b0a7d933c21152b008805475514adf171be8b3ebe7da903176a938d35d0075d77320a4
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
- version
31
- rehash
32
- doctor
33
- puts 'First install done **************************'
9
+ require_doctor!
10
+ install_ruby
11
+ require_doctor!
34
12
  end
35
13
 
36
- def self.first_install!
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
- version!
43
- rehash!
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
@@ -1,3 +1,3 @@
1
1
  module BinInstall
2
- VERSION = '0.0.15'.freeze
2
+ VERSION = '0.0.16'.freeze
3
3
  end
@@ -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 you must restart your shell!'.red
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bin_install
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Singer