fastlane-plugin-notifyworker 0.1.3 → 0.1.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: b9610a3ec33621ad901939cf68101a4ea147384db22340559aaf0b6543b337ed
4
- data.tar.gz: 5a7ab504dff36157a86332840aa0463a64a210fca98bf40748364d1942ba062f
3
+ metadata.gz: 30df8665e0757bceba40daae19d013edcd77bf24db5e3b3e7776926eec1e379a
4
+ data.tar.gz: c5422713a080097c49f5c1aa3263d8e4fb54bf931eb30afa84c422c920077948
5
5
  SHA512:
6
- metadata.gz: 17a66ad3a6aaba5eca44b93042e77c148a30cd83c0e8e2bf2cf3cc88009d794fd9827966bae8ee9813cabdef9b954e1b3fd67b865fb6db79c276aa02134a0617
7
- data.tar.gz: a0c555c3b0390d14a1cb495661ef37809c8128c8edb1c30cf178037b7ab51ed4e453bcf41a102813ee9d131fad303d187b9fbe3c0ff8f56f36542da5f30f163c
6
+ metadata.gz: 55e6876c91e07f49535b3832fccf3b646d27fd9a933d743cfffabfc3bc2f1c4526e1a56721ca31bdaed0a4c6e942d61dd5d7a2ddedad5a01930f8e6eaa6eaa0e
7
+ data.tar.gz: b2c1c6f6aabd75295500530945ab4012bfcb3831e0021d63717932d986345a54322e87392a349b748b4525db80cde67ff20ae009a2ff45609f48c14ce66212d2
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  <!--
2
2
  * @Author: zluof
3
3
  * @Date: 2021-09-06 16:40:13
4
- * @LastEditTime: 2021-09-13 14:19:34
4
+ * @LastEditTime: 2022-04-02 15:53:30
5
5
  * @LastEditors: zluof
6
- * @Description:
6
+ * @Description:
7
7
  * @FilePath: /fastlane-plugin-notifyworker/README.md
8
8
  -->
9
+
9
10
  # notifyworker plugin
10
11
 
11
12
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-notifyworker)
@@ -28,6 +29,7 @@ notifyworker(
28
29
  atAll = "" #bool (optional paramter)
29
30
  )
30
31
  ```
32
+
31
33
  ## About notifyworker
32
34
 
33
35
  Notify some worker App's status
@@ -39,6 +41,7 @@ Notify some worker App's status
39
41
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
40
42
 
41
43
  **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
44
+
42
45
  ## Run tests for this plugin
43
46
 
44
47
  To run both the tests, and code style validation, run
@@ -48,6 +51,7 @@ rake
48
51
  ```
49
52
 
50
53
  To automatically fix many of the styling issues, use
54
+
51
55
  ```
52
56
  rubocop -a
53
57
  ```
@@ -14,10 +14,11 @@ module Fastlane
14
14
  updateDes = params[:updateDes]
15
15
  platform = params[:platform]
16
16
  atAll = params[:atAll]
17
+
17
18
  if platform.nil?
18
19
  platform = "DingTalk"
19
20
  end
20
-
21
+
21
22
  if updateDes.nil?
22
23
  updateDes = "app 更新了"
23
24
  end
@@ -36,6 +37,7 @@ module Fastlane
36
37
  c.request :url_encoded
37
38
  c.response :json, content_type: /\bjson$/
38
39
  c.adapter :net_http
40
+ # c.response :logger
39
41
  end
40
42
 
41
43
  params = {
@@ -70,7 +72,7 @@ module Fastlane
70
72
 
71
73
  _updateDes = "更新内容:#{updateDes}"
72
74
  if platform == "DingTalk"
73
-
75
+ UI.message "notify DingTalk ..."
74
76
  _news = {
75
77
  "msgtype" => "markdown",
76
78
  "markdown" => {
@@ -92,6 +94,7 @@ module Fastlane
92
94
  c.request :url_encoded
93
95
  c.response :json, content_type: /\bjson$/
94
96
  c.adapter :net_http
97
+ # c.response :logger
95
98
  end
96
99
 
97
100
  webhook_dingding_response = dingding_faraday.post webhook, _news.to_json
@@ -103,29 +106,35 @@ module Fastlane
103
106
 
104
107
  UI.message "Notify success, look DingTalk"
105
108
  else #Wechat
106
- UI.user_error!("Notifyworker Plugin Error: WeChatAPI has error, Please wait")
107
-
109
+ UI.message "notify WeChat ..."
110
+ _atll = ""
111
+ if atAll == true
112
+ _atll = "@all"
113
+ end
108
114
  _new = {
109
115
  "msgtype" => "markdown",
110
116
  "markdown" => {
111
- "content" => "# #{appInfo["buildName"]}\\n ### #{version} \\n ### #{size} \\n ### #{update_time} \\n ### #{_updateDes} \\n > [直接下载](#{download_url_path}) \\n"
117
+ "mentioned_list":[_atll],
118
+ "content" => "### 应用更新提醒 \n ##### #{_updateDes} \n ##### #{app_name}\n ##### #{app_type}\n##### #{version}\n##### #{size}\n##### #{update_time}\n > [二维码](#{pic_url}) \n\n > [安装测试](#{download_url_path}) \n"
112
119
  }
113
- }
114
- UI.message "_new #{_new}"
115
-
116
- weChat_faraday = Faraday.new(nil, conn_options) do |c|
117
- c.headers['Content-Type'] = 'application/json'
118
- c.request :multipart
119
- c.request :url_encoded
120
- c.response :json, content_type: /\bjson$/
121
- c.adapter :net_http
120
+ }
121
+
122
+ conn = Faraday.new() do |faraday|
123
+ faraday.request :url_encoded # form-encode POST params
124
+ # faraday.response :logger # log requests to STDOUT
125
+ faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
126
+ faraday.response :json, content_type: /\bjson$/
122
127
  end
123
-
124
- weChat_dingding_response = weChat_faraday.post webhook, _news.to_json
125
- weChat_dingding_body = weChat_dingding_response.body
126
- if weChat_dingding_response['errcode'] != 0
127
- UI.user_error!("#{weChat_dingding_response}")
128
- UI.user_error!("noti_person Plugin Error: #{weChat_dingding_response["errmsg"]}")
128
+ res = conn.post do |req|
129
+ req.url "#{ webhook }"
130
+ req.headers['Content-Type'] = 'application/json'
131
+ req.body = _new.to_json
132
+ end
133
+
134
+ webhook_weChat_body = res.body
135
+
136
+ if webhook_weChat_body['errcode'] != 0
137
+ UI.user_error!("noti_person Plugin Error: #{webhook_weChat_body["errmsg"]}")
129
138
  end
130
139
  UI.message "Notify success, look WeChat"
131
140
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Notifyworker
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-notifyworker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - zlfyuan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2022-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubygems_version: 3.1.4
170
+ rubygems_version: 3.3.7
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Notify some worker App's status