Sha256: 732e92802cfcae8b5ba918af37fa79ed43724974ee6bcfb09b880d8aec067e07

Contents?: true

Size: 534 Bytes

Versions: 11

Compression:

Stored size: 534 Bytes

Contents

require 'yaml'

module MultiRepo
  class RepoSet
    def self.config_files
      Dir.glob(MultiRepo.config_dir.join("repos*.yml")).sort
    end

    def self.config
      @config ||= config_files.each_with_object({}) do |f, h|
        h.merge!(YAML.unsafe_load_file(f))
      end
    end

    def self.[](set_name)
      all[set_name]
    end

    def self.all
      @all ||= config.transform_values do |repo_set|
        repo_set.map do |repo, config|
          Repo.new(repo, config: config)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
multi_repo-0.5.0 lib/multi_repo/repo_set.rb
multi_repo-0.4.0 lib/multi_repo/repo_set.rb
multi_repo-0.3.1 lib/multi_repo/repo_set.rb
multi_repo-0.3.0 lib/multi_repo/repo_set.rb
multi_repo-0.2.3 lib/multi_repo/repo_set.rb
multi_repo-0.2.2 lib/multi_repo/repo_set.rb
multi_repo-0.2.1 lib/multi_repo/repo_set.rb
multi_repo-0.2.0 lib/multi_repo/repo_set.rb
multi_repo-0.1.2 lib/multi_repo/repo_set.rb
multi_repo-0.1.1 lib/multi_repo/repo_set.rb
multi_repo-0.1.0 lib/multi_repo/repo_set.rb