Class: Travis::CLI::Gh::Cat
Direct Known Subclasses
Fetch
Instance Method Summary
collapse
#gh
#auth, #gh, #plugin_config
#gh_error
Instance Method Details
#fetch(path) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/travis/cli/gh/cat.rb', line 17
def fetch(path)
path = "repos/#{repository.slug}/contents/#{path}"
path << "?ref=#{ref}" if ref
Base64.decode64(gh[path]['content'])
rescue GH::Error => e
gh_error(e)
end
|
#run(*paths) ⇒ Object
11
12
13
14
15
|
# File 'lib/travis/cli/gh/cat.rb', line 11
def run(*paths)
paths.each do |path|
say fetch(path)
end
end
|