Class: Gawky::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/gawky/runner.rb

Instance Method Summary collapse

Constructor Details

#initializeRunner

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

#runObject



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