wechat 0.16.0 → 0.16.2

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: 1907505b47d02aed8ba3a23bc42f90b864928bb4516c6a08af562a7da26babcb
4
- data.tar.gz: 615fe878b8b5fe6bfc176eb77c927957cad14b0fb71b65c6f891ddd850655ae0
3
+ metadata.gz: bc8214345aa67e306a93fb57034de6f8ecc898c630e5abb56f29424b8a360110
4
+ data.tar.gz: 7152a97b68aada44c5be152e57dbe55233efabe58124c9d36c73b560b213c51e
5
5
  SHA512:
6
- metadata.gz: 1aafb9ea5a0c1a1281810a0c28f7859de66851192d258939bd37e352dbe7ec5c70251418a41a70f0046a2da04230e8b925fef9bf6b3a7457d98feeb6de93d041
7
- data.tar.gz: a7b7acc261ce1051be6c8afa93a8f6eb8da2f5f0fc932fd0240d2a63cebfa257864dad3d63b20d0c75ae4c2e98e74a27318cad6cba0a0f63eae2b144d2d75d42
6
+ metadata.gz: aed67b12d96ee44e7ab75b8f3fe2bf5170379efd9b94e2d6fab8a92a4a5f99d477ea032a2d1826b3ddc73b195a42ca0f2f72d6a92d27632eb2de0be8c593d62d
7
+ data.tar.gz: 7c00e2715896186abfee532190aae993a766fc0a583f41545c62856a4d70554a6a365312a4d0d6e5eeba3e7259f6d552203e0079a70df73ed21677c924a63aa7
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.16.2 (released at 2022-12-09)
4
+
5
+ * Drop support ruby 2.6 and allow ruby 3.2 will released psych v5.0.0. by @iuhoay #314
6
+
7
+ ## v0.16.1 (released at 2022-07-20)
8
+
9
+ * Add api urllink.generate support. by @iuhoay #313
10
+ * Fix WARNING: Zeitwerk defines the constant ActionController after the directory
11
+
3
12
  ## v0.16.0 (released at 2022-06-06)
4
13
 
5
14
  * Support wechat draft. #305
data/bin/wechat CHANGED
@@ -230,6 +230,12 @@ class App < Thor
230
230
  puts wechat_api.wxa_msg_sec_check(content)
231
231
  end
232
232
 
233
+ desc 'wxa_generate_urllink [PATH]', '获取小程序 URL Link'
234
+ def wxa_generate_urllink(path)
235
+ body_hash = { path: path, expire_type: 0 }
236
+ puts wechat_api.wxa_generate_urllink(body_hash)
237
+ end
238
+
233
239
  desc 'media_uploadnews [MPNEWS_YAML_PATH]', '上传图文消息素材'
234
240
  def media_uploadnews(mpnews_yaml_path)
235
241
  mpnew = Wechat::ApiLoader.load_yaml(File.read(mpnews_yaml_path))
@@ -1,4 +1,5 @@
1
- default: &default
1
+ ---
2
+ default_setting: &default_setting
2
3
  corpid: "corpid"
3
4
  corpsecret: "corpsecret"
4
5
  agentid: 1
@@ -28,45 +29,45 @@ production:
28
29
  oauth2_cookie_duration: <%%= ENV['WECHAT_OAUTH2_COOKIE_DURATION'] %> # seconds
29
30
 
30
31
  development:
31
- <<: *default
32
+ <<: *default_setting
32
33
  trusted_domain_fullname: "http://your_dev.proxy.qqbrowser.cc"
33
34
 
34
35
  test:
35
- <<: *default
36
+ <<: *default_setting
36
37
 
37
38
  # Multiple Accounts
38
39
  #
39
40
  # wx2_development:
40
- # <<: *default
41
+ # <<: *default_setting
41
42
  # appid: "my_appid"
42
43
  # secret: "my_secret"
43
44
  # access_token: "tmp/wechat_access_token2"
44
45
  # jsapi_ticket: "tmp/wechat_jsapi_ticket2"
45
46
  #
46
47
  # wx2_test:
47
- # <<: *default
48
+ # <<: *default_setting
48
49
  # appid: "my_appid"
49
50
  # secret: "my_secret"
50
51
  #
51
52
  # wx2_production:
52
- # <<: *default
53
+ # <<: *default_setting
53
54
  # appid: "my_appid"
54
55
  # secret: "my_secret"
55
56
  #
56
57
  # wx3_development:
57
- # <<: *default
58
+ # <<: *default_setting
58
59
  # appid: "my_appid"
59
60
  # secret: "my_secret"
60
61
  # access_token: "tmp/wechat_access_token3"
61
62
  # jsapi_ticket: "tmp/wechat_jsapi_ticket3"
62
63
  #
63
64
  # wx3_test:
64
- # <<: *default
65
+ # <<: *default_setting
65
66
  # appid: "my_appid"
66
67
  # secret: "my_secret"
67
68
  #
68
69
  # wx3_production:
69
- # <<: *default
70
+ # <<: *default_setting
70
71
  # appid: "my_appid"
71
72
  # secret: "my_secret"
72
- #
73
+ #
@@ -43,7 +43,15 @@ module Wechat
43
43
  end
44
44
 
45
45
  def self.load_yaml(result)
46
- YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(result) : YAML.safe_load(result)
46
+ if YAML.respond_to?(:unsafe_load)
47
+ YAML.unsafe_load(result)
48
+ else
49
+ begin
50
+ YAML.safe_load(result, aliases: true)
51
+ rescue ArgumentError
52
+ YAML.safe_load(result)
53
+ end
54
+ end
47
55
  end
48
56
 
49
57
  private_class_method def self.loading_config!
@@ -104,6 +104,11 @@ module Wechat
104
104
  post 'msg_sec_check', JSON.generate(content: content), base: Wechat::Api::WXA_BASE
105
105
  end
106
106
 
107
+ def wxa_generate_urllink(body_hash)
108
+ # https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html
109
+ post 'generate_urllink', JSON.generate(body_hash), base: Wechat::Api::WXA_BASE
110
+ end
111
+
107
112
  def menu
108
113
  get 'menu/get'
109
114
  end
data/lib/wechat.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'zeitwerk'
4
4
  loader = Zeitwerk::Loader.for_gem
5
+ loader.ignore("#{__dir__}/action_controller")
5
6
  loader.ignore("#{__dir__}/generators/**/*.rb")
6
7
  loader.setup
7
8
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skinnyworm
@@ -11,31 +11,32 @@ bindir: bin
11
11
  cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
-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ICATE-----
38
- date: 2022-06-06 00:00:00.000000000 Z
39
+ date: 2022-12-09 00:00:00.000000000 Z
39
40
  dependencies:
40
41
  - !ruby/object:Gem::Dependency
41
42
  name: activesupport
@@ -85,20 +86,6 @@ dependencies:
85
86
  - - ">="
86
87
  - !ruby/object:Gem::Version
87
88
  version: 1.6.0
88
- - !ruby/object:Gem::Dependency
89
- name: psych
90
- requirement: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: 3.3.2
95
- type: :runtime
96
- prerelease: false
97
- version_requirements: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: 3.3.2
102
89
  - !ruby/object:Gem::Dependency
103
90
  name: thor
104
91
  requirement: !ruby/object:Gem::Requirement
@@ -270,15 +257,10 @@ licenses:
270
257
  metadata:
271
258
  bug_tracker_uri: https://github.com/Eric-Guo/wechat/issues
272
259
  changelog_uri: https://github.com/Eric-Guo/wechat/releases
273
- documentation_uri: https://github.com/Eric-Guo/wechat/tree/v0.16.0#readme
274
- source_code_uri: https://github.com/Eric-Guo/wechat/tree/v0.16.0
260
+ documentation_uri: https://github.com/Eric-Guo/wechat/tree/v0.16.2#readme
261
+ source_code_uri: https://github.com/Eric-Guo/wechat/tree/v0.16.2
275
262
  rubygems_mfa_required: 'true'
276
- post_install_message: |-
277
- *****WECHAT BREAK CHANGE*****
278
- Including correct version of `psych` after upgrade wechat, if not sure, using v3.3.2.
279
- Ruby 3.1’s incompatible changes to its YAML module (Psych 4), detail see:
280
- https://www.ctrl.blog/entry/ruby-psych4.html
281
- *****************************
263
+ post_install_message:
282
264
  rdoc_options: []
283
265
  require_paths:
284
266
  - lib
@@ -286,14 +268,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
286
268
  requirements:
287
269
  - - ">="
288
270
  - !ruby/object:Gem::Version
289
- version: '2.6'
271
+ version: '2.7'
290
272
  required_rubygems_version: !ruby/object:Gem::Requirement
291
273
  requirements:
292
274
  - - ">="
293
275
  - !ruby/object:Gem::Version
294
276
  version: 1.8.11
295
277
  requirements: []
296
- rubygems_version: 3.3.15
278
+ rubygems_version: 3.3.26
297
279
  signing_key:
298
280
  specification_version: 4
299
281
  summary: DSL for wechat message handling and API
metadata.gz.sig CHANGED
Binary file