request_visualizer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
@@ -6,7 +6,7 @@ class RequestVisualizer
6
6
  end
7
7
 
8
8
  def parse(string)
9
- colorize((@lookup && @lookup.call(string.to_s)) || string.to_s)
9
+ colorize((@lookup && @lookup.call(string.to_s)) || smart_lookup(string.to_s))
10
10
  end
11
11
 
12
12
  def colorize(string)
@@ -71,4 +71,15 @@ class RequestVisualizer
71
71
  @@indent -= 5
72
72
  [status, headers, body]
73
73
  end
74
+
75
+ private
76
+
77
+ def smart_lookup(str)
78
+ str.gsub!("http://","")
79
+ str.gsub!("https://","")
80
+ str.split("/")[0] || str
81
+ rescue => e
82
+ return str
83
+ end
84
+
74
85
  end
@@ -1,3 +1,3 @@
1
1
  class RequestVisualizer
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request_visualizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-06-12 00:00:00.000000000 Z
12
+ date: 2013-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colored
@@ -34,6 +34,7 @@ executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
+ - .gitignore
37
38
  - Gemfile
38
39
  - Gemfile.lock
39
40
  - README
@@ -62,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
63
  version: '0'
63
64
  requirements: []
64
65
  rubyforge_project:
65
- rubygems_version: 1.8.24
66
+ rubygems_version: 1.8.25
66
67
  signing_key:
67
68
  specification_version: 3
68
69
  summary: Rack middleware for visualizing HTTP/JSON requests