webhook_system 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/webhook_system.rb +1 -1
- data/lib/webhook_system/job.rb +1 -1
- data/lib/webhook_system/version.rb +1 -1
- data/webhook_system.gemspec +1 -0
- metadata +22 -3
- data/lib/faraday_middleware/encoding.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c0a8c510a0ff3b55dc800d604b657c19f85059b
|
4
|
+
data.tar.gz: 5d165f95a27c935c7eb039724039a0e53c9203ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f3730e9316cb8d8b1148d5c7f4d1dd81dc86e24b15ca009d29933aadd242ff1181062a5b8f7f89a2c7ed515c1efa94e5cc7b0d58e9473d129ec8e1188c5a43b
|
7
|
+
data.tar.gz: 10a5a58ddc03c9b481377124b0346fef8656f39eb7f12dc7e2003935619f6fc23825c2c4fa40ef7b46d97b2b6bff456af8f9fb8101194832234863453b357e47
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v1.0.2](https://github.com/payrollhero/webhook_system/tree/v1.0.2) (2016-02-17)
|
4
|
+
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v1.0.1...v1.0.2)
|
5
|
+
|
6
|
+
- Feature/add faraday encoding middleware and db transaction check [\#6](https://github.com/payrollhero/webhook_system/pull/6) ([mykola-kyryk](https://github.com/mykola-kyryk))
|
7
|
+
|
3
8
|
## [v1.0.1](https://github.com/payrollhero/webhook_system/tree/v1.0.1) (2016-02-16)
|
4
9
|
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v1.0.0...v1.0.1)
|
5
10
|
|
data/lib/webhook_system.rb
CHANGED
data/lib/webhook_system/job.rb
CHANGED
@@ -58,7 +58,7 @@ module WebhookSystem
|
|
58
58
|
def self.build_client
|
59
59
|
Faraday.new do |faraday|
|
60
60
|
faraday.response :logger if ENV['WEBHOOK_DEBUG']
|
61
|
-
# use Faraday::Encoding middleware
|
61
|
+
# use Faraday::Encoding middleware
|
62
62
|
faraday.response :encoding
|
63
63
|
faraday.adapter Faraday.default_adapter
|
64
64
|
end
|
data/webhook_system.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_runtime_dependency 'activerecord', '> 3.2'
|
23
23
|
gem.add_runtime_dependency 'activejob'
|
24
24
|
gem.add_runtime_dependency 'faraday', '~> 0.9'
|
25
|
+
gem.add_runtime_dependency 'faraday-encoding', '>= 0.0.2', '< 1.0'
|
25
26
|
gem.add_runtime_dependency 'ph_model'
|
26
27
|
gem.add_runtime_dependency 'validate_url', '~> 1.0'
|
27
28
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webhook_system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Banasik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -67,6 +67,26 @@ dependencies:
|
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0.9'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: faraday-encoding
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.0.2
|
77
|
+
- - "<"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '1.0'
|
80
|
+
type: :runtime
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.0.2
|
87
|
+
- - "<"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
70
90
|
- !ruby/object:Gem::Dependency
|
71
91
|
name: ph_model
|
72
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,7 +288,6 @@ files:
|
|
268
288
|
- LICENSE.txt
|
269
289
|
- README.md
|
270
290
|
- Rakefile
|
271
|
-
- lib/faraday_middleware/encoding.rb
|
272
291
|
- lib/webhook_system.rb
|
273
292
|
- lib/webhook_system/base_event.rb
|
274
293
|
- lib/webhook_system/dispatcher.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# This is taken from https://github.com/ma2gedev/faraday-encoding,
|
2
|
-
# all credits for this goes to Takayuki Matsubara (takayuki.1229+github@gmail.com).
|
3
|
-
# We should be able to switch to the original gem when
|
4
|
-
# this PR (https://github.com/ma2gedev/faraday-encoding/pull/2) is merged.
|
5
|
-
module Faraday
|
6
|
-
class Faraday::Encoding < Faraday::Middleware
|
7
|
-
def call(environment)
|
8
|
-
@app.call(environment).on_complete do |env|
|
9
|
-
@content_charset = nil
|
10
|
-
if /;\s*charset=\s*(.+?)\s*(;|$)/.match(env[:response_headers][:content_type])
|
11
|
-
encoding = $1
|
12
|
-
encoding = 'utf-8' if encoding == 'utf8' # this is the actual fix
|
13
|
-
@content_charset = ::Encoding.find encoding rescue nil
|
14
|
-
end
|
15
|
-
env[:body].force_encoding @content_charset if @content_charset
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
Faraday::Response.register_middleware :encoding => Faraday::Encoding
|