github project should return paths for files

This commit is contained in:
Ben Balter 2018-08-24 15:51:23 -04:00
parent e7bf382648
commit a8371c8fb7
No known key found for this signature in database
GPG Key ID: DBB67C246AD356C4
1 changed files with 3 additions and 2 deletions

View File

@ -35,11 +35,12 @@ module Licensee
end
def load_file(file)
Octokit.contents(@repo, path: file[:name],
accept: 'application/vnd.github.v3.raw')
Octokit.contents(@repo, path: file[:path],
accept: 'application/vnd.github.v3.raw').to_s
end
def dir_files(path = nil)
path = path.gsub('./', '') if path
files = Octokit.contents(@repo, path: path)
files = files.select { |data| data[:type] == 'file' }
files.each { |data| data[:dir] = File.dirname(data[:path]) }