Sha256: 32687b80049399b5d5cea9f1109ad2587cae68a34ec112952cdc726258b1b58e

Contents?: true

Size: 1.81 KB

Versions: 2

Compression:

Stored size: 1.81 KB

Contents

##################################################################
#                  Licensing Information                         #
#                                                                #
#  The following code is licensed, as standalone code, under     #
#  the Ruby License, unless otherwise directed within the code.  #
#                                                                #
#  For information on the license of this code when distributed  #
#  with and used in conjunction with the other modules in the    #
#  Amp project, please see the root-level LICENSE file.          #
#                                                                #
#  © Michael J. Edgar and Ari Brown, 2009-2010                   #
#                                                                #
##################################################################

module Amp
  module Core
    module Repositories
      class RepoError < StandardError; end
    
      ##
      # Picks a repository provided a user configuration, a path, and whether
      # we have permission to create the repository.
      #
      # This is the entry point for repo-independent command dispatch.  We need
      # to know if the given repository is of a particular type. We iterate
      # over all known types, ask each type "does this path look like your kind
      # of repo?", and if it says "yes", use that type.
      #
      # Note: this does NOT handle when there are two types of repositories in
      # a given directory.
      def self.pick(config, path='', create=false)
        GenericRepoPicker.each do |picker|
          return picker.pick(config, path, create) if picker.repo_in_dir?(path)
        end
      
        # We have found... nothing
        nil
      end # def self.pick
    end # module Repositories
  end # module Core
end # module Amp

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
amp-core-0.2.0 lib/amp-core/repository/repository.rb
amp-core-0.1.0 lib/amp-core/repository/repository.rb