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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0a59062bb573b2b23fbc4a9fd79b1ec0c6bd86da75bdadc7182fbef530e4fd0
4
- data.tar.gz: 8d5052896d617d42b9d0309fc02d56079aa5eaad991fd7a4333b923a4b2948ab
3
+ metadata.gz: ce60b039f69c5c091f565666baffdbbe3368945c072579a8dd5d75a9ffb46089
4
+ data.tar.gz: e92c6ae902bbd6dccdf45f9723194072e1f29401990afd5290b3a282e24cdd09
5
5
  SHA512:
6
- metadata.gz: 25e273cb62ce790f09e25f0c6002e65aafd5dc9b1f012437a1fe24687fa33c08769571297deb0cf01b1bd47398621edfca16b2bd17929f28c0cada156690a84f
7
- data.tar.gz: a53b4e5b6e01b8686c897b3d67198ce694a5e592bdae8c2da9a1c9adbd8bdf121d87c0412ebec69e4c043b6756bd207ed2625ed43179084d83326a2388e00aa0
6
+ metadata.gz: 43049edceeda6c121450ce3456e51056885b7c3ef3ca19aa7c04e6f0ae0f9348852252dd5c0139febe3f919b8fc3f7d7a53711a2e330dd94b69f5f8fe868ee3b
7
+ data.tar.gz: 500d0057720fc1224ee5db1120c57ecc01edccc1901632fb55a6ac414c8fada7d8d2ba1f2d8af119b94a7a1c0fbdefaa64140043a5d6ed9c79a105a99a798071
data/.gitignore CHANGED
@@ -6,3 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+
10
+ .idea/
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
- TODO: Write usage instructions here
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
 
@@ -1,5 +1,5 @@
1
1
  module Ocean
2
2
  module Wechat
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
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.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: []