Class: Punt::Receiver::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/punt/receiver/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(env = ENV, yaml = YAML) ⇒ Config

Returns a new instance of Config.



6
7
8
9
# File 'lib/punt/receiver/config.rb', line 6

def initialize(env=ENV,yaml=YAML)
  @env = env
  @yaml = yaml
end

Instance Method Details

#github_tokenObject



11
12
13
# File 'lib/punt/receiver/config.rb', line 11

def github_token
  @env.fetch("GITHUB_TOKEN")
end

#relevant_reposObject



15
16
17
18
# File 'lib/punt/receiver/config.rb', line 15

def relevant_repos
  file_name = @env.fetch("PR_REPOS_FILE")
  @yaml.load_file(file_name)["repos"]
end