lib/how_is/pulse.rb in how_is-18.0.3 vs lib/how_is/pulse.rb in how_is-18.0.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'tessellator/fetcher'
class HowIs
# This entire class is a monstrous hack, because GitHub doesn't provide
# a good API for Pulse.
@@ -17,11 +19,11 @@
raise NotImplementedError
end
# Gets the HTML Pulse summary.
def html_summary
- parts =
+ parts =
@pulse_page_response.body
.split('<div class="section diffstat-summary">')
if parts.length == 1
return "There hasn't been any activity on #{@repository} in the last month."
@@ -32,12 +34,13 @@
.split('</div>').first
.gsub('<a href="/', '<a href="https://github.com/')
.strip
end
- private
+ private
+
# Fetch Pulse page from GitHub for scraping.
- def fetch_pulse!(repository, period='monthly')
- Tessellator::Fetcher.new.call('get', "https://github.com/#{repository}/pulse/#{period}")
+ def fetch_pulse!(repository)
+ Tessellator::Fetcher.new.call('get', "https://github.com/#{repository}/pulse/monthly")
end
end
end