Sha256: 784dabaea6eb71f59386203a98d7b7d38fec1d384c834d1cbc44ecab905583ad

Contents?: true

Size: 896 Bytes

Versions: 11

Compression:

Stored size: 896 Bytes

Contents

module Docman
  module Builders
    class GitProviderBuilder < ProviderBuilder

      register_builder :git_provider_builder

      def prepare_build_dir
        FileUtils.mkdir_p(@context['full_build_path'])
      end

      def build_with_provider
        FileUtils.rm_r(Dir["#{@context['full_build_path']}/*"]) if File.directory? @context['full_build_path']
        FileUtils.rm_r self['target_path'] if @context.need_rebuild? and File.directory? self['target_path']
        result = @provider.perform
        `rsync -a --exclude '.git' #{self['target_path']}/. #{@context['full_build_path']}`
        result
      end

      def changed_from_last_version?
        @provider.changed_from_last_version?
      end

      def execute
        prepare_build_dir
        @execute_result = build_with_provider
        changed_from_last_version? ? @execute_result : false
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
docman-0.0.91 lib/docman/builders/git_provider_builder.rb
docman-0.0.90 lib/docman/builders/git_provider_builder.rb
docman-0.0.89 lib/docman/builders/git_provider_builder.rb
docman-0.0.88 lib/docman/builders/git_provider_builder.rb
docman-0.0.87 lib/docman/builders/git_provider_builder.rb
docman-0.0.86 lib/docman/builders/git_provider_builder.rb
docman-0.0.85 lib/docman/builders/git_provider_builder.rb
docman-0.0.84 lib/docman/builders/git_provider_builder.rb
docman-0.0.83 lib/docman/builders/git_provider_builder.rb
docman-0.0.82 lib/docman/builders/git_provider_builder.rb
docman-0.0.81 lib/docman/builders/git_provider_builder.rb