Sha256: 64db06adc0e19215278da44e06ea6dc331b471848a5444d79ebc24e43ca026c9

Contents?: true

Size: 706 Bytes

Versions: 2

Compression:

Stored size: 706 Bytes

Contents

require 'canpe/file_manipulation'
require 'canpe/repository_store'

module Canpe
  class RepositoryCreator
    include FileManipulation
    attr_reader :repository_name

    def initialize(repository_name)
      @repository_name = repository_name
    end

    def execute
      repository_list = Canpe::RepositoryStore.repository_list
      repository = repository_list.find { |repository| repository.match? 'default_repository' }

      if repository.blank?
        $stderr.puts "Could not find repository \"#{repository_name}\"."
        exit 1
      end

      Canpe::Runner.generate repository, options: { variables: { repository_name: repository_name }, working_directory: Dir.pwd }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
canpe-0.1.1 lib/canpe/repository_creator.rb
canpe-0.1.0 lib/canpe/repository_creator.rb