Sha256: 772315df4c5b4c22f095b9f960d776a5c08cb295c4653b75025bb18a7bb82f16

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

require 'yaml'

module Docman
  module Builders
    class GitBuilder < Builder

      register_builder :git

      def direct
        puts 'Do direct'
        GitUtil.get(@info['repo'], @info['full_build_path'], version_type, version)
      end

      def strip
        puts 'Do strip'
        FileUtils.rm_r(@info['full_build_path']) if File.directory? @info['full_build_path']
        result = GitUtil.get(@info['repo'], @info['temp_path'], version_type, version)
        FileUtils.mkdir_p(@info['full_build_path'])
        FileUtils.cp_r(Dir["#{@info['temp_path']}/."], @info['full_build_path'])
        FileUtils.rm_r(File.join(@info['full_build_path'], '.git'))
        result
      end

      # TODO: need to refactor into into @info class.
      def version
        @info['states'][@state]['version']
      end

      def version_type
        @info['states'][@state]['type']
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
docman-0.0.3 lib/docman/builders/git_builder.rb