http_baseline 2.0.2 → 2.0.3

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: 73cd1b28a7b4f51799375115a950ad12188b5f8d
4
- data.tar.gz: 9a7ae3bfc5b8c50cf8e6251841803810d06b91a6
3
+ metadata.gz: aeda321a0ed499f70ff1d5e1d86f438fdf715936
4
+ data.tar.gz: 0efe5d913f8745396f1f21ce01d3f4b7199f4bec
5
5
  SHA512:
6
- metadata.gz: 03ad3eb29b6b919541d2335e776f2a6afa655675141e8e7fe6bfc70c9301316184f84e7f28bf28a8ac16f56b7f52e0e4ed68fc42c99398067e1452595a2b5dcd
7
- data.tar.gz: 92e4fd2a76eb51761cd2811384c2f1b790967f117e354d9a28bf6a33b8aa04a3c1ba1a9291dec62e775598b905afc4906dbf105e267a3b84104d6efbb9381e3b
6
+ metadata.gz: 9a221cf0dd25904f99e1023294eb84cbd70af70ab3867f2fa425724971f4fe63a7f44da16e99491e2cd3c4f7128ccb532f91d91a862f127d94e924e0979fa376
7
+ data.tar.gz: 546bf9309373eb06558432e09cce759ff7c9d9ced0cc4264d28b829bb6eb33ae3e562874b652591dc9d9f88f3116ea153739a2a34db5b917a877f5054eb19543
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ language: ruby
2
+ script: "bundle exec rake spec"
3
+ env:
4
+ - CI=true
5
+ rvm:
6
+ - jruby-19mode
7
+ - 1.9.3
8
+ - 2.1.2
9
+ gemfile:
10
+ - Gemfile
11
+ notifications:
12
+ recipients:
13
+ - rlishtaba@rabbitmq.com
14
+ branches:
15
+ only:
16
+ - master
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # HTTP
2
2
 
3
- TODO: Write a gem description
3
+ ### Status
4
+ [![Build Status](https://travis-ci.org/simkimsia/UtilityBehaviors.png)](https://travis-ci.org/simkimsia/UtilityBehaviors)
4
5
 
5
6
  ## Installation
6
7
 
@@ -13,23 +13,29 @@ module HttpBaseline
13
13
  def_delegators :@logger, :debug, :info, :warn, :error, :fatal
14
14
 
15
15
  def call(env)
16
- debug "#{env.method} #{env.url.to_s}"
17
- debug('request') { dump_headers env.request_headers }
18
- debug('request') { env.body }
16
+ info('request') { '[%s] %s: %s' % ['TX', env.method.upcase, env.url.to_s] }
17
+ dump_headers(env.request_headers) do |line|
18
+ debug('response') { '[%s] %s' % ['TX', line] }
19
+ end
20
+ debug('request') { '[%s] %s' % ['TX', env.body] } if env.body
19
21
  super
20
22
  end
21
23
 
22
24
  def on_complete(env)
23
- debug('Status') { env.status.to_s }
24
- debug('response') { dump_headers env.response_headers }
25
- debug('response') { env.body }
25
+ info('status') { '[%s] %s' % ['RX', env.status.to_s] }
26
+ dump_headers(env.response_headers) do |line|
27
+ debug('response') { '[%s] %s' % ['RX', line] }
28
+ end
29
+ debug('response') { '[%s] %s' % ['RX', env.body] }
26
30
  end
27
31
 
28
32
  private
29
33
 
30
34
  def dump_headers(headers)
31
- headers.map { |k, v| "#{k}: #{v.inspect}" }.join("\n")
35
+ max = headers.keys.map { |k| k.length }.max + 2
36
+ headers.map { |k, v| yield "%-#{max}s: #{v.inspect}" % k }
32
37
  end
38
+
33
39
  end
34
40
  end
35
41
  end
@@ -1,6 +1,6 @@
1
1
  module HttpBaseline
2
2
  module Version
3
- MAJOR, MINOR, PATCH, PRE = 2, 0, 2
3
+ MAJOR, MINOR, PATCH, PRE = 2, 0, 3
4
4
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_baseline
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Lishtaba
@@ -200,6 +200,7 @@ extensions: []
200
200
  extra_rdoc_files: []
201
201
  files:
202
202
  - ".gitignore"
203
+ - ".travis.yml"
203
204
  - Gemfile
204
205
  - LICENSE.txt
205
206
  - README.md