Module: Gears::Binaries

Defined in:
lib/robot_sweatshop/gears/binaries.rb

Overview

Installs binary Gears packages

Class Method Summary collapse

Class Method Details

.expose(from_path:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/robot_sweatshop/gears/binaries.rb', line 7

def self.expose(from_path:)
  binary_name = File.basename from_path
  original_binary = File.expand_path "#{from_path}/#{binary_name}"
  binary_link = File.expand_path "#{scripts_path}/#{binary_name}"
  begin
    FileUtils.symlink original_binary, binary_link
    Announce.success "Symlinked #{binary_name}"
  rescue
    Announce.warning "#{binary_name} already exists"
  end
end

.scripts_pathObject



19
20
21
22
23
24
# File 'lib/robot_sweatshop/gears/binaries.rb', line 19

def self.scripts_path
  config = File.expand_path '~/.robot_sweatshop/compiled_config.yaml'
  fail 'Please run `sweatshop start` again' unless File.exist? config
  config = YAML.load File.read(config)
  config[:scripts_path]
end