class Dep::GitLib

Attributes

gemspec_path[RW]
uri[RW]

Public Class Methods

new(name, data) click to toggle source
# File bin/dep, line 94
def initialize(name, data)
  self.name = name
  if data.strip =~ /^(\S+) (\S+)$/
    @uri = $1
    @gemspec_path = $2
  else
    @uri = data
    @gemspec_path = nil
  end
  self
end

Public Instance Methods

install() click to toggle source
# File bin/dep, line 110
def install
  tmp_path = "/tmp/dep-#{name}"
  %{rm -rf #{tmp_path} &&
    git clone #{uri} #{tmp_path} &&
    (cd #{tmp_path}/#{@gemspec_path} && gem build #{name}.gemspec) &&
    gem install `ls #{tmp_path}/#{@gemspec_path}/#{name}-*.gem | head -n 1`}
end
to_s() click to toggle source
# File bin/dep, line 106
def to_s
  "#{name} --git #{@gemspec_path ? "'#{@uri} #{@gemspec_path}'" : @uri}"
end