Class: HowIs::Pulse
- Inherits:
-
Object
- Object
- HowIs::Pulse
- Defined in:
- lib/how_is/pulse.rb
Overview
This entire class is a monstrous hack, because GitHub doesn’t provide a good API for Pulse.
TODO: Use GitHub’s Statistics API to replace this garbage.
See https://github.com/how-is/how_is/issues/122
Instance Method Summary collapse
-
#html_summary ⇒ Object
Gets the HTML Pulse summary.
-
#initialize(repository) ⇒ Pulse
constructor
A new instance of Pulse.
Constructor Details
#initialize(repository) ⇒ Pulse
12 13 14 15 |
# File 'lib/how_is/pulse.rb', line 12 def initialize(repository) @repository = repository @pulse_page_response = fetch_pulse!(repository) end |
Instance Method Details
#html_summary ⇒ Object
Gets the HTML Pulse summary.
18 19 20 21 22 23 24 |
# File 'lib/how_is/pulse.rb', line 18 def html_summary if stats_section? stats_html_fragment.gsub('<a href="/', '<a href="https://github.com/') else "There hasn't been any activity on #{@repository} in the last month." end end |