omnihooks 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/README.md +40 -19
- data/lib/omnihooks/version.rb +1 -1
- data/omnihooks.gemspec +1 -1
- metadata +13 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f8ed31eb8cc2700bd4478c12d3050c62e8a91e863c492078584b2840e1808dbd
|
4
|
+
data.tar.gz: eea3cd6d8f70ff68e20dfc1412c1fdeae0f4dea800b1be91217afc8b6771d82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f6778e10925e79babec7b15ab045597573bce5161a694aeb36c90b6308286f60c74b3b19e349d58eb4215643abd390330fc291aa136d0c8608647a4cb26ada6
|
7
|
+
data.tar.gz: 0f0b40f402d57f36781723fb2450f4816064868ff127a35e4bb86e820ab919d7750a8954f830b1bd4f4c76fade776f5f47bf73b17b13dcf1c61cb80cda6c2e6a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.4.5
|
data/README.md
CHANGED
@@ -1,31 +1,52 @@
|
|
1
|
-
# OmniHooks
|
1
|
+
# OmniHooks: Standardized Multi-Provider Webhooks
|
2
2
|
|
3
|
-
|
3
|
+
## Introduction
|
4
4
|
|
5
|
-
|
5
|
+
OmniHooks is a library that standardizes multi-provider webhooks for web applications. It was created to be powerful, flexible, and do as little as possible. Any developer can create strategies for OmniHooks that can handle webhooks via disparate systems.
|
6
6
|
|
7
|
-
|
7
|
+
In order to use OmniHooks in your applications, you will need to leverage one or more strategies. These strategies are generally released individually as RubyGems, and you can see a [community maintained list](https://github.com/dropstream/omnihooks/wiki/List-of-Strategies) on the wiki for this project.
|
8
8
|
|
9
|
-
|
10
|
-
gem 'omnihooks'
|
11
|
-
```
|
9
|
+
## Getting Started
|
12
10
|
|
13
|
-
|
11
|
+
Each OmniHook strategy is a Rack Middleware. That means that you can use it the same way that you use any other Rack middleware. For example, to use the built-in Developer strategy in a Sinatra application I might do this:
|
14
12
|
|
15
|
-
|
13
|
+
````ruby
|
14
|
+
require 'sinatra'
|
15
|
+
require 'omnihooks'
|
16
16
|
|
17
|
-
|
17
|
+
class MyApplication < Sinatra::Base
|
18
|
+
use Rack::Session::Cookie
|
19
|
+
use OmniHooks::Strategies::Developer
|
20
|
+
end
|
21
|
+
````
|
18
22
|
|
19
|
-
|
23
|
+
Because OmniHooks is built for multi-provider webhooks, I may want to leave room to run multiple strategies. For this, the built-in OmniHooks::Builder class gives you an easy way to specify multiple strategies.
|
20
24
|
|
21
|
-
|
25
|
+
````ruby
|
26
|
+
require 'sinatra'
|
27
|
+
require 'omnihooks'
|
22
28
|
|
23
|
-
|
29
|
+
class MyApplication < Sinatra::Base
|
30
|
+
use Rack::Session::Cookie
|
31
|
+
use OmniHooks::Builder do
|
32
|
+
provider :developer do |p|
|
33
|
+
p.configure do |c|
|
34
|
+
c.subscribe 'foo', Proc.new { |event| nil }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
provider :core_warehouse do |p|
|
38
|
+
p.configure do |c|
|
39
|
+
c.subscribe 'Shipment', Proc.new { |event| nil }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
````
|
24
45
|
|
25
|
-
##
|
46
|
+
## Logging
|
26
47
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
48
|
+
OmniHooks supports a configurable logger. By default, OmniHooks will log to STDOUT but you can configure this using `OmniHooks.config.logger`:
|
49
|
+
|
50
|
+
## Resources
|
51
|
+
|
52
|
+
The [OmniHooks Wiki](https://github.com/dropstream/omnihooks/wiki) has actively maintained in-depth documentation for OmniHooks. It should be your first stop if you are wondering about a more in-depth look at OmniHooks, how it works, and how to use it.
|
data/lib/omnihooks/version.rb
CHANGED
data/omnihooks.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_dependency "activesupport", ">= 3.1"
|
21
|
-
spec.add_dependency 'rack',
|
21
|
+
spec.add_dependency 'rack', ">= 1.2", "< 3"
|
22
22
|
spec.add_dependency 'hashie', ['>= 1.2', '< 4']
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnihooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Falconer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.2'
|
34
|
+
- - "<"
|
32
35
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
36
|
+
version: '3'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.2'
|
44
|
+
- - "<"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
46
|
+
version: '3'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: hashie
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
150
|
- !ruby/object:Gem::Version
|
145
151
|
version: '0'
|
146
152
|
requirements: []
|
147
|
-
|
148
|
-
rubygems_version: 2.4.8
|
153
|
+
rubygems_version: 3.0.6
|
149
154
|
signing_key:
|
150
155
|
specification_version: 4
|
151
156
|
summary: A generalized framework for multiple-provider webhooks subscriptions.
|