Sha256: e6530658e21f2372c3649b6b864ddf7b159208abf08a6c5f87abcc0a4a1def34

Contents?: true

Size: 743 Bytes

Versions: 11

Compression:

Stored size: 743 Bytes

Contents

module MultiRepo
  class Labels
    def self.config_file
      MultiRepo.config_dir.join("labels.yml")
    end

    def self.config
      @config ||= YAML.unsafe_load_file(config_file)
    end

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

    def self.all
      @all ||= begin
        require "more_core_extensions/core_ext/hash/nested"

        Array(config["orgs"]).each do |org, options|
          MultiRepo::Service::Github.org_repo_names(org).each do |repo_name|
            next if config.key_path?("repos", repo_name)
            next if options["except"].include?(repo_name)

            config.store_path("repos", repo_name, options["labels"])
          end
        end
        config["repos"].sort.to_h
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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