bin_install 0.0.23 → 0.0.24

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: 5d1fb257593cb79b26a9c25593ddd23cb87851d189af0f79a41f269bb7e13eac
4
- data.tar.gz: 3eb8c60930c566b53951efb93bea0dd4738621cb040c778285203d3579515cd5
3
+ metadata.gz: 2c39dc3016d8e1eca485905af0d3e8334b3295fb8254059a672cec011f4ad393
4
+ data.tar.gz: 433569b4114eb701ccc99a642287451fbfdbd3888b392128032f380c757b5d87
5
5
  SHA512:
6
- metadata.gz: 8be86a6fb2f890403b102155b0550b476108ced75d8b0ea6a7cdc8a7cd53a50b5488b3eb6f71275da875356f39af73b8f626732407d888dc6b68ab065e5daa1f
7
- data.tar.gz: 42cc6ead515ac6640a28922b5578472597c6cc1314f145f55061a7c109ecd951809730722634f65fe2986186dd0ca95e254d166cfd89e9371a661fce25bc8654
6
+ metadata.gz: be66535371fd8a459e08616dc672288b6a82d411fbf3f6db17604d6d0127b04bc16d18f45a3edbbac574f250e94b161e68e187a4d6e72937bfcc4d51020c0da7
7
+ data.tar.gz: 1321512888ba836b940a83c8879d004e9b90aacfb0d3054aa76d2467748b17f61c063ba71eb729968cf72ac40d582f1ab9fac9928a432deb6eca6672724df23e
data/.rubocop.yml CHANGED
@@ -11,5 +11,8 @@ Lint/ScriptPermission:
11
11
  Metrics/LineLength:
12
12
  Max: 240
13
13
 
14
+ Metrics/MethodLength:
15
+ Max: 20
16
+
14
17
  Style/FrozenStringLiteralComment:
15
18
  Enabled: false
data/lib/bin_install.rb CHANGED
@@ -24,6 +24,7 @@ module BinInstall
24
24
 
25
25
  def self.finish
26
26
  puts "Finished bin_install #{VERSION}.".green
27
+ puts 'Warning you may need to reload your shell.'.yellow
27
28
  end
28
29
 
29
30
  def self.system!(*args)
@@ -4,7 +4,7 @@ module BinInstall
4
4
  module Atom
5
5
  def self.install
6
6
  if installed?
7
- puts 'Atom already installed. Skipping.'.blue
7
+ puts 'Atom already installed. Skipping Atom install.'.blue
8
8
  else
9
9
  Brew::Cask.install('atom')
10
10
  end
@@ -12,7 +12,7 @@ module BinInstall
12
12
 
13
13
  def self.install!
14
14
  if installed?
15
- puts 'Atom already installed. Skipping.'.blue
15
+ puts 'Atom already installed. Skipping Atom install.'.blue
16
16
  else
17
17
  Brew::Cask.install!('atom')
18
18
  end
@@ -19,7 +19,7 @@ module BinInstall
19
19
 
20
20
  def self.upgrade(package)
21
21
  if latest_version?(package)
22
- puts "#{package} is already the latest version. Skipping.".blue
22
+ puts "#{package} is already the latest version. Skipping #{package} install.".blue
23
23
  else
24
24
  system("brew upgrade #{package}")
25
25
  end
@@ -27,7 +27,7 @@ module BinInstall
27
27
 
28
28
  def self.upgrade!(package)
29
29
  if latest_version?(package)
30
- puts "#{package} is already the latest version. Skipping.".blue
30
+ puts "#{package} is already the latest version. Skipping #{package} install.".blue
31
31
  else
32
32
  BinInstall.system!("brew upgrade #{package}")
33
33
  end
@@ -3,7 +3,7 @@ module BinInstall
3
3
  module Service
4
4
  def self.run(service)
5
5
  if started?(service)
6
- puts "Service #{service} already started. Skipping.".blue
6
+ puts "Service #{service} already started. Skipping #{service} install.".blue
7
7
  else
8
8
  system("brew services run #{service}")
9
9
  end
@@ -11,7 +11,7 @@ module BinInstall
11
11
 
12
12
  def self.run!(service)
13
13
  if started?(service)
14
- puts "Service #{service} already started. Skipping.".blue
14
+ puts "Service #{service} already started. Skipping #{service} install.".blue
15
15
  else
16
16
  BinInstall.system!("brew services run #{service}")
17
17
  end
@@ -19,7 +19,7 @@ module BinInstall
19
19
 
20
20
  def self.start(service)
21
21
  if started?(service)
22
- puts "Service #{service} already started. Skipping.".blue
22
+ puts "Service #{service} already started. Skipping #{service} install.".blue
23
23
  else
24
24
  system("brew services start #{service}")
25
25
  end
@@ -27,7 +27,7 @@ module BinInstall
27
27
 
28
28
  def self.start!(service)
29
29
  if started?(service)
30
- puts "Service #{service} already started. Skipping.".blue
30
+ puts "Service #{service} already started. Skipping #{service} install.".blue
31
31
  else
32
32
  BinInstall.system!("brew services start #{service}")
33
33
  end
@@ -35,7 +35,7 @@ module BinInstall
35
35
 
36
36
  def self.stop(service)
37
37
  if stopped?(service)
38
- puts "Service #{service} already stopped. Skipping.".blue
38
+ puts "Service #{service} already stopped. Skipping #{service} install.".blue
39
39
  else
40
40
  system("brew services stop #{service}")
41
41
  end
@@ -43,7 +43,7 @@ module BinInstall
43
43
 
44
44
  def self.stop!(service)
45
45
  if stopped?(service)
46
- puts "Service #{service} already stopped. Skipping.".blue
46
+ puts "Service #{service} already stopped. Skipping #{service} install.".blue
47
47
  else
48
48
  BinInstall.system!("brew services stop #{service}")
49
49
  end
@@ -12,7 +12,7 @@ module BinInstall
12
12
 
13
13
  def self.add_remote(name, url)
14
14
  if remote?(name)
15
- puts "Remote #{name} already exists. Skipping.".blue
15
+ puts "Remote #{name} already exists. Skipping remote #{name}.".blue
16
16
  else
17
17
  puts "Adding remote #{name} for #{url}...".white
18
18
  system("git remote add #{name} #{url}")
@@ -21,7 +21,7 @@ module BinInstall
21
21
 
22
22
  def self.add_remote!(name, url)
23
23
  if remote?(name)
24
- puts "Remote #{name} already exists. Skipping.".blue
24
+ puts "Remote #{name} already exists. Skipping remote #{name}.".blue
25
25
  else
26
26
  puts "Adding remote #{name} for #{url}...".white
27
27
  BinInstall.system!("git remote add #{name} #{url}")
@@ -4,7 +4,7 @@ require 'bin_install/ruby/rvm'
4
4
  module BinInstall
5
5
  module Ruby
6
6
  def self.required_ruby_version
7
- Dir.chdir(Dir.pwd) { `cat .ruby-version` }
7
+ Dir.chdir(Dir.pwd) { `cat .ruby-version` }.chop
8
8
  end
9
9
 
10
10
  def self.ruby_version
@@ -4,24 +4,32 @@ module BinInstall
4
4
  DOCTOR = 'curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash'.freeze
5
5
 
6
6
  def self.install
7
- puts 'Installing rbenv...'.white
8
- Brew::Package.install('rbenv')
9
- Brew::Package.install_or_upgrade('ruby-build')
10
- Shell.append_to_profiles(%{eval "$(rbenv init -)"\n})
11
- require_shims!
12
- install_ruby
13
- doctor
7
+ if Ruby::Rvm.installed?
8
+ puts 'RVM is already installed. Skipping rbenv install.'.yellow
9
+ else
10
+ puts 'Installing rbenv...'.white
11
+ Brew::Package.install('rbenv')
12
+ Brew::Package.install_or_upgrade('ruby-build')
13
+ Shell.append_to_profiles(%{eval "$(rbenv init -)"\n})
14
+ require_shims!
15
+ install_ruby
16
+ doctor
17
+ end
14
18
  end
15
19
 
16
20
  def self.install!
17
- puts 'Installing rbenv...'.white
18
- Brew::Package.install!('rbenv')
19
- Brew::Package.install_or_upgrade!('ruby-build')
20
- Shell.append_to_profiles!(%{eval "$(rbenv init -)"\n})
21
- require_shims!
22
- install_ruby!
23
- require_shims!
24
- doctor!
21
+ if Ruby::Rvm.installed?
22
+ abort('RVM is already installed. Aborting rbenv install.'.red)
23
+ else
24
+ puts 'Installing rbenv...'.white
25
+ Brew::Package.install!('rbenv')
26
+ Brew::Package.install_or_upgrade!('ruby-build')
27
+ Shell.append_to_profiles!(%{eval "$(rbenv init -)"\n})
28
+ require_shims!
29
+ install_ruby!
30
+ require_shims!
31
+ doctor!
32
+ end
25
33
  end
26
34
 
27
35
  def self.install_ruby(version = Ruby.required_ruby_version)
@@ -29,7 +37,7 @@ module BinInstall
29
37
 
30
38
  if version
31
39
  if Ruby.ruby_version_installed?(version)
32
- puts "Ruby #{version} is already installed. Skipping.".blue
40
+ puts "Ruby #{version} is already installed. Skipping Ruby #{version} install.".blue
33
41
  else
34
42
  system("rbenv install #{version}")
35
43
  end
@@ -43,7 +51,7 @@ module BinInstall
43
51
 
44
52
  if version
45
53
  if Ruby.ruby_version_installed?(version)
46
- puts "Ruby #{version} is already installed. Skipping.".blue
54
+ puts "Ruby #{version} is already installed. Skipping Ruby #{version} install.".blue
47
55
  else
48
56
  BinInstall.system!("rbenv install #{version}")
49
57
  end
@@ -1,6 +1,20 @@
1
1
  module BinInstall
2
2
  module Ruby
3
3
  module Rvm
4
+ INSTALL = '\curl -sSL https://get.rvm.io | bash'.freeze
5
+
6
+ def self.install
7
+ puts 'Installing RVM...'.white
8
+ system(INSTALL)
9
+ install_ruby
10
+ end
11
+
12
+ def self.install!
13
+ puts 'Installing RVM...'.white
14
+ BinInstall.system!(INSTALL)
15
+ install_ruby!
16
+ end
17
+
4
18
  def self.install_ruby(version = nil)
5
19
  version ||= Ruby.required_ruby_version
6
20
 
@@ -25,7 +25,7 @@ module BinInstall
25
25
  file = File.open(path, 'a+')
26
26
 
27
27
  if file.read.include?(value)
28
- puts "Value already exist in #{path}. Skipping.".blue
28
+ puts "Value already exist in #{path}. Skipping file injection.".blue
29
29
  else
30
30
  puts "Writing to #{path}:\n#{value.to_s.purple}"
31
31
  file << value.to_s
@@ -1,3 +1,3 @@
1
1
  module BinInstall
2
- VERSION = '0.0.23'.freeze
2
+ VERSION = '0.0.24'.freeze
3
3
  end
@@ -3,13 +3,13 @@ module BinInstall
3
3
  def self.install
4
4
  puts 'Installing Yarn...'.white
5
5
  Brew::Package.install_or_upgrade('yarn')
6
- system('yarn install --ignore-engines')
6
+ system('yarn install')
7
7
  end
8
8
 
9
9
  def self.install!
10
10
  puts 'Installing Yarn...'.white
11
11
  Brew::Package.install_or_upgrade!('yarn')
12
- BinInstall.system!('yarn install --ignore-engines')
12
+ BinInstall.system!('yarn install')
13
13
  end
14
14
 
15
15
  def self.upgrade
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.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Singer