Module: LibGems

Defined in:
lib/bpm/libgems_ext/libgems.rb,
lib/bpm/libgems_ext/installer.rb,
lib/bpm/libgems_ext/config_file.rb,
lib/bpm/libgems_ext/spec_fetcher.rb,
lib/bpm/libgems_ext/dependency_installer.rb

Defined Under Namespace

Classes: ConfigFile, DependencyInstaller, Installer, SpecFetcher

Class Method Summary collapse

Class Method Details

.config_fileObject



20
21
22
# File 'lib/bpm/libgems_ext/libgems.rb', line 20

def self.config_file
  File.join LibGems.user_home, '.bpmrc'
end

.default_dirObject



12
13
14
# File 'lib/bpm/libgems_ext/libgems.rb', line 12

def self.default_dir
  File.join LibGems.user_home, BPM::BPM_DIR
end

.default_sourcesObject



4
5
6
# File 'lib/bpm/libgems_ext/libgems.rb', line 4

def self.default_sources
  %w[https://www.getbpm.org/]
end

.dirObject



35
36
37
38
# File 'lib/bpm/libgems_ext/libgems.rb', line 35

def self.dir
  set_home(ENV['BPM_HOME'] || LibGems.configuration.home || default_dir) unless @gem_home
  @gem_home
end

.hostObject



8
9
10
# File 'lib/bpm/libgems_ext/libgems.rb', line 8

def self.host
  @host ||= "https://www.getbpm.org"
end

.pathObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/bpm/libgems_ext/libgems.rb', line 24

def self.path
  @gem_path ||= nil

  unless @gem_path then
    paths = [ENV['BPM_PATH'] || LibGems.configuration.path || default_path]
    set_paths paths.compact.join(File::PATH_SEPARATOR)
  end

  @gem_path
end

.user_dirObject



16
17
18
# File 'lib/bpm/libgems_ext/libgems.rb', line 16

def self.user_dir
  File.join LibGems.user_home, BPM::BPM_DIR
end

.with_silenceObject



40
41
42
43
44
45
46
# File 'lib/bpm/libgems_ext/libgems.rb', line 40

def self.with_silence
  original_verbose = LibGems.configuration.verbose
  LibGems.configuration.verbose = false
  yield
ensure
  LibGems.configuration.verbose = original_verbose
end