Ocean::Wechat

Implement wechat interface for OceanEx

Installation

Add this line to your application's Gemfile:

gem 'ocean-wechat'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ocean-wechat

Usage

  1. Add wechat_notify.yml file to config
  2. ADD WECHAT_APP_ID and WECHAT_APP_SECRET to ENV
  3. Current support four notify event: crash, fault, maintain, deploy, example: ```ruby # crash Ocean::Wechat.notify(event: 'crash', first: 'Your website is not accessible', time: Time.now, reason: 'Connect fail!', remark: 'remark', redirect_url: 'www.baidu.com')

fault

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')

maintain

Ocean::Wechat.notify(event: 'maintain', first: 'Server maintain', keyword1: Time.now, keyword2: Time.now+10.hours, keyword3: 'Upgrade system', redirect_url: 'www.baidu.com')

deploy

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')



## Development

After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ocean-wechat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## Code of Conduct

Everyone interacting in the Ocean::Wechat project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/ocean-wechat/blob/master/CODE_OF_CONDUCT.md).