Module: Rgz

Defined in:
lib/rgz.rb,
lib/rgz/version.rb

Constant Summary collapse

RgzNotFound =
Class.new Exception
VERSION =
'1.0'

Class Method Summary collapse

Class Method Details

.include_paths(libpath) ⇒ Object

Raises:



7
8
9
10
11
12
13
14
15
# File 'lib/rgz.rb', line 7

def include_paths(libpath)
  raise RgzNotFound unless File.exist? libpath
  libpath = File.expand_path libpath
  t = Dir.mktmpdir
  Dir.chdir t do
    tar_xzvf libpath
  end
  Dir.glob(t + '/**/lib')
end

.make_rgz(dir) ⇒ Object



18
19
20
21
# File 'lib/rgz.rb', line 18

def make_rgz(dir)
  system 'bundle install .'
  system 'tar czvf ruby.rgz ruby'
end

.tar_xzvf(path) ⇒ Object



24
25
26
27
# File 'lib/rgz.rb', line 24

def tar_xzvf(path)
  # FIXME: don't use tar external command(?)
  system 'tar', 'xzvf', path, [:err, :out] => '/dev/null' # TODO /dev/null
end