gridhook 0.1.0 → 0.1.1
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/README.md +8 -6
- data/config/routes.rb +3 -0
- data/lib/gridhook/config.rb +5 -1
- data/lib/gridhook/engine.rb +3 -0
- data/lib/gridhook/unfortunate_sendgrid_fix.rb +12 -0
- data/lib/gridhook/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd1b5b0d7fdd8ee2aabe014129eb68735f7e2559
|
|
4
|
+
data.tar.gz: aff3bde4721b9444ef3e1d33963438a40e5fdd8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be176c7e538cd9edd0d87681aee4b95176f594ff1e05db89da37d1abf47aa49a7567e8c7521d2fa576e4dce7ac1fd308987b9bd6271fa1e998aa26c6cf93b314
|
|
7
|
+
data.tar.gz: 48cec9955b1ac5884010856e1dd38729bec8d2111173d0b15d23a124aeb74388c1557969756d10523dc834a6bde2c4d92a99d9b9e417e23e0dc84d6c678ce38d
|
data/README.md
CHANGED
|
@@ -11,17 +11,14 @@ Add Gridhook to your application's Gemfile and run `bundle install`:
|
|
|
11
11
|
gem 'gridhook'
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Add a route for the default event handling endpoint that Gridhook provides:
|
|
15
|
-
|
|
16
|
-
```ruby
|
|
17
|
-
post '/email_event' => 'gridhook/events#create'
|
|
18
|
-
```
|
|
19
|
-
|
|
20
14
|
You must also tell Gridhook how to process your event. Simply add an
|
|
21
15
|
initializer in `config/initializers/gridhook.rb`:
|
|
22
16
|
|
|
23
17
|
```ruby
|
|
24
18
|
Gridhook.configure do |config|
|
|
19
|
+
# The path we want to receive events
|
|
20
|
+
config.event_receive_path = '/sendgrid/event'
|
|
21
|
+
|
|
25
22
|
config.event_processor = proc do |event|
|
|
26
23
|
# event is a Gridhook::Event object
|
|
27
24
|
EmailEvent.create! event.attributes
|
|
@@ -45,6 +42,11 @@ Gridhook.configure do |config|
|
|
|
45
42
|
end
|
|
46
43
|
```
|
|
47
44
|
|
|
45
|
+
## TODO
|
|
46
|
+
|
|
47
|
+
* More tests
|
|
48
|
+
* Integrate [parse webhook](http://sendgrid.com/docs/API_Reference/Webhooks/parse.html)
|
|
49
|
+
|
|
48
50
|
## More Information
|
|
49
51
|
|
|
50
52
|
* [SendGrid Webhooks](http://sendgrid.com/docs/API_Reference/Webhooks/index.html)
|
data/config/routes.rb
ADDED
data/lib/gridhook/config.rb
CHANGED
|
@@ -8,7 +8,11 @@ module Gridhook
|
|
|
8
8
|
yield config
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
class Config < Struct.new(:event_processor)
|
|
11
|
+
class Config < Struct.new(:event_processor, :event_receive_path)
|
|
12
|
+
def initialize(*)
|
|
13
|
+
self.event_receive_path = '/sendgrid/event'
|
|
14
|
+
super
|
|
15
|
+
end
|
|
12
16
|
end
|
|
13
17
|
|
|
14
18
|
end
|
data/lib/gridhook/engine.rb
CHANGED
data/lib/gridhook/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gridhook
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lee Jarvis
|
|
@@ -94,12 +94,14 @@ files:
|
|
|
94
94
|
- Rakefile
|
|
95
95
|
- app/controllers/gridhook/events_controller.rb
|
|
96
96
|
- config/initializers/gridhook.rb
|
|
97
|
+
- config/routes.rb
|
|
97
98
|
- gridhook.gemspec
|
|
98
99
|
- lib/gridhook.rb
|
|
99
100
|
- lib/gridhook/config.rb
|
|
100
101
|
- lib/gridhook/engine.rb
|
|
101
102
|
- lib/gridhook/errors.rb
|
|
102
103
|
- lib/gridhook/event.rb
|
|
104
|
+
- lib/gridhook/unfortunate_sendgrid_fix.rb
|
|
103
105
|
- lib/gridhook/version.rb
|
|
104
106
|
- test/dummy/README.rdoc
|
|
105
107
|
- test/dummy/Rakefile
|