Class: Wassup::Panes::CircleCI::Workflows
- Inherits:
-
Object
- Object
- Wassup::Panes::CircleCI::Workflows
- Defined in:
- lib/wassup/panes/circleci.rb
Instance Attribute Summary collapse
-
#org ⇒ Object
Returns the value of attribute org.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#vcs ⇒ Object
Returns the value of attribute vcs.
Instance Method Summary collapse
- #configure(pane) ⇒ Object
-
#initialize(vcs:, org:, repo:) ⇒ Workflows
constructor
A new instance of Workflows.
Constructor Details
#initialize(vcs:, org:, repo:) ⇒ Workflows
Returns a new instance of Workflows.
9 10 11 12 13 |
# File 'lib/wassup/panes/circleci.rb', line 9 def initialize(vcs:, org:, repo:) @vcs = vcs @org = org @repo = repo end |
Instance Attribute Details
#org ⇒ Object
Returns the value of attribute org.
6 7 8 |
# File 'lib/wassup/panes/circleci.rb', line 6 def org @org end |
#repo ⇒ Object
Returns the value of attribute repo.
7 8 9 |
# File 'lib/wassup/panes/circleci.rb', line 7 def repo @repo end |
#vcs ⇒ Object
Returns the value of attribute vcs.
5 6 7 |
# File 'lib/wassup/panes/circleci.rb', line 5 def vcs @vcs end |
Instance Method Details
#configure(pane) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/wassup/panes/circleci.rb', line 15 def configure(pane) pane.content do |content| workflows = Helpers::CircleCI.workflows(vcs: vcs, org: org, repo: repo, limit_days: 14) workflows.each do |workflow| display = Helpers::CircleCI::Formatter.workflow(workflow) content.add_row(display, workflow) end end pane.selection('enter', 'Open workflow in browser') do |workflow| slug = workflow["project_slug"] pipeline_number = workflow["pipeline_number"] workflow_id = workflow["id"] url = "https://app.circleci.com/pipelines/#{slug}/#{pipeline_number}/workflows/#{workflow_id}" `open #{url}` end end |