ocean-wechat 0.1.1 → 0.1.2
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 +4 -4
- data/.gitignore +2 -0
- data/README.md +18 -5
- data/lib/ocean/wechat/version.rb +1 -1
- data/lib/ocean/wechat.rb +1 -1
- data/ocean-wechat-0.1.0.gem +0 -0
- data/ocean-wechat-0.1.1.gem +0 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce60b039f69c5c091f565666baffdbbe3368945c072579a8dd5d75a9ffb46089
|
4
|
+
data.tar.gz: e92c6ae902bbd6dccdf45f9723194072e1f29401990afd5290b3a282e24cdd09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43049edceeda6c121450ce3456e51056885b7c3ef3ca19aa7c04e6f0ae0f9348852252dd5c0139febe3f919b8fc3f7d7a53711a2e330dd94b69f5f8fe868ee3b
|
7
|
+
data.tar.gz: 500d0057720fc1224ee5db1120c57ecc01edccc1901632fb55a6ac414c8fada7d8d2ba1f2d8af119b94a7a1c0fbdefaa64140043a5d6ed9c79a105a99a798071
|
data/README.md
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# Ocean::Wechat
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ocean/wechat`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
2
|
+
Implement wechat interface for OceanEx
|
6
3
|
|
7
4
|
## Installation
|
8
5
|
|
@@ -22,7 +19,23 @@ Or install it yourself as:
|
|
22
19
|
|
23
20
|
## Usage
|
24
21
|
|
25
|
-
|
22
|
+
1. Add wechat_notify.yml file to config
|
23
|
+
2. ADD `WECHAT_APP_ID ` and `WECHAT_APP_SECRET` to ENV
|
24
|
+
3. Current support four notify event: `crash, fault, maintain, deploy`, example:
|
25
|
+
```ruby
|
26
|
+
# crash
|
27
|
+
Ocean::Wechat.notify(event: 'crash', first: 'Your website is not accessible', time: Time.now, reason: 'Connect fail!', remark: 'remark', redirect_url: 'www.baidu.com')
|
28
|
+
|
29
|
+
# fault
|
30
|
+
Ocean::Wechat.notify(event: 'fault', first: 'There is a bug in your website', keyword1: 'Peatio server', keyword2: '60.38.123.2', keyword3: 'Code error', redirect_url: 'www.baidu.com')
|
31
|
+
|
32
|
+
# maintain
|
33
|
+
Ocean::Wechat.notify(event: 'maintain', first: 'Server maintain', keyword1: Time.now, keyword2: Time.now+10.hours, keyword3: 'Upgrade system', redirect_url: 'www.baidu.com')
|
34
|
+
|
35
|
+
# deploy
|
36
|
+
Ocean::Wechat.notify(event: 'deploy', first: 'Deploy code to peatio', keyword1: 'Peatio', keyword2: 'Peatio server', keyword3: 'v1.2', keyword4: 'Success', redirect_url: 'www.baidu.com')
|
37
|
+
```
|
38
|
+
|
26
39
|
|
27
40
|
## Development
|
28
41
|
|
data/lib/ocean/wechat/version.rb
CHANGED
data/lib/ocean/wechat.rb
CHANGED
@@ -37,7 +37,7 @@ module Ocean
|
|
37
37
|
end
|
38
38
|
|
39
39
|
[].tap do |item|
|
40
|
-
wechat_notify(args[:event], 'users').each do |open_id|
|
40
|
+
wechat_notify(args[:event], 'users').split(',').each do |open_id|
|
41
41
|
item << {
|
42
42
|
open_id: open_id,
|
43
43
|
success: notify_block.call(open_id)[:errcode] == SUCCESS_CODE
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocean-wechat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bestjane
|
@@ -68,6 +68,8 @@ files:
|
|
68
68
|
- bin/setup
|
69
69
|
- lib/ocean/wechat.rb
|
70
70
|
- lib/ocean/wechat/version.rb
|
71
|
+
- ocean-wechat-0.1.0.gem
|
72
|
+
- ocean-wechat-0.1.1.gem
|
71
73
|
- ocean-wechat.gemspec
|
72
74
|
homepage: ''
|
73
75
|
licenses: []
|