net-ptth 0.0.11 → 0.0.12

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- net-ptth (0.0.11)
4
+ net-ptth (0.0.12)
5
5
  celluloid-io (~> 0.15.0)
6
6
  http_parser.rb (~> 0.5.3)
7
7
  rack (~> 1.4.5)
data/lib/net/ptth.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "uri"
2
2
  require "rack"
3
3
  require "net/http"
4
+ require "logger"
4
5
 
5
6
  require "net/ptth/socket"
6
7
  require "net/ptth/parser"
@@ -30,7 +31,7 @@ class Net::PTTH
30
31
 
31
32
  @host, @port = info.host, info.port || options.fetch(:port, 80)
32
33
  @keep_alive = options.fetch(:keep_alive, false)
33
- @debug_output = StringIO.new
34
+ set_debug_output = StringIO.new
34
35
  end
35
36
 
36
37
  # Public: Mimics Net::HTTP set_debug_output
@@ -39,6 +40,11 @@ class Net::PTTH
39
40
  #
40
41
  def set_debug_output=(output)
41
42
  @debug_output = output
43
+ Celluloid.logger = if output.is_a?(String)
44
+ ::Logger.new(output)
45
+ else
46
+ output
47
+ end
42
48
  end
43
49
 
44
50
  # Public: Closes de current connection
@@ -157,6 +163,7 @@ class Net::PTTH
157
163
  # string: The string to be logged
158
164
  #
159
165
  def debug(string)
166
+ return unless @debug_output
160
167
  @debug_output << string + "\n"
161
168
  end
162
169
  end
data/net-ptth.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "net-ptth"
3
- s.version = "0.0.11"
3
+ s.version = "0.0.12"
4
4
  s.summary = "Net::HTTP compatible reverse HTTP version"
5
5
  s.description = "PTTH Ruby client. Net::HTTP compatible... kind of"
6
6
  s.authors = ["elcuervo"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ptth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-21 00:00:00.000000000 Z
12
+ date: 2013-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack