-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.6.0 being pressed; CTA refactor and Stars reorganized
- Loading branch information
1 parent
ba7340a
commit 32bcef8
Showing
28 changed files
with
224 additions
and
137 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
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 |
---|---|---|
@@ -1,24 +1,23 @@ | ||
name: stellar | ||
version: 0.6.0 | ||
crystal: 0.31.1 | ||
crystal: 0.32.1 | ||
|
||
github: abstractive/stellar.cr | ||
|
||
description: Microservice-based application ecosystem framework | ||
|
||
executables: | ||
- stellar | ||
- galaxy | ||
#de - stellar | ||
|
||
authors: | ||
- digitalextremist <[email protected]> | ||
|
||
license: MIT | ||
|
||
targets: | ||
constellation: | ||
main: src/processes/constellation.cr | ||
cluster: | ||
main: src/processes/cluster.cr | ||
galaxy: | ||
main: lib/artillery/src/activate/battery.cr | ||
|
||
dependencies: | ||
artillery: | ||
|
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,13 @@ | ||
require "../integrations/slack" | ||
require "../integrations/sendgrid" | ||
|
||
module Stellar | ||
class Star | ||
module CallToAction | ||
|
||
include Stellar::Slack | ||
include Stellar::SendGrid | ||
|
||
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
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 |
---|---|---|
@@ -1,66 +1,2 @@ | ||
module Stellar | ||
module CTA | ||
def sendgrid_host_notice(template, subject) | ||
analyze_sendgrid_response SendGrid.templated_message({ | ||
subject: subject, | ||
from: host_email, | ||
to: [ host_email ], | ||
template_remote: "notify_host", | ||
template_local: "sendgrid/host/#{template}", | ||
model: @payload | ||
}) | ||
end | ||
|
||
def sendgrid_guest_notice(template, subject) | ||
analyze_sendgrid_response SendGrid.templated_message({ | ||
subject: subject, | ||
from: host_email, | ||
to: [ guest_email ], | ||
template_remote: "notify_guest", | ||
template_local: "sendgrid/guest/#{template}", | ||
model: @payload | ||
}) | ||
end | ||
|
||
def analyze_sendgrid_response(response) | ||
case response.status_code | ||
when 200 | ||
#de Success | ||
when 401 | ||
Slack.debug(":warning: We exceeded our `SendGrid` API usage for today.") | ||
when 429 | ||
Slack.debug(":warning: We overwhelmed the `SendGrid` API rate limiter.") | ||
else | ||
Slack.debug(":warning: Unanticipated `SendGrid` API error: #{response.status_code}") | ||
end | ||
end | ||
|
||
def slack_templated_message(template : String, channel = Slack::DEFAULT_CHANNEL) | ||
::Slack::Message.new(render_template("slack/#{template}", @payload), channel: channel) | ||
.send_to_hook(Slack::DEFAULT_URL) | ||
end | ||
|
||
def host_email | ||
{ | ||
name: "#{PRESENCE["name"]}", | ||
address: "#{PRESENCE["email"]}" | ||
} | ||
end | ||
|
||
def guest_email | ||
{ | ||
name: guest_full_name, | ||
address: "#{@payload["EmailAddress"]}" | ||
} | ||
end | ||
|
||
def guest_full_name | ||
name = "" | ||
name += "#{@payload["NameFirst"]} " | ||
if !(middle = "#{@payload["NameMiddle"]} ").empty? | ||
name += middle | ||
end | ||
name += "#{@payload["NameLast"]}" | ||
end | ||
end | ||
end | ||
require "../../stellar" | ||
require "./../stars/cta/**" |
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
Oops, something went wrong.