easy_wechat 0.1.8 → 0.1.9

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: 48872ad0294d2609473c5b7481f600d9fa254ce2ecae297ff46199a3c70b96ef
4
- data.tar.gz: 5aed6510ce796d43370a23e3be8fbcd051c0c23b4ba3c2d2d43af2c21442367a
3
+ metadata.gz: 5e2af1c17c25a328079203cbd8c82bdf9e8f11365c35da169fd1b38fb7b855b5
4
+ data.tar.gz: 3a73e8b129d26b56c930515929ccaa002c19a1ab6cbbf343c21e7d76cc4669d5
5
5
  SHA512:
6
- metadata.gz: 84edf00b30e5af1c4dd9b697b98b9f40d84e26a33ba2b3941448e2576e9423d9670aaa1efe073e1e401a76c54b95a5f0ac3e9cd1662674d8db77498d73d1d8cc
7
- data.tar.gz: 3813a75d9e4d8a5c4bf5847f68dce1ed701714831cad1a0b2408acfdd80d7ccd2fc894de101f0965ecf943a91b787336349afd1a00497aadfcb811060fe0bf20
6
+ metadata.gz: ff4da1cb7fd1e297d5620a0ac78a297242c40bd14c61d41195e3e02af231daf4ca07cb8eb29fc3c1ac6ef6bd90591af06334bc5ca80820561fda9899317e3bf6
7
+ data.tar.gz: 834409eecc816689a3a2813f07d63151ed675f809c03f2ee408b26998e94e1ade858d40d94a530be7aa2af230379b3f1a1092bd6d921dcf7d95e7555bd6b9d1c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- easy_wechat (0.1.8)
4
+ easy_wechat (0.1.9)
5
5
  activesupport
6
6
  http-form_data
7
7
  httpx
@@ -91,8 +91,9 @@ module EasyWechat
91
91
  # 上传图文消息内的图片获取URL
92
92
  # https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Adding_Permanent_Assets.html
93
93
  def uploadimg(media)
94
+ # media path or Tempfile
94
95
  # https://honeyryderchuck.gitlab.io/httpx/wiki/Multipart-Uploads.html#notes
95
- file = media.is_a?(String) ? HTTP::FormData::File.new(media) : media
96
+ file = HTTP::FormData::File.new(media)
96
97
  resp = HTTPX.plugin(:multipart).post(UPLOADIMG_URL, params: { access_token: access_token }, form: { media: file })
97
98
 
98
99
  r = ::JSON.parse(resp.body, quirks_mode: true)
@@ -1,3 +1,3 @@
1
1
  module EasyWechat
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_wechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - 42up