http_streaming_client 0.8.8 → 0.8.9

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: 8308d062ebb595dddc19e1ce5232829fb92bd9ce
4
- data.tar.gz: cfbe2c60d0b7b021cbe09d80bee4ef8114115039
3
+ metadata.gz: cb3fd5a42dd28932b96ea17e46cef4d80b04071c
4
+ data.tar.gz: 75409d8168f3c569a02b7cdd864cad837f46b77f
5
5
  SHA512:
6
- metadata.gz: 50ee772c4e19aec32f3a771b1686b8beadd9d7fb2038cf08b0b65792f7b070f26b1bf74519c4f85deea9462e2a93df0939888d3c1233a383a6b21286ce93a6c1
7
- data.tar.gz: 323dec68b2c4d8730d4c9803358f142e721efc3aa2b08745625eacd4ea6b59351e2394a24ca739d5baa5ef64f1343f2060d538a7d3bc2c7f3b3fdded0f17d066
6
+ metadata.gz: 8570c1961c6583d85a59a20be4ccc0d7478d9cae728d168df956fed316b94505c8bdc43561c125e7fd60a63d60facb578e374f144f126f395e79bed34358cdcc
7
+ data.tar.gz: 4621c9db54fd9777ae4e9f07449700f522865fe8c668b33fc888f1efec5f43d4d13209748fd247471f4eefc620492b2b66d7b728f5da34e9d56bb93ef3fad5cf
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ http_streaming_client 0.8.9 (1.26.2014)
2
+ ========================================
3
+ * A few minor logging warn/debug changes
4
+
1
5
  http_streaming_client 0.8.8 (1.7.2014)
2
6
  ========================================
3
7
  * Fixed Issue #1, memory leak due to accumulated messages within the buffer pipeline
@@ -194,7 +194,7 @@ module HttpStreamingClient
194
194
  if response_head[:code] == 301 then
195
195
  location = response_head[:headers]["Location"]
196
196
  raise InvalidRedirect, "Unable to find Location header for HTTP 301 response" if location.nil?
197
- logger.debug "Received HTTP 301 redirect to #{location}, following..."
197
+ logger.warn "Received HTTP 301 redirect to #{location}, following..."
198
198
  socket.close if !socket.nil? and !socket.closed?
199
199
  opts.delete(:socket)
200
200
  return request(method, location, opts, &block)
@@ -351,7 +351,7 @@ module HttpStreamingClient
351
351
  end
352
352
  rescue => e
353
353
  return if @interrupted
354
- logger.debug "Error Detected: #{e}" unless e.instance_of? ReconnectRequest
354
+ logger.error "Error Detected: #{e}" unless e.instance_of? ReconnectRequest
355
355
  decoder.close if !decoder.nil?
356
356
  socket.close if !socket.nil? and !socket.closed?
357
357
  opts.delete(:socket)
@@ -28,5 +28,5 @@
28
28
  ###########################################################################
29
29
 
30
30
  module HttpStreamingClient
31
- VERSION = "0.8.8"
31
+ VERSION = "0.8.9"
32
32
  end
data/spec/adobe_spec.rb CHANGED
@@ -9,78 +9,6 @@ include HttpStreamingClient::Credentials::Adobe
9
9
 
10
10
  describe HttpStreamingClient do
11
11
 
12
- describe "adobe firehose streaming get test, no compression" do
13
-
14
- url = TOKENAPIHOST
15
- authorization = HttpStreamingClient::Oauth::Adobe.generate_authorization(url, USERNAME, PASSWORD, CLIENTID, CLIENTSECRET)
16
-
17
- subject { authorization }
18
- it { should_not be_nil}
19
- it { should be_instance_of(String) }
20
-
21
- line_count = 0
22
-
23
- it "should successfully retrieve JSON records from the firehose" do
24
- expect {
25
- client = HttpStreamingClient::Client.new(compression: false)
26
- begin
27
- status = Timeout::timeout(TIMEOUT_SEC) {
28
- response = client.get(STREAMURL, {:headers => {'Authorization' => "Bearer #{authorization}" }}) { |line|
29
-
30
- if line.nil? then
31
- logger.debug "error:nil line received"
32
- next
33
- end
34
-
35
- if line.size == 0 then
36
- logger.debug "error:zero length line received"
37
- next
38
- end
39
-
40
- line_count = line_count + 1
41
-
42
- if line.eql? "\r\n" then
43
- logger.debug "Server ping received"
44
- else
45
- logger.debug "#{JSON.parse(line).to_s}"
46
- end
47
-
48
- client.interrupt if line_count > NUM_JSON_RECORDS_TO_RECEIVE }
49
- }
50
- rescue Timeout::Error
51
- logger.debug "Timeout occurred, #{TIMEOUT_SEC} seconds elapsed"
52
- client.interrupt
53
- end
54
- }.to_not raise_error
55
- end
56
- end
57
-
58
- describe "adobe firehose streaming get test, no compression, no block" do
59
-
60
- url = TOKENAPIHOST
61
- authorization = HttpStreamingClient::Oauth::Adobe.generate_authorization(url, USERNAME, PASSWORD, CLIENTID, CLIENTSECRET)
62
-
63
- subject { authorization }
64
- it { should_not be_nil}
65
- it { should be_instance_of(String) }
66
-
67
- line_count = 0
68
-
69
- it "should successfully retrieve JSON records from the firehose" do
70
- expect {
71
- client = HttpStreamingClient::Client.new(compression: false)
72
- begin
73
- status = Timeout::timeout(5) {
74
- response = client.get(STREAMURL, {:headers => {'Authorization' => "Bearer #{authorization}" }})
75
- }
76
- rescue Timeout::Error
77
- logger.debug "Timeout occurred, #{TIMEOUT_SEC} seconds elapsed"
78
- client.interrupt
79
- end
80
- }.to_not raise_error
81
- end
82
- end
83
-
84
12
  describe "adobe firehose streaming get test, GZIP compression" do
85
13
 
86
14
  url = TOKENAPIHOST
@@ -111,7 +39,7 @@ describe HttpStreamingClient do
111
39
 
112
40
  line_count = line_count + 1
113
41
 
114
- if line.eql? "\r\n" then
42
+ if line.eql? "\r\n" or line.eql? "\r\n\r\n" then
115
43
  logger.debug "Server ping received"
116
44
  else
117
45
  logger.debug "#{JSON.parse(line).to_s}"
@@ -26,7 +26,7 @@ response = client.get(STREAMURL, {:headers => {'Authorization' => "Bearer #{auth
26
26
  next
27
27
  end
28
28
 
29
- if line.eql? "\r\n" then
29
+ if line.eql? "\r\n" or line.eql? "\r\n\r\n" then
30
30
  puts "Server ping received"
31
31
  next
32
32
  end
@@ -41,7 +41,7 @@ response = client.get(STREAMURL, {:headers => {'Authorization' => "Bearer #{auth
41
41
  next
42
42
  end
43
43
 
44
- if line.eql? "\r\n" then
44
+ if line.eql? "\r\n" or line.eql? "\r\n\r\n" then
45
45
  puts "Server ping received"
46
46
  next
47
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_streaming_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Tompkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2014-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler