Module: Dots::Bootstrap

Includes:
Thor::Actions
Included in:
Command
Defined in:
lib/ruby/dots/bootstrap.rb

Constant Summary collapse

PROGRAMS =

These are the programs we are going to download from Homebrew.

%w(git ruby python vim pip hub)
PACKAGES =
%w(httpie aws)

Instance Method Summary collapse

Instance Method Details

#install_bundleObject

Install the latest version of all gems to the global gemset. These gems are configured in ~/.Gemfile.



27
28
29
# File 'lib/ruby/dots/bootstrap.rb', line 27

def install_bundle
  system "cd && #{install_bundler} && #{install_global_gemset}"
end

#install_packagesObject

Install Python packages from pip. Pip!



32
33
34
# File 'lib/ruby/dots/bootstrap.rb', line 32

def install_packages
  system "pip install #{PACKAGES.join(' ')}"
end

#install_programsObject

Install C binaries, Python programs, and other useful tools from Homebrew.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ruby/dots/bootstrap.rb', line 11

def install_programs
  if installed? "brew"
    programs_to_install = PROGRAMS.reduce([]) { |programs, program|
      programs << program unless installed? program
    }.join " "

    system "brew install #{programs_to_install}" \
      unless programs_to_install.empty?
    install_packages
  else
    install_homebrew and install_programs
  end
end