webhook 0.1.0 → 1.0.0
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/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/LICENSE.md +21 -0
- data/README.md +19 -3
- data/lib/webhook.rb +5 -0
- data/lib/webhook/version.rb +1 -1
- data/webhook.gemspec +7 -6
- metadata +28 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c08a1d244ef2a978800fcf47418934d8d505893
|
4
|
+
data.tar.gz: 281e5b221d00e9a09af92d5da658f5e2f680e42e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8e536f083a65dd88c3b11bec4c9474e5cccb2981351914ecc908dfbdc9442d6459b93a6edad3067dd2804d20bc4055b10b1d0ce4cf1d84f9f7d29e630b141f1
|
7
|
+
data.tar.gz: 5688dc36424407c1646cdd36bb8d058f33db3b315d9b7745f12f6c26268fd25cc883446ac44ba81470827d8f124eb2f45fde3d5b87cdc0401e1437c66a395781
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.3
|
data/.travis.yml
CHANGED
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Abletech Limited
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://codeclimate.com/github/AbleTech/webhook)
|
4
4
|
[](http://travis-ci.org/AbleTech/webhook)
|
5
5
|
|
6
|
-
Client library for making webhook calls. Compatible with Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, REE, JRuby 1.8 and 1.9.
|
6
|
+
Client library for making webhook calls. Compatible with Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1.0, 2.2.0, REE, JRuby 1.8 and 1.9.
|
7
7
|
|
8
8
|
There are no runtime dependencies.
|
9
9
|
|
@@ -11,11 +11,11 @@ There are no runtime dependencies.
|
|
11
11
|
|
12
12
|
Add this line to your application's Gemfile:
|
13
13
|
|
14
|
-
gem 'webhook', '~>
|
14
|
+
gem 'webhook', '~> 1.0.0'
|
15
15
|
|
16
16
|
And then execute:
|
17
17
|
|
18
|
-
$ bundle
|
18
|
+
$ bundle install
|
19
19
|
|
20
20
|
Or install it yourself as:
|
21
21
|
|
@@ -33,6 +33,22 @@ Or install it yourself as:
|
|
33
33
|
puts "Error (#{code}): {message}\n#{body}"
|
34
34
|
end
|
35
35
|
|
36
|
+
### Basic Authentication
|
37
|
+
|
38
|
+
If your webhook endpoint requires HTTP basic authentication, you can embed these in the supplied URL.
|
39
|
+
For example:
|
40
|
+
|
41
|
+
Webhook.post('http://myusername:mypassword@requestb.in/jdhdyfhd')
|
42
|
+
|
43
|
+
## Configuration
|
44
|
+
|
45
|
+
You can configure your webhook using the following block. If you are using Rails, you would
|
46
|
+
normally add this code block in `config/initializers/webhook.rb`
|
47
|
+
|
48
|
+
Webhook.configure do |config|
|
49
|
+
config.user_agent = "My Application"
|
50
|
+
end
|
51
|
+
|
36
52
|
## Testing
|
37
53
|
|
38
54
|
rake spec
|
data/lib/webhook.rb
CHANGED
@@ -35,6 +35,11 @@ module Webhook
|
|
35
35
|
uri = URI.parse(url)
|
36
36
|
use_ssl = (uri.scheme.downcase == 'https')
|
37
37
|
req = Net::HTTP::Post.new(uri.path, headers)
|
38
|
+
|
39
|
+
if uri.user && uri.password
|
40
|
+
req.basic_auth uri.user, uri.password
|
41
|
+
end
|
42
|
+
|
38
43
|
req.form_data = form_fields
|
39
44
|
|
40
45
|
begin
|
data/lib/webhook/version.rb
CHANGED
data/webhook.gemspec
CHANGED
@@ -7,9 +7,10 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Webhook::VERSION
|
8
8
|
s.authors = ["Nigel Ramsay"]
|
9
9
|
s.email = ["nigel.ramsay@abletech.co.nz"]
|
10
|
-
s.homepage = ""
|
11
|
-
s.summary = %q{
|
10
|
+
s.homepage = "https://github.com/AbleTech/webhook"
|
11
|
+
s.summary = %q{Client library for making webhook calls}
|
12
12
|
s.description = %q{Execute webhook callbacks easily}
|
13
|
+
s.licenses = ['MIT']
|
13
14
|
|
14
15
|
s.rubyforge_project = "webhook"
|
15
16
|
|
@@ -18,8 +19,8 @@ Gem::Specification.new do |s|
|
|
18
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
20
|
s.require_paths = ["lib"]
|
20
21
|
|
21
|
-
s.add_development_dependency "rake"
|
22
|
-
s.add_development_dependency "rspec"
|
23
|
-
s.add_development_dependency "vcr"
|
24
|
-
s.add_development_dependency "fakeweb"
|
22
|
+
s.add_development_dependency "rake", '~> 0.9'
|
23
|
+
s.add_development_dependency "rspec", '~> 2.9'
|
24
|
+
s.add_development_dependency "vcr", '~> 2.0'
|
25
|
+
s.add_development_dependency "fakeweb", '~> 0'
|
25
26
|
end
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webhook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nigel Ramsay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.9'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.9'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.9'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: vcr
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '2.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: fakeweb
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Execute webhook callbacks easily
|
@@ -73,10 +73,12 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
|
-
- .rspec
|
78
|
-
- .
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".ruby-version"
|
79
|
+
- ".travis.yml"
|
79
80
|
- Gemfile
|
81
|
+
- LICENSE.md
|
80
82
|
- README.md
|
81
83
|
- Rakefile
|
82
84
|
- lib/webhook.rb
|
@@ -90,8 +92,9 @@ files:
|
|
90
92
|
- spec/webhook/configuration_spec.rb
|
91
93
|
- spec/webhook_spec.rb
|
92
94
|
- webhook.gemspec
|
93
|
-
homepage:
|
94
|
-
licenses:
|
95
|
+
homepage: https://github.com/AbleTech/webhook
|
96
|
+
licenses:
|
97
|
+
- MIT
|
95
98
|
metadata: {}
|
96
99
|
post_install_message:
|
97
100
|
rdoc_options: []
|
@@ -99,20 +102,20 @@ require_paths:
|
|
99
102
|
- lib
|
100
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
104
|
requirements:
|
102
|
-
- -
|
105
|
+
- - ">="
|
103
106
|
- !ruby/object:Gem::Version
|
104
107
|
version: '0'
|
105
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
109
|
requirements:
|
107
|
-
- -
|
110
|
+
- - ">="
|
108
111
|
- !ruby/object:Gem::Version
|
109
112
|
version: '0'
|
110
113
|
requirements: []
|
111
114
|
rubyforge_project: webhook
|
112
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.4.8
|
113
116
|
signing_key:
|
114
117
|
specification_version: 4
|
115
|
-
summary:
|
118
|
+
summary: Client library for making webhook calls
|
116
119
|
test_files:
|
117
120
|
- spec/cassettes/requestbin/extra_headers.yml
|
118
121
|
- spec/cassettes/requestbin/no_params.yml
|
@@ -121,4 +124,3 @@ test_files:
|
|
121
124
|
- spec/spec_helper.rb
|
122
125
|
- spec/webhook/configuration_spec.rb
|
123
126
|
- spec/webhook_spec.rb
|
124
|
-
has_rdoc:
|