module BinInstall::Git
Public Class Methods
add_remote(name, url)
click to toggle source
# File lib/bin_install/git.rb, line 13 def self.add_remote(name, url) if remote?(name) puts "Remote #{name} already exists. Skipping remote #{name}.".blue else puts "Adding remote #{name} for #{url}...".white system("git remote add #{name} #{url}") end end
add_remote!(name, url)
click to toggle source
# File lib/bin_install/git.rb, line 22 def self.add_remote!(name, url) if remote?(name) puts "Remote #{name} already exists. Skipping remote #{name}.".blue else puts "Adding remote #{name} for #{url}...".white BinInstall.system!("git remote add #{name} #{url}") end end
install()
click to toggle source
# File lib/bin_install/git.rb, line 3 def self.install puts 'Installing Git...'.white Brew::Package.install_or_upgrade('git') end
install!()
click to toggle source
# File lib/bin_install/git.rb, line 8 def self.install! puts 'Installing Git...'.white Brew::Package.install_or_upgrade!('git') end
installed?()
click to toggle source
# File lib/bin_install/git.rb, line 35 def self.installed? Shell.executable_exists?('git') end
remote?(name)
click to toggle source
# File lib/bin_install/git.rb, line 31 def self.remote?(name) system("git remote get-url #{name}") end