Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions activehook.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "connection_pool", "~> 2.2"
spec.add_runtime_dependency "puma", "~> 3.4"
spec.add_runtime_dependency "rack"
spec.add_runtime_dependency "httparty"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "minitest", "~> 5.0"
Expand Down
2 changes: 2 additions & 0 deletions lib/activehook/hook.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'securerandom'

module ActiveHook
class Hook
attr_accessor :token, :uri, :id, :key, :retry_max, :retry_time, :created_at
Expand Down
2 changes: 2 additions & 0 deletions lib/activehook/server/launcher.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'optparse'

module ActiveHook
module Server
# Handles the start of the ActiveHook server via command line
Expand Down
8 changes: 5 additions & 3 deletions lib/activehook/server/send.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'httparty'

module ActiveHook
REQUEST_HEADERS = {
"Content-Type" => "application/json",
Expand Down Expand Up @@ -30,12 +32,12 @@ def success?
private

def post_hook
http = Net::HTTP.new(uri.host, uri.port)
measure_response_time do
@response = http.post(uri.path, @hook.final_payload, final_headers)
@response = HTTParty.post(uri.to_s, body: @hook.final_payload, headers: final_headers)
end
response_status(@response)
rescue
rescue e
puts(e)
:error
end

Expand Down