Class: Jammer::PackageInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/jammer/package_installer.rb

Constant Summary collapse

JAM_PACKAGE_REGEX =
/jam\s[\'\"](\w+)[\'\"](?:,\s['"](.*)['"])?/

Instance Method Summary collapse

Instance Method Details

#get_packagesObject



17
18
19
# File 'lib/jammer/package_installer.rb', line 17

def get_packages
  package_file.scan(JAM_PACKAGE_REGEX)
end

#install_packagesObject



6
7
8
9
10
11
# File 'lib/jammer/package_installer.rb', line 6

def install_packages
  packages.each do |package|
    puts "installing #{package}"
    `jam install #{package.first}#{"@" + package.last if package.last}`
  end
end

#package_fileObject



21
22
23
# File 'lib/jammer/package_installer.rb', line 21

def package_file
  @package_file ||= File.read('Jamfile')
end

#packagesObject



13
14
15
# File 'lib/jammer/package_installer.rb', line 13

def packages
  @packages ||= get_packages
end