Sha256: 4b95919f6fc6c065537dc3fdcf8032c08c89e7e067a138eeb864ebf8587a36f4

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

module Gunter
  module Model
    # Gunter Project model class
    module Project
      class << self
        # Create a new project
        #
        # @param repo [String] the repository name
        # @param location [String] the location to clone the repository (optional)
        def create(repo, location = nil, git: Gunter.model(:git), template: Gunter.model(:template))
          unless repo.match?(%r{\A\w+/\w+\z})
            repo_by_name = template.all.dig(repo, :repo)
            repo = repo_by_name if repo_by_name
          end

          git.clone(repo, location)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gunter-0.1.0 lib/gunter/model/project.rb