Sha256: 4a3253e46cbe78866e37d93b4fe4d93ef36ad1a7e527f3fd1ecc05e81e1a1594
Contents?: true
Size: 839 Bytes
Versions: 15
Compression:
Stored size: 839 Bytes
Contents
# encoding: utf-8 module LocalPac module Actions class CreateRepository private attr_reader :vcs_engine, :path, :options public def initialize(path, options = {}, vcs_engine = GitRepository) @path =::File.expand_path(path) @options = options @vcs_engine = vcs_engine end def run if need_to_run? || options[:force] == true LocalPac.ui_logger.warn "Creating repository \"#{path}\"." repo = vcs_engine.create(path) repo.add_content('README.md', 'Please place your proxy.pac-files here.') else LocalPac.ui_logger.warn "Repository \"#{path}\" already exists. Do not create it again!." end end private def need_to_run? !::File.exists?(path) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems