Class: Michael::Commands::Repos::PullRequests

Inherits:
Object
  • Object
show all
Defined in:
lib/michael/commands/repos/pull_requests.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, users, repos, options) ⇒ PullRequests

Returns a new instance of PullRequests.



11
12
13
14
15
16
# File 'lib/michael/commands/repos/pull_requests.rb', line 11

def initialize(config, users, repos, options)
  @config = config
  @users = users
  @repos = repos
  @options = options
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/michael/commands/repos/pull_requests.rb', line 9

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/michael/commands/repos/pull_requests.rb', line 9

def options
  @options
end

#reposObject (readonly)

Returns the value of attribute repos.



9
10
11
# File 'lib/michael/commands/repos/pull_requests.rb', line 9

def repos
  @repos
end

#usersObject (readonly)

Returns the value of attribute users.



9
10
11
# File 'lib/michael/commands/repos/pull_requests.rb', line 9

def users
  @users
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/michael/commands/repos/pull_requests.rb', line 18

def execute
  q = Queue.new
  waiting = print_waiting(q)
  list = config.fetch(:repos)

  list = repos.pull_requests(list, q)
  waiting.join

  puts [filter_repos_w_prs(list), get_empty(list), get_broken(list)]
    .reject(&:nil?).join("\n\n")
end