Class: RhoPackages::Repo

Inherits:
Object show all
Defined in:
lib/build/rho_packages.rb

Direct Known Subclasses

FileRepo, HttpRepo

Instance Method Summary collapse

Constructor Details

#initialize(root_dir) ⇒ Repo

Returns a new instance of Repo.



77
78
79
# File 'lib/build/rho_packages.rb', line 77

def initialize(root_dir)
  @root_dir = root_dir
end

Instance Method Details

#install(package_name, ruby_load_path) ⇒ Object



81
82
83
84
85
86
87
88
# File 'lib/build/rho_packages.rb', line 81

def install(package_name, ruby_load_path)
  unless ruby_load_path.nil?
    load_path = File.join(@root_dir, ruby_load_path)
    $LOAD_PATH.unshift(load_path) unless $LOAD_PATH.include?(load_path)
  end

  install_(package_name, ruby_load_path) unless installed?(package_name)
end