Class: Docman::Builders::DirBuilder
- Defined in:
- lib/docman/builders/dir_builder.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Builder
#changed?, #config, create, #describe, #prefix, register_builder, #validate_command
Methods inherited from Command
#add_action, #add_actions, #config, create, #describe, #initialize, #perform, #prefix, register_command, #replace_placeholder, #run_actions, #run_with_hooks
Methods included from Logging
#log, logger, #logger, #prefix, #properties_info, #with_logging
Constructor Details
This class inherits a constructor from Docman::Command
Instance Method Details
#execute ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/docman/builders/dir_builder.rb', line 7 def execute if File.directory? @context['full_build_path'] if GitUtil.repo? @context['full_build_path'] log("Removed dir: #{@context['full_build_path']} because directory is git repo") FileUtils.rm_r(@context['full_build_path']) end end log("Created dir: #{@context['full_build_path']}") FileUtils::mkdir_p @context['full_build_path'] @context['build_path'] end |
#version ⇒ Object
19 20 21 |
# File 'lib/docman/builders/dir_builder.rb', line 19 def version @context['build_path'] end |