codeclimate-kafka 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4d8e754a10740c9e3c00721921c3a30bf3614fb
4
- data.tar.gz: 92d2c55a3369689870d9b5019ffd2e5e83411bdb
3
+ metadata.gz: c879ad2675e462df020c9ea423891e439c9a180c
4
+ data.tar.gz: 17736d6479420bcf9621f328fc8d841386a76074
5
5
  SHA512:
6
- metadata.gz: 1d0680001aec2fdec1c1e40aa7a8e1798b046f5ff2deda2d76cd83e9c8e794ea5f3253623b3c5d650dfe20966a6aae9c941bca6156493b83337a96362f890138
7
- data.tar.gz: 3257fe99d81ee0333b5c65ebb24424a568a1166be3f8f1386084fcb00dbbc9a8df678deb2f301d371f85a366e4c8b402123338ab4d09b5fb98df7bcb917b89d2
6
+ metadata.gz: 9780a0c3cc0dd70d150fc75b2c9929fad4ff2ad0d9055c9dce5dc38bad6bd2c36083b12253b8019b924ec6374aafa0d7d59c450d0a4fceed36713909259f49d4
7
+ data.tar.gz: 6ef034f1724bbe081dbcb5cb512d103f550136a7d93b8f84ccaffd436e7940e327d8ce1a5de41ec99d4213f755246acbd6f2ea56d99a206d1ec6665bad6a70ae
@@ -46,24 +46,20 @@ module CC
46
46
  end
47
47
 
48
48
  def send_http(serialized, key)
49
- data = {
50
- "topic" => topic,
51
- "message" => serialized,
52
- }
53
- data["key"] = key if key
54
-
55
49
  http = Net::HTTP.new(uri.host, uri.port)
56
50
  http.open_timeout = HTTP_TIMEOUT
57
51
  http.read_timeout = HTTP_TIMEOUT
58
- request = Net::HTTP::Post.new("/message")
59
- request.set_form_data(data)
52
+ request = Net::HTTP::Post.new("/")
53
+ request["Topic"] = topic
54
+ request["Key"] = key if key
55
+ request.body = serialized
60
56
 
61
- Kafka.logger.debug("POST #{uri.host}:#{uri.port}/message")
62
- Kafka.logger.debug("form data: #{data.inspect}")
57
+ Kafka.logger.debug("POST #{uri.host}:#{uri.port}/")
58
+ Kafka.logger.debug("data: #{serialized.inspect}")
63
59
  response = http.request(request)
64
60
 
65
61
  unless response.is_a?(Net::HTTPSuccess)
66
- raise HTTPError, "request not successful: #{response.inspect}"
62
+ raise HTTPError, "request not successful: (#{response.code}) #{response.body}"
67
63
  end
68
64
  end
69
65
 
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Kafka
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bson