webhook_system 1.0.2 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1e79d3307cae895f3ea016c4dd81c18c5b6354d
4
- data.tar.gz: 3a8cd5f259b506a2fbf305f718b997580dbd5cb4
3
+ metadata.gz: 9c0a8c510a0ff3b55dc800d604b657c19f85059b
4
+ data.tar.gz: 5d165f95a27c935c7eb039724039a0e53c9203ee
5
5
  SHA512:
6
- metadata.gz: f64d2e41f827ded493d94c87b2a0ddf8a1bba499111cd34599c006d799c557af9530c4cdbc80d2b7fbdbcb3122f6b0887937f26fffe40b0bb71e57386d278fc2
7
- data.tar.gz: 76a400599bfd625ea6fa85dc9e40d1cb3cf22200e8acc25118fb1dd8bcea20a7fe4901fdaa335119ab9ad2ed13b74c0ed263206664143c7c2a1b3bca0b7bf722
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
 
@@ -4,7 +4,7 @@ require 'active_job'
4
4
  require 'ph_model'
5
5
  require 'validate_url'
6
6
  require 'faraday'
7
- require 'faraday_middleware/encoding'
7
+ require 'faraday-encoding'
8
8
 
9
9
  module WebhookSystem
10
10
  extend ActiveSupport::Autoload
@@ -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, libfaraday_middleware/encoding.rb
61
+ # use Faraday::Encoding middleware
62
62
  faraday.response :encoding
63
63
  faraday.adapter Faraday.default_adapter
64
64
  end
@@ -1,3 +1,3 @@
1
1
  module WebhookSystem
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -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.2
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-17 00:00:00.000000000 Z
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