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: f37bc6e5c06f2d530cfb9e3fd77659143a7b2815d9739ad0c02ff2fbaae4720c
4
- data.tar.gz: 9a08a65d33589b1d152f0032aa2a63936d3321a028548a217db46514c748f3c7
3
+ metadata.gz: 8c40be17b2db7c4bdfcc684e3c74132b7562896f29435ed2091933426ebd2fb8
4
+ data.tar.gz: a94dbc1602becac77c3b433db0b8125c80b43766c909b4af37f91ff6beb133e9
5
5
  SHA512:
6
- metadata.gz: 5866cb5412f7d3c78178cd4f474ca5e794dcbd11d76a07c9b36afb09f984ba2dc47d0db58fb99a050dc753274931630301cead247f6d547dc5f40506d9d3032d
7
- data.tar.gz: 9b692a48292e87e0d121bac459746aff61761eaf81306b60d9f745752a6c77fae67474af71b56fa7a622c65623c08deb736840b1d7c80095d5d8068636f8d6e1
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
- response = dingtalk_client.post uri, params
136
- info = response.body
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
- response = dingtalk2_client.post uri, params
160
- info = response.body
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"])
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module PgyerJvtd
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-pgyer_jvtd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - 陈磊的MacBook Pro