Class: Apadmi::Grout::DependencyInjector
- Inherits:
-
Struct
- Object
- Struct
- Apadmi::Grout::DependencyInjector
- Defined in:
- lib/apadmi/grout/di.rb
Overview
Convenience class for initializing and accessing the various actions
Instance Attribute Summary collapse
-
#board_service ⇒ Object
Returns the value of attribute board_service.
-
#find_tickets_to_move_action ⇒ Object
Returns the value of attribute find_tickets_to_move_action.
-
#generate_release_notes_action ⇒ Object
Returns the value of attribute generate_release_notes_action.
-
#issues_from_changelog_action ⇒ Object
Returns the value of attribute issues_from_changelog_action.
-
#move_tickets_action ⇒ Object
Returns the value of attribute move_tickets_action.
Class Method Summary collapse
- .bitrise_service(api_token, base_url, app_slug) ⇒ Object
- .init_for_ado(personal_access_token, base_url, logger = Apadmi::Grout::DefaultLogger.new, ado_config = Apadmi::Grout::AdoConfig.new( flag_tag: "FLAGGED" )) ⇒ Object
- .init_for_jira(username, token, base_url, context_path, project, logger = Apadmi::Grout::DefaultLogger.new) ⇒ Object
Instance Attribute Details
#board_service ⇒ Object
Returns the value of attribute board_service
6 7 8 |
# File 'lib/apadmi/grout/di.rb', line 6 def board_service @board_service end |
#find_tickets_to_move_action ⇒ Object
Returns the value of attribute find_tickets_to_move_action
6 7 8 |
# File 'lib/apadmi/grout/di.rb', line 6 def find_tickets_to_move_action @find_tickets_to_move_action end |
#generate_release_notes_action ⇒ Object
Returns the value of attribute generate_release_notes_action
6 7 8 |
# File 'lib/apadmi/grout/di.rb', line 6 def generate_release_notes_action @generate_release_notes_action end |
#issues_from_changelog_action ⇒ Object
Returns the value of attribute issues_from_changelog_action
6 7 8 |
# File 'lib/apadmi/grout/di.rb', line 6 def issues_from_changelog_action @issues_from_changelog_action end |
#move_tickets_action ⇒ Object
Returns the value of attribute move_tickets_action
6 7 8 |
# File 'lib/apadmi/grout/di.rb', line 6 def move_tickets_action @move_tickets_action end |
Class Method Details
.bitrise_service(api_token, base_url, app_slug) ⇒ Object
69 70 71 72 |
# File 'lib/apadmi/grout/di.rb', line 69 def self.bitrise_service(api_token, base_url, app_slug) network_service = Apadmi::Grout::NetworkService.new(api_token, base_url) Apadmi::Grout::BitriseService.new(app_slug, network_service) end |
.init_for_ado(personal_access_token, base_url, logger = Apadmi::Grout::DefaultLogger.new, ado_config = Apadmi::Grout::AdoConfig.new( flag_tag: "FLAGGED" )) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/apadmi/grout/di.rb', line 45 def self.init_for_ado( personal_access_token, base_url, logger = Apadmi::Grout::DefaultLogger.new, ado_config = Apadmi::Grout::AdoConfig.new( flag_tag: "FLAGGED" ) ) ticket_prefix = "#" network_service = Apadmi::Grout::NetworkService.init_for_basic_auth("", personal_access_token, base_url) ado_board_service = Apadmi::Grout::AdoBoardService.new(network_service, ado_config, logger) git_utils = Apadmi::Grout::GitUtils.new issues_from_changelog_action = Apadmi::Grout::IssuesFromChangelogAction.new(ado_board_service, ticket_prefix, logger) DependencyInjector.new( board_service: ado_board_service, move_tickets_action: Apadmi::Grout::MoveTicketsAction.new(ado_board_service, logger), issues_from_changelog_action: issues_from_changelog_action, find_tickets_to_move_action: Apadmi::Grout::FindTicketsToMoveAdoAction.new(ado_board_service, ticket_prefix, git_utils, issues_from_changelog_action, logger), generate_release_notes_action: Apadmi::Grout::GenerateReleaseNotesAction.new(Apadmi::Grout::AdoIssueClassifier.new) ) end |
.init_for_jira(username, token, base_url, context_path, project, logger = Apadmi::Grout::DefaultLogger.new) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/apadmi/grout/di.rb', line 20 def self.init_for_jira( username, token, base_url, context_path, project, logger = Apadmi::Grout::DefaultLogger.new ) network_service = Apadmi::Grout::NetworkService.init_for_basic_auth(username, token, base_url) jira_board_service = Apadmi::Grout::JiraBoardService.new(username, token, base_url, context_path, project, network_service) git_utils = Apadmi::Grout::GitUtils.new issues_from_changelog_action = Apadmi::Grout::IssuesFromChangelogAction.new(jira_board_service, "#{project}-", logger) DependencyInjector.new( board_service: jira_board_service, move_tickets_action: Apadmi::Grout::MoveTicketsAction.new(jira_board_service, logger), issues_from_changelog_action: issues_from_changelog_action, find_tickets_to_move_action: Apadmi::Grout::FindTicketsToMoveJiraAction.new(jira_board_service, git_utils, issues_from_changelog_action, logger), generate_release_notes_action: Apadmi::Grout::GenerateReleaseNotesAction.new(Apadmi::Grout::JiraIssueClassifier.new) ) end |