Sha256: b2d09add7d64e62206e066b284c17631a65d31cdfdb8c57058407e1dfb4b2800
Contents?: true
Size: 595 Bytes
Versions: 16
Compression:
Stored size: 595 Bytes
Contents
require 'dply/git' module Dply class Repo attr_reader :dir, :upstream, :mirror def initialize(dir, upstream, mirror: nil) @dir = dir @upstream = upstream @mirror = mirror end def create if Dir.exist? "#{dir}/.git" raise Error, "unable to create repo (another repo already exists)" if not verify_remote_url else Git.clone upstream, dir, mirror: @mirror end end private def verify_remote_url remote_url = Dir.chdir(dir) do Git.remote_url end remote_url == upstream end end end
Version data entries
16 entries across 16 versions & 1 rubygems