Skip to content

Commit

Permalink
Update rubies
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGauld committed Apr 5, 2021
1 parent 5cfe03b commit e689845
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 36 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/commit-checks.yml
Expand Up @@ -62,10 +62,10 @@ jobs:
strategy:
matrix:
ruby: [
'2.6.0', '2.6.1', '2.6.2', '2.6.3', '2.6.4', '2.6.5', '2.6.6',
'2.7.0', '2.7.1', '2.7.2',
'3.0.0',
'truffleruby-20.1.0', 'truffleruby-20.2.0', 'truffleruby-20.3.0'
'2.6.0', '2.6.1', '2.6.2', '2.6.3', '2.6.4', '2.6.5', '2.6.6', '2.6.7',
'2.7.0', '2.7.1', '2.7.2', '2.7.3',
'3.0.0', '3.0.1',
'truffleruby-20.1.0', 'truffleruby-20.2.0', 'truffleruby-20.3.0', 'truffleruby-21.0.0'
]
steps:
- uses: actions/checkout@v2
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/slack_bot_action_ran.yml
@@ -1,9 +1,10 @@
---
name: Slack Bot - Action Ran

on:
workflow_run:
workflows:
- "Commit Checks"
- 'Commit Checks'
types:
- completed

Expand All @@ -17,14 +18,15 @@ jobs:
CONCLUSION=$(jq '.workflow_run.conclusion' $GITHUB_EVENT_PATH | tr -d '"')
LINK_HREF=$(jq '.workflow_run.html_url' $GITHUB_EVENT_PATH | tr -d '"')
WORKFLOW=$(jq '.workflow_run.name' $GITHUB_EVENT_PATH | tr -d '"')
REPOSITORY=$(jq '.workflow_run.head_repository.full_name' $GITHUB_EVENT_PATH | tr -d '"')
REPOSITORY=$(jq '.workflow_run.head_repository.full_name' $GITHUB_EVENT_PATH | tr -d '"')
BRANCH=$(jq '.workflow_run.head_branch' $GITHUB_EVENT_PATH | tr -d '"')
COMMIT=$(jq '.workflow_run.head_sha' $GITHUB_EVENT_PATH | tr -d '"')
CHANNEL=$(([ -z "${{ secrets.SLACK_BOT_CHANNEL }}" ] && echo "$(jq '.workflow_run.head_repository.full_name|split("/")|.[1]' $GITHUB_EVENT_PATH | tr -d '"')") || echo "${{ secrets.SLACK_BOT_CHANNEL }}")
slackMsg() {
title=$1
color=$2
msg="{
\"channel\":\"gandi_v5\",
\"channel\":\"$CHANNEL\",
\"attachments\": [
{
\"title\":\"$title: $WORKFLOW on $REPOSITORY/$BRANCH\",
Expand All @@ -34,8 +36,11 @@ jobs:
}
]
}"
echo $msg
curl -X POST -H "Content-type: application/json; charset=utf-8" -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" -d "$msg" https://slack.com/api/chat.postMessage
result=$(curl -X POST -H "Content-type: application/json; charset=utf-8" -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" -d "$msg" https://slack.com/api/chat.postMessage)
# echo $msg
echo $result
echo $result | grep '"ok":true'
}
if [ $CONCLUSION = 'success' ]; then
slackMsg "SUCCESS" "#00FF00"
Expand All @@ -44,4 +49,3 @@ jobs:
else
slackMsg "FAILED" "#FF0000"
fi
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -7,10 +7,10 @@
This gem supports the following versions of ruby, it may work on other versions but is not tested against them so don't rely on it.

* ruby:
* 2.6.0 - 2.6.6
* 2.7.0 - 2.7.2
* 3.0.0
* truffleruby 20.1.0 - 20.3.0
* 2.6.0 - 2.6.7
* 2.7.0 - 2.7.3
* 3.0.0 - 3.0.1
* truffleruby 20.1.0 - 21.0.0

This gem doesn't yet support the following versions of ruby, although hopefully it soon will.

Expand Down
22 changes: 10 additions & 12 deletions lib/gandi_v5/data.rb
Expand Up @@ -22,19 +22,17 @@ def self.included(host_class)
# Get a hash representation of the object.
# @return [Hash<Symbol => Object>]
def to_h
Hash[
data_members.map do |key|
value = send(key)
next [key, value] if value.nil?

if value.is_a?(Enumerable)
value = to_h_transform_enumerable(value)
elsif value.respond_to?(:to_h)
value = value.to_h
end
[key, value]
data_members.map do |key|
value = send(key)
next [key, value] if value.nil?

if value.is_a?(Enumerable)
value = to_h_transform_enumerable(value)
elsif value.respond_to?(:to_h)
value = value.to_h
end
]
[key, value]
end.to_h
end

# Get a hash representation of this object suitable for passing back to Gandi.
Expand Down
8 changes: 4 additions & 4 deletions lib/gandi_v5/domain.rb
Expand Up @@ -84,10 +84,10 @@ class Domain
hash = hash.transform_keys(&:to_sym)
.transform_values { |value| GandiV5::Domain::Contact.from_gandi value }

hash.define_singleton_method(:owner) { send :'[]', :owner }
hash.define_singleton_method(:admin) { send :'[]', :admin }
hash.define_singleton_method(:bill) { send :'[]', :bill }
hash.define_singleton_method(:tech) { send :'[]', :tech }
hash.define_singleton_method(:owner) { send :[], :owner }
hash.define_singleton_method(:admin) { send :[], :admin }
hash.define_singleton_method(:bill) { send :[], :bill }
hash.define_singleton_method(:tech) { send :[], :tech }

hash
}
Expand Down
2 changes: 1 addition & 1 deletion lib/gandi_v5/domain/transfer_in.rb
Expand Up @@ -136,7 +136,7 @@ def self.fetch(fqdn)
transfer.instance_exec { @duration = data.dig('params', 'duration') }
if data.key?('foa')
transfer.instance_exec do
@foa_status = Hash[data['foa'].map { |hash| hash.values_at('email', 'answer') }]
@foa_status = data['foa'].map { |hash| hash.values_at('email', 'answer') }.to_h
end
end
transfer
Expand Down
2 changes: 1 addition & 1 deletion lib/gandi_v5/simple_hosting/instance/virtual_host.rb
Expand Up @@ -48,7 +48,7 @@ class VirtualHost
member(
:certificates,
converter: GandiV5::Data::Converter.new(
from_gandi: ->(array) { Hash[array.map { |h| [h['id'], h['pending']] }] }
from_gandi: ->(array) { array.map { |h| [h['id'], h['pending']] }.to_h }
)
)

Expand Down
8 changes: 4 additions & 4 deletions spec/units/gandi_v5/template_spec.rb
Expand Up @@ -224,10 +224,10 @@
create = {
name: 'template name',
description: 'description of template',
'dns_records': [{ name: 'host', ttl: 600, type: 'TXT', values: ['value'] }],
'mailboxes': %w[user1 user2],
'name_servers': ['1.1.1.1', '2.2.2.2'],
'web_forwardings': [
dns_records: [{ name: 'host', ttl: 600, type: 'TXT', values: ['value'] }],
mailboxes: %w[user1 user2],
name_servers: ['1.1.1.1', '2.2.2.2'],
web_forwardings: [
{ type: :http302, target: 'example.com', host: 'here', override: true, protocol: :https_only }
]
}
Expand Down

0 comments on commit e689845

Please sign in to comment.