notifiee-ruby 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -4
- data/lib/notifiee-ruby.rb +6 -6
- data/lib/{notifiee → notifiee_api}/client.rb +3 -3
- data/lib/{notifiee → notifiee_api}/exceptions.rb +1 -1
- data/lib/{notifiee → notifiee_api}/notifications.rb +2 -2
- data/lib/notifiee_api/version.rb +3 -0
- data/notifiee-ruby.gemspec +2 -2
- metadata +5 -5
- data/lib/notifiee/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ec9f9a09d362c37d94289dd2ded48beac4ab73633fb7df9fc027abb18d9a6ef
|
4
|
+
data.tar.gz: a964a4bf0189dbe3cec24aa9a70b92bc694d2fc6c4dab88b15065a2b68e8461d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0828198eaed0e4e3fa8c771449e8b0dd4877c7881c55e62c78432b32c5d37381b154f0605cf3c497cde6dc008431ff2908883230e89da68e4862ee23ba693813'
|
7
|
+
data.tar.gz: 4732da2793c3f3dbedb9f0b493500ebed16d07f4c4613d41e73f1b45c88619253fc2d28051e7502c16ef403c065c8c9787cac0d1909ed4f02b721fb2592a7b01
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[![Build Status](https://travis-ci.org/Notifiee/notifiee-ruby.svg?branch=master)](https://travis-ci.org/Notifiee/notifiee-ruby)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/notifiee-ruby.svg)](https://badge.fury.io/rb/notifiee-ruby)
|
2
3
|
# Notifiee
|
3
4
|
|
4
5
|
The Notifiee gem allows Ruby developers to programmatically send notifications to team members (via multiple channels like Email, SMS, Telegram, Slack, Messenger, and Twitter DMs) through the [Notifiee](https://notifiee.com) web service. The API is implemented as JSON over HTTP.
|
@@ -24,7 +25,7 @@ Or install globally:
|
|
24
25
|
First configure your API client:
|
25
26
|
|
26
27
|
```ruby
|
27
|
-
|
28
|
+
NotifieeAPI::Client.api_key = "YOUR_API_KEY"
|
28
29
|
```
|
29
30
|
|
30
31
|
In Rails projects this should go in a notifiee initializer and the API key should probably be set with an ENV variable:
|
@@ -32,7 +33,7 @@ In Rails projects this should go in a notifiee initializer and the API key shoul
|
|
32
33
|
```ruby
|
33
34
|
# config/initializers/notifiee.rb
|
34
35
|
|
35
|
-
|
36
|
+
NotifieeAPI::Client.api_key = ENV["YOUR_API_KEY"]
|
36
37
|
```
|
37
38
|
|
38
39
|
Your API key is associated with a project created within the [notifiee.com](https://notifiee.com) web interface. To get an API key you will need to sign up.
|
@@ -40,10 +41,10 @@ Your API key is associated with a project created within the [notifiee.com](http
|
|
40
41
|
Once the configuration is set you can send notifications in your code like this:
|
41
42
|
|
42
43
|
```ruby
|
43
|
-
|
44
|
+
NotifieeAPI.notify(:bob, [:telegram], 'Something happened in our app!')
|
44
45
|
|
45
46
|
# or with a subject
|
46
|
-
|
47
|
+
NotifieeAPI.notify(:bob, [:telegram], 'Something happened in our app!', subject: 'Our App Notification')
|
47
48
|
```
|
48
49
|
|
49
50
|
NOTE: `:bob` is a notifiee that you would have had to have created from within the [notifiee.com](https://notifiee.com) web interface and configured the Telegram channel for.
|
data/lib/notifiee-ruby.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require "
|
2
|
-
require "
|
3
|
-
require "
|
4
|
-
require "
|
1
|
+
require "notifiee_api/version"
|
2
|
+
require "notifiee_api/exceptions"
|
3
|
+
require "notifiee_api/client"
|
4
|
+
require "notifiee_api/notifications"
|
5
5
|
|
6
|
-
module
|
6
|
+
module NotifieeAPI
|
7
7
|
|
8
8
|
class << self
|
9
9
|
|
@@ -13,7 +13,7 @@ module Notifiee
|
|
13
13
|
channels: channels,
|
14
14
|
message: message
|
15
15
|
)
|
16
|
-
|
16
|
+
NotifieeAPI::Notifications.create(payload)
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
module
|
4
|
+
module NotifieeAPI
|
5
5
|
class Client
|
6
6
|
|
7
7
|
@base_url = 'api.notifiee.com'
|
@@ -64,9 +64,9 @@ module Notifiee
|
|
64
64
|
when Net::HTTPSuccess
|
65
65
|
response.body
|
66
66
|
when Net::HTTPUnauthorized
|
67
|
-
raise
|
67
|
+
raise NotifieeAPI::Unauthorized.new response.body
|
68
68
|
else
|
69
|
-
raise
|
69
|
+
raise NotifieeAPI::Error.new response.body
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
data/notifiee-ruby.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "
|
4
|
+
require "notifiee_api/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "notifiee-ruby"
|
8
|
-
spec.version =
|
8
|
+
spec.version = NotifieeAPI::VERSION
|
9
9
|
spec.authors = ["Gareth Fuller"]
|
10
10
|
spec.email = ["gareth@notifiee.com"]
|
11
11
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifiee-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gareth Fuller
|
@@ -102,10 +102,10 @@ files:
|
|
102
102
|
- bin/console
|
103
103
|
- bin/setup
|
104
104
|
- lib/notifiee-ruby.rb
|
105
|
-
- lib/
|
106
|
-
- lib/
|
107
|
-
- lib/
|
108
|
-
- lib/
|
105
|
+
- lib/notifiee_api/client.rb
|
106
|
+
- lib/notifiee_api/exceptions.rb
|
107
|
+
- lib/notifiee_api/notifications.rb
|
108
|
+
- lib/notifiee_api/version.rb
|
109
109
|
- notifiee-ruby.gemspec
|
110
110
|
homepage: https://github.com/Notifiee/notifiee-ruby.git
|
111
111
|
licenses:
|
data/lib/notifiee/version.rb
DELETED