-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into finish_what_you_started
- Loading branch information
Showing
31 changed files
with
956 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Downstream | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: | ||
- trunk | ||
push: | ||
branches: | ||
- trunk | ||
|
||
jobs: | ||
check-dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Bundle Dependency Checks | ||
uses: convictional/trigger-workflow-and-wait@v1.6.1 | ||
with: | ||
owner: ideacrew | ||
repo: ic_dependency_jamboree | ||
github_token: ${{ secrets.GH_PAT }} | ||
workflow_file_name: test_bundle.yml | ||
ref: trunk | ||
propagate_failure: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
require "forwardable" | ||
|
||
module EventSource | ||
# Construct async api message object | ||
class Message | ||
extend Forwardable | ||
|
||
def initialize(options = {}) | ||
message_options = build_message(options) | ||
@message = create_message(message_options) | ||
end | ||
|
||
def_delegators :@message, :payload, :headers | ||
|
||
private | ||
|
||
def build_message(options) | ||
result = EventSource::Operations::BuildMessageOptions.new.call(options) | ||
unless result.success? | ||
raise EventSource::Error::MessageBuildError, | ||
"unable to build message options due to #{result.failure}" | ||
end | ||
result.success | ||
end | ||
|
||
def create_message(options) | ||
result = EventSource::Operations::CreateMessage.new.call(options) | ||
unless result.success? | ||
raise EventSource::Error::MessageBuildError, | ||
"unable to create message due to #{result.failure}" | ||
end | ||
result.success | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require "dry/monads" | ||
require "dry/monads/do" | ||
|
||
module EventSource | ||
module Operations | ||
# create message | ||
class BuildMessage | ||
include Dry::Monads[:result, :do] | ||
|
||
def call(params) | ||
values = yield build_options(params) | ||
message = yield create_message(values) | ||
|
||
Success(message) | ||
end | ||
|
||
private | ||
|
||
def build_options(params) | ||
result = BuildMessageOptions.new.call(params) | ||
result.success? ? result : Failure(result.errors.to_h) | ||
end | ||
|
||
def create_message(values) | ||
CreateMessage.new.call(values) | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.