11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/github-info/scraper.rb', line 11
def self.get_commit_history(relative_path)
commit_history = []
document = Nokogiri::HTML(open("https://github.com#{relative_path}/commits/master"))
document.css("div.table-list-cell").each { |commit|
if commit.css("p a.message.js-navigation-open").text != ""
commit_hash = {
description: commit.css("p a.message.js-navigation-open").text,
date: commit.css("relative-time.no-wrap").text
}
commit_history << commit_hash
end
}
return commit_history
end
|