Class: MultiRepo::Labels

Inherits:
Object
  • Object
show all
Defined in:
lib/multi_repo/labels.rb

Class Method Summary collapse

Class Method Details

.[](repo) ⇒ Object



11
12
13
# File 'lib/multi_repo/labels.rb', line 11

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

.allObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/multi_repo/labels.rb', line 15

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

.configObject



7
8
9
# File 'lib/multi_repo/labels.rb', line 7

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

.config_fileObject



3
4
5
# File 'lib/multi_repo/labels.rb', line 3

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