Class: LocalPac::Actions::CreateRepository
- Inherits:
-
Object
- Object
- LocalPac::Actions::CreateRepository
- Defined in:
- lib/local_pac/actions/create_repository.rb
Instance Method Summary collapse
-
#initialize(path, options = {}, vcs_engine = GitRepository) ⇒ CreateRepository
constructor
A new instance of CreateRepository.
- #run ⇒ Object
Constructor Details
#initialize(path, options = {}, vcs_engine = GitRepository) ⇒ CreateRepository
Returns a new instance of CreateRepository.
11 12 13 14 15 |
# File 'lib/local_pac/actions/create_repository.rb', line 11 def initialize(path, = {}, vcs_engine = GitRepository) @path =::File.(path) = @vcs_engine = vcs_engine end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/local_pac/actions/create_repository.rb', line 17 def run if need_to_run? || [: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 |