Class: Gawky::Runner
- Inherits:
-
Object
- Object
- Gawky::Runner
- Defined in:
- lib/gawky/runner.rb
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
4 5 6 |
# File 'lib/gawky/runner.rb', line 4 def initialize @date_now = Date.today end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gawky/runner.rb', line 8 def run repos = Gawky.github.repos.list org: ARGV[0], per_page: 100 repos.each do |repo| if repo.open_issues_count > 0 pulls = Gawky.github.pull_requests.list user: ARGV[0], repo: repo.name pulls.each do |pull| date = DateTime.parse(pull.created_at) if elapsed_time(date) > Gawky.max_elapsed_days puts Status.new(date, pull).warning else puts Status.new(date, pull).green end end end end end |