Class: Neetob::CLI::Github::Issues::List

Inherits:
Base
  • Object
show all
Includes:
ActionView::Helpers::DateHelper
Defined in:
lib/neetob/cli/github/issues/list.rb

Constant Summary

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from Base

#client

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods inherited from Base

#check_for_apps_and_all_neeto_repos_option

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initialize(apps, issue_assignee = "", issue_state = "open", issue_search_query = "", show_issues_count = false, issue_label = "", sandbox = false) ⇒ List

Returns a new instance of List.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/neetob/cli/github/issues/list.rb', line 18

def initialize(apps, issue_assignee = "", issue_state = "open",
               issue_search_query = "", show_issues_count = false, issue_label = "",
               sandbox = false)
  super()
  @apps = apps
  @issue_state = issue_state
  @issue_assignee = issue_assignee
  @show_issues_count = show_issues_count
  @issue_search_query = issue_search_query
  @issue_label = issue_label
  @sandbox = sandbox
end

Instance Attribute Details

#appsObject

Returns the value of attribute apps.



15
16
17
# File 'lib/neetob/cli/github/issues/list.rb', line 15

def apps
  @apps
end

#issue_assigneeObject

Returns the value of attribute issue_assignee.



15
16
17
# File 'lib/neetob/cli/github/issues/list.rb', line 15

def issue_assignee
  @issue_assignee
end

#issue_labelObject

Returns the value of attribute issue_label.



15
16
17
# File 'lib/neetob/cli/github/issues/list.rb', line 15

def issue_label
  @issue_label
end

#issue_search_queryObject

Returns the value of attribute issue_search_query.



15
16
17
# File 'lib/neetob/cli/github/issues/list.rb', line 15

def issue_search_query
  @issue_search_query
end

#issue_stateObject

Returns the value of attribute issue_state.



15
16
17
# File 'lib/neetob/cli/github/issues/list.rb', line 15

def issue_state
  @issue_state
end

#sandboxObject

Returns the value of attribute sandbox.



15
16
17
# File 'lib/neetob/cli/github/issues/list.rb', line 15

def sandbox
  @sandbox
end

#show_issues_countObject

Returns the value of attribute show_issues_count.



15
16
17
# File 'lib/neetob/cli/github/issues/list.rb', line 15

def show_issues_count
  @show_issues_count
end

Instance Method Details

#runObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/neetob/cli/github/issues/list.rb', line 31

def run
  matching_apps = find_all_matching_apps(apps, :github, sandbox)
  matching_apps.each do |app|
    ui.info("\n  Issues of #{app}  \n")
    begin
      issues = client.search_issues(uri_with_query_options(app))
      ui.info("There are #{issues[:total_count]} issues with matching query") if show_issues_count
      table_rows = create_table(issues[:items])
      table = Terminal::Table.new headings: table_columns, rows: table_rows
      ui.success(table)
    rescue StandardError => e
      ExceptionHandler.new(e).process
    end
  end
end