class Prpr::Config::Github

Attributes

branch[R]
repository[R]

Public Class Methods

new(repository, branch: 'master') click to toggle source
# File lib/prpr/config/github.rb, line 8
def initialize(repository, branch: 'master')
  @repository = repository
  @branch = branch
end

Public Instance Methods

read(path) click to toggle source
# File lib/prpr/config/github.rb, line 13
def read(path)
  decode_content(path).tap { |s| s.force_encoding('utf-8') }
end

Private Instance Methods

decode_content(path) click to toggle source
# File lib/prpr/config/github.rb, line 19
def decode_content(path)
  Base64.decode64 resource(path).content
end
github() click to toggle source
# File lib/prpr/config/github.rb, line 27
def github
  @github ||= Prpr::Repository::Github.default
end
resource(path) click to toggle source
# File lib/prpr/config/github.rb, line 23
def resource(path)
  github.content(repository, path: path, ref: branch)
end