ultrahook 0.1.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/lib/ultrahook.rb +0 -0
- data/lib/ultrahook/client.rb +12 -3
- data/lib/ultrahook/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f121751871d589fe219517b892a2a68259f72f2d6290ea180fc803ca8d13809b
|
4
|
+
data.tar.gz: 40d1424d65a17167fbdd2c687b53f830a0ce0228e014935baccc6c51a82bbc45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c14c4260e09e8d70f3ee75836584004cb82c1172b9aaf9a556e85a056db173cd774bc4da284b8f005ae2463c66c6bdb829f48d63a4e9ccdccba27e22b38f5cc4
|
7
|
+
data.tar.gz: 58595e2dde96869f35cf76be69716150a8d2050af60b953d7c362107e4d6cf404ff785e83d25368914cd7c4e473e1008f0a838b83a94db6c4cfb65246cb78047
|
data/LICENSE
CHANGED
data/lib/ultrahook.rb
CHANGED
File without changes
|
data/lib/ultrahook/client.rb
CHANGED
@@ -92,7 +92,7 @@ module UltraHook
|
|
92
92
|
|
93
93
|
def process_init(payload)
|
94
94
|
puts "Forwarding activated..."
|
95
|
-
puts "
|
95
|
+
puts "https://#{@ultrahook_host} -> #{@options["destination"]}"
|
96
96
|
end
|
97
97
|
|
98
98
|
def process_error(payload)
|
@@ -103,6 +103,14 @@ module UltraHook
|
|
103
103
|
puts "Warning: "+payload["message"]
|
104
104
|
end
|
105
105
|
|
106
|
+
def process_message(payload)
|
107
|
+
puts payload["message"]
|
108
|
+
end
|
109
|
+
|
110
|
+
def process_ping(payload)
|
111
|
+
# silent ack!
|
112
|
+
end
|
113
|
+
|
106
114
|
def full_path(uri)
|
107
115
|
return "/" if uri.path == "" && uri.query == ""
|
108
116
|
return "/?#{uri.query}" if uri.path == "" && uri.query != ""
|
@@ -128,7 +136,7 @@ module UltraHook
|
|
128
136
|
end
|
129
137
|
|
130
138
|
def retrieve_config
|
131
|
-
response = http_post(URI("
|
139
|
+
response = http_post(URI("https://www.ultrahook.com/init"), "key=#{@options["key"]}&host=#{@options["host"]}&version=#{UltraHook::VERSION}")
|
132
140
|
|
133
141
|
error "Could not retrieve config from server: #{response.code}" if response.code.to_i != 200
|
134
142
|
|
@@ -136,6 +144,7 @@ module UltraHook
|
|
136
144
|
if payload["success"] == true
|
137
145
|
@stream_url = payload["url"]
|
138
146
|
@namespace = payload["namespace"]
|
147
|
+
@ultrahook_host = payload["host"]
|
139
148
|
|
140
149
|
puts "Authenticated as #{@namespace}"
|
141
150
|
else
|
@@ -145,7 +154,7 @@ module UltraHook
|
|
145
154
|
|
146
155
|
def init_stream
|
147
156
|
uri = URI(@stream_url)
|
148
|
-
Net::HTTP.start(uri.host, uri.port) do |http|
|
157
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
149
158
|
begin
|
150
159
|
request = Net::HTTP::Get.new "#{uri.path}?#{uri.query}"
|
151
160
|
|
data/lib/ultrahook/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultrahook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinay Sahni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -57,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0'
|
59
59
|
requirements: []
|
60
|
-
|
61
|
-
rubygems_version: 2.4.8
|
60
|
+
rubygems_version: 3.0.6
|
62
61
|
signing_key:
|
63
62
|
specification_version: 4
|
64
63
|
summary: Receive webhooks on localhost
|