Sha256: 1e6ffaab140481bfa11961df6fd416ccb96a644f41fa78f3ab48b63824f63a71

Contents?: true

Size: 581 Bytes

Versions: 4

Compression:

Stored size: 581 Bytes

Contents

require 'repertoire/media/type'

module Repertoire
  module Media
    class Git < Type

      known_as :git

      uses_schemes 'git'
      uses_directory '.git'

      #
      # Checks out the Git repository located at the specified _uri_ into
      # the specified _path_.
      #
      def self.checkout(uri,path)
        sh 'git', 'clone', uri, path
      end

      #
      # Updated the Git repository located at the specified _path_.
      #
      def self.update(path,uri=nil)
        switch_dir(path) do
          sh 'git', 'pull'
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
repertoire-0.2.3 lib/repertoire/media/types/git.rb
repertoire-0.2.0 lib/repertoire/media/types/git.rb
repertoire-0.2.1 lib/repertoire/media/types/git.rb
repertoire-0.2.2 lib/repertoire/media/types/git.rb