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
  issues = Gawky.github.issues.list(:org => ARGV[0],
                                    :filter => 'all',
                                    :auto_pagination => true,
                                    :sort => 'created')
  issues.each do |issue|
    if issue['pull_request']
      date = DateTime.parse(issue.created_at)
      if elapsed_time(date) > Gawky.max_elapsed_days
        puts Status.new(date, issue).warning
      else
        puts Status.new(date, issue).green
      end
    end
  end
end