Module: Bringit::Cloning::ClassMethods

Included in:
Wrapper
Defined in:
lib/bringit/cloning.rb

Overview

… that are invoked from the class

Instance Method Summary collapse

Instance Method Details

#clone(path, remote) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bringit/cloning.rb', line 11

def clone(path, remote)
  if remote_git?(remote)
    clone_git(path, remote)
  # rubocop:disable Lint/AssignmentInCondition
  elsif layout = remote_svn_layout(remote) # remote_svn?
    clone_svn(path, remote, layout)
  else
    raise InvalidRemoteError
  end
  new(path)
end

#valid_remote?(remote) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/bringit/cloning.rb', line 23

def valid_remote?(remote)
  remote_git?(remote) || !!remote_svn_layout(remote)
end