fastlane-plugin-pgyer_jvtd 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c40be17b2db7c4bdfcc684e3c74132b7562896f29435ed2091933426ebd2fb8
|
4
|
+
data.tar.gz: a94dbc1602becac77c3b433db0b8125c80b43766c909b4af37f91ff6beb133e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d664142292be35b08cd85277f3eb85a561b8b8a8da8845a4aed1bb4522933faff4aa1dbb59725999851fe8f6abf358c43ad301d9c33ab14001540f7bedf81832
|
7
|
+
data.tar.gz: aa129f8d106cf2fdbc9ec57a04beb2bdc55e3813d44b9375e27e2c8b11d0bf206506f154766b3ddf8c8e1ce1fe9323356d23d8d15492f20ebf257df76a1ed43d
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'faraday_middleware'
|
3
|
+
require 'fastlane/action'
|
4
|
+
require_relative '../helper/pgyer_jvtd_helper'
|
3
5
|
|
4
6
|
module Fastlane
|
5
7
|
module Actions
|
@@ -114,13 +116,10 @@ module Fastlane
|
|
114
116
|
end
|
115
117
|
|
116
118
|
unless access_token.nil?
|
119
|
+
|
117
120
|
uriStr = "https://oapi.dingtalk.com/robot/send?access_token=#{access_token}";
|
118
121
|
uri = URI.parse(uriStr)
|
119
122
|
UI.success uriStr
|
120
|
-
dingtalk_client = Faraday.new(nil, conn_options) do |c|
|
121
|
-
c.request :url_encoded
|
122
|
-
c.response :json, content_type: /\bjson$/
|
123
|
-
end
|
124
123
|
|
125
124
|
params = {
|
126
125
|
"msgtype" => "link",
|
@@ -132,18 +131,18 @@ module Fastlane
|
|
132
131
|
}
|
133
132
|
}
|
134
133
|
|
135
|
-
|
136
|
-
|
134
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
135
|
+
https.use_ssl = true
|
136
|
+
req = Net::HTTP::Post.new(uri.request_uri)
|
137
|
+
req.body = params.to_json
|
138
|
+
req.content_type = 'application/json'
|
139
|
+
resp = https.request(req)
|
140
|
+
info = JSON.parse(resp.body)
|
137
141
|
|
138
142
|
if info['errcode'] != 0
|
139
143
|
UI.error('ding talk error message: ' + info["errmsg"])
|
140
144
|
end
|
141
145
|
|
142
|
-
dingtalk2_client = Faraday.new(nil, conn_options) do |c|
|
143
|
-
c.request :url_encoded
|
144
|
-
c.response :json, content_type: /\bjson$/
|
145
|
-
end
|
146
|
-
|
147
146
|
params = {
|
148
147
|
"msgtype" => "text",
|
149
148
|
"text" => {
|
@@ -155,9 +154,13 @@ module Fastlane
|
|
155
154
|
}
|
156
155
|
}
|
157
156
|
|
158
|
-
|
159
|
-
|
160
|
-
|
157
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
158
|
+
https.use_ssl = true
|
159
|
+
req = Net::HTTP::Post.new(uri.request_uri)
|
160
|
+
req.body = params.to_json
|
161
|
+
req.content_type = 'application/json'
|
162
|
+
resp = https.request(req)
|
163
|
+
info = JSON.parse(resp.body)
|
161
164
|
|
162
165
|
if info['errcode'] != 0
|
163
166
|
UI.error('ding talk error message: ' + info["errmsg"])
|