fastlane-plugin-discord_webhook 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58687b16f95e449ab2018b13640cb50265bdf952187d958dd34d53b3e8784740
4
- data.tar.gz: 275fb0893156ba816893dc3941a97237fb8e657c488c6d7e1abb09f1853018b5
3
+ metadata.gz: b0321cbe2bda0fd6f25a2334c7f1fc8fad24b232efcfd350236e0018137edf00
4
+ data.tar.gz: 0d8b960e8c7aeb55b8056c66eec1df7d2057a10940a620fdaeb16e3aba74def7
5
5
  SHA512:
6
- metadata.gz: 380970309b01d0790783ffccb3a0d637b5ba2af68d8826c3c2fc54c6507124151540b96abd21cd85fb782e20f17d660ed34219082317ec5c845bf4b8f6240a40
7
- data.tar.gz: 1b4062e167256fbea60934ff8912b19af080917359807d0a49c307b7a8221a2f7a710579b85994612978e910ae6ddb2c462a81a7715fec9291c263d85b3835ee
6
+ metadata.gz: 22a53efd41173d9d6a3e5fcdad36505d9f7a457c887cede09232d35d0e3c2b35263318e2d50b0e0a5337d438de87430229e6f16731e27a875adae40f43ac4bdd
7
+ data.tar.gz: c9962ad15f652ea557dec11aea66a23cf8382b2d70f0f2f73a84eaac5277d4f1bd7c33f394c211d58f16df8568537eef05c547e180b677d738f73421a687f361
@@ -27,17 +27,17 @@ module Fastlane
27
27
  embed_payload: embed_payload
28
28
  )
29
29
  handle_response(response)
30
- rescue Socket::ResolutionError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError => e
30
+ rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError => e
31
31
  UI.user_error!(e.message)
32
32
  end
33
33
  end
34
34
 
35
35
  def self.description
36
- "Send a message using Discord Webhook"
36
+ 'Send a message using Discord Webhook'
37
37
  end
38
38
 
39
39
  def self.authors
40
- ["Takuma Homma"]
40
+ ['Takuma Homma']
41
41
  end
42
42
 
43
43
  def self.return_value
@@ -45,15 +45,15 @@ module Fastlane
45
45
  end
46
46
 
47
47
  def self.details
48
- "Send a message using Discord Webhook"
48
+ 'Send a message using Discord Webhook'
49
49
  end
50
50
 
51
51
  def self.available_options
52
52
  [
53
53
  FastlaneCore::ConfigItem.new(
54
54
  key: :webhook_url,
55
- env_name: "FL_DISCORD_WEBHOOK_URL",
56
- description: "Discord Webhook URL",
55
+ env_name: 'FL_DISCORD_WEBHOOK_URL',
56
+ description: 'Discord Webhook URL',
57
57
  optional: false,
58
58
  type: String,
59
59
  verify_block: proc do |value|
@@ -62,22 +62,22 @@ module Fastlane
62
62
  ),
63
63
  FastlaneCore::ConfigItem.new(
64
64
  key: :message,
65
- env_name: "FL_DISCORD_WEBHOOK_MESSAGE",
66
- description: "The message you want to send",
65
+ env_name: 'FL_DISCORD_WEBHOOK_MESSAGE',
66
+ description: 'The message you want to send',
67
67
  optional: true,
68
68
  type: String
69
69
  ),
70
70
  FastlaneCore::ConfigItem.new(
71
71
  key: :username,
72
- env_name: "FL_DISCORD_WEBHOOK_USERNAME",
73
- description: "[Optional] Username",
72
+ env_name: 'FL_DISCORD_WEBHOOK_USERNAME',
73
+ description: '[Optional] Username',
74
74
  optional: true,
75
75
  type: String
76
76
  ),
77
77
  FastlaneCore::ConfigItem.new(
78
78
  key: :attachment_file_path,
79
- env_name: "FL_DISCORD_WEBHOOK_ATTACHMENT_FILE_PATH",
80
- description: "[Optional] File path to upload",
79
+ env_name: 'FL_DISCORD_WEBHOOK_ATTACHMENT_FILE_PATH',
80
+ description: '[Optional] File path to upload',
81
81
  optional: true,
82
82
  type: String,
83
83
  verify_block: proc do |value|
@@ -89,8 +89,8 @@ module Fastlane
89
89
  # See: https://discord.com/developers/docs/resources/message#embed-object
90
90
  FastlaneCore::ConfigItem.new(
91
91
  key: :embed_payload,
92
- env_name: "FL_DISCORD_WEBHOOK_EMBED_PAYLOAD",
93
- description: "[Optional] Embed Object. You can specify one object. See details: https://discord.com/developers/docs/resources/message#embed-object",
92
+ env_name: 'FL_DISCORD_WEBHOOK_EMBED_PAYLOAD',
93
+ description: '[Optional] Embed Object. You can specify one object. See details: https://discord.com/developers/docs/resources/message#embed-object',
94
94
  optional: true,
95
95
  type: Hash
96
96
  )
@@ -114,7 +114,7 @@ module Fastlane
114
114
  else
115
115
  parsed
116
116
  end
117
- rescue StandardError => e
117
+ rescue JSON::ParserError
118
118
  body
119
119
  end
120
120
  UI.user_error!("Failed to send a message to Discord: #{error_body}")
@@ -35,28 +35,28 @@ module Fastlane
35
35
  uri = URI.parse(@webhook_url)
36
36
  request = Net::HTTP::Post.new(uri)
37
37
  embed_payload_content = if embed_payload.nil? || embed_payload.empty?
38
- []
39
- else
40
- [embed_payload]
41
- end
38
+ []
39
+ else
40
+ [embed_payload]
41
+ end
42
42
  payload_json = if !username.nil? && !username.empty?
43
- {
44
- username: username,
45
- content: content,
46
- embeds: embed_payload_content,
47
- allowed_mentions: {
48
- parse: ['users', 'roles'],
49
- }
50
- }
51
- else
52
- {
53
- content: content,
54
- embeds: embed_payload_content,
55
- allowed_mentions: {
56
- parse: ['users', 'roles'],
57
- }
58
- }
59
- end
43
+ {
44
+ username: username,
45
+ content: content,
46
+ embeds: embed_payload_content,
47
+ allowed_mentions: {
48
+ parse: ['users', 'roles'],
49
+ }
50
+ }
51
+ else
52
+ {
53
+ content: content,
54
+ embeds: embed_payload_content,
55
+ allowed_mentions: {
56
+ parse: ['users', 'roles'],
57
+ }
58
+ }
59
+ end
60
60
  request.set_form(
61
61
  [
62
62
  [
@@ -87,10 +87,10 @@ module Fastlane
87
87
  request = Net::HTTP::Post.new(uri)
88
88
  request.content_type = 'application/json'
89
89
  embed_payload_content = if embed_payload.nil? || embed_payload.empty?
90
- []
91
- else
92
- [embed_payload]
93
- end
90
+ []
91
+ else
92
+ [embed_payload]
93
+ end
94
94
 
95
95
  body = {
96
96
  content: content,
@@ -14,10 +14,10 @@ module Fastlane
14
14
  uri = URI.parse(webhook_url)
15
15
  request = Net::HTTP::Post.new(uri)
16
16
  payload_json = if !username.nil? && !username.empty?
17
- { username: username, content: content }
18
- else
19
- { content: content }
20
- end
17
+ { username: username, content: content }
18
+ else
19
+ { content: content }
20
+ end
21
21
  request.set_form(
22
22
  [
23
23
  [
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module DiscordWebhook
3
- VERSION = "0.2.0"
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,16 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-discord_webhook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuma Homma
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-28 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
12
  email: nagomimatcha@gmail.com
15
13
  executables: []
16
14
  extensions: []
@@ -28,7 +26,8 @@ licenses:
28
26
  - MIT
29
27
  metadata:
30
28
  rubygems_mfa_required: 'true'
31
- post_install_message:
29
+ source_code_uri: https://github.com/mataku/fastlane-plugin-discord_webhook
30
+ changelog_uri: https://github.com/mataku/fastlane-plugin-discord_webhook/blob/v0.3.0/CHANGELOG.md
32
31
  rdoc_options: []
33
32
  require_paths:
34
33
  - lib
@@ -36,15 +35,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
36
35
  requirements:
37
36
  - - ">="
38
37
  - !ruby/object:Gem::Version
39
- version: '2.7'
38
+ version: '3.2'
40
39
  required_rubygems_version: !ruby/object:Gem::Requirement
41
40
  requirements:
42
41
  - - ">="
43
42
  - !ruby/object:Gem::Version
44
43
  version: '0'
45
44
  requirements: []
46
- rubygems_version: 3.5.16
47
- signing_key:
45
+ rubygems_version: 4.0.16
48
46
  specification_version: 4
49
47
  summary: A lightweight fastlane plugin to send a message via Discord Webhook
50
48
  test_files: []