request_recorder 0.2.0 → 0.2.1
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 +1 -1
- data/Readme.md +2 -2
- data/gemfiles/rails2.gemfile.lock +1 -1
- data/gemfiles/rails3.gemfile.lock +1 -1
- data/lib/request_recorder/middleware.rb +14 -7
- data/lib/request_recorder/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -25,11 +25,11 @@ Chrome console
|
|
25
25
|
==============
|
26
26
|
(needs `:frontend_auth`)
|
27
27
|
|
28
|
-
- Install [Chrome extension](https://chrome.google.com/webstore/detail/chrome-logger/noaneddfkdjfnfdakjjmocngnfkfehhd)
|
28
|
+
- Install [Chrome extension](https://chrome.google.com/webstore/detail/chrome-logger/noaneddfkdjfnfdakjjmocngnfkfehhd) by [Craig Campbell](http://craig.is)
|
29
29
|
- Enable it<br/> 
|
30
30
|
- Open console<br/> 
|
31
31
|
|
32
|
-
|
32
|
+
Web-frontend
|
33
33
|
========
|
34
34
|
(needs `:frontend_auth`)
|
35
35
|
See the log of all requests in an entire session: `/request_recorder/my_session_name`.
|
@@ -95,17 +95,24 @@ module RequestRecorder
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def chrome_logger_headers(log)
|
98
|
+
# fake chrome-logger format
|
99
|
+
rows = []
|
100
|
+
rows << [["Rails log"],"xxx.rb:1","group"]
|
101
|
+
rows.concat log.split("\n").map{|line| [remove_console_colors(line).split(" "), "xxx.rb:1", ""] }
|
102
|
+
rows << [[], "xxx.rb:1", "groupEnd"]
|
103
|
+
|
98
104
|
data = {
|
99
105
|
'version' => "0.1.1",
|
100
106
|
'columns' => [ 'log' , 'backtrace' , 'type' ],
|
101
|
-
'rows' =>
|
102
|
-
[
|
103
|
-
[["Rails log"],"xxx.rb:1","group"],
|
104
|
-
*log.split("\n").map{|line| [remove_console_colors(line).split(" "), "xxx.rb:1", ""] },
|
105
|
-
[[], "xxx.rb:1", "groupEnd"],
|
106
|
-
]
|
107
|
+
'rows' => rows
|
107
108
|
}
|
108
|
-
|
109
|
+
|
110
|
+
# encode
|
111
|
+
data = MultiJson.dump(data)
|
112
|
+
data = data.encode("UTF-8") if defined?(Encoding)
|
113
|
+
data = Base64.encode64(data).gsub("\n", "")
|
114
|
+
|
115
|
+
{"X-ChromeLogger-Data" => data}
|
109
116
|
end
|
110
117
|
|
111
118
|
def remove_console_colors(string)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: request_recorder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
segments:
|
105
105
|
- 0
|
106
|
-
hash:
|
106
|
+
hash: 3001746926882152200
|
107
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
segments:
|
114
114
|
- 0
|
115
|
-
hash:
|
115
|
+
hash: 3001746926882152200
|
116
116
|
requirements: []
|
117
117
|
rubyforge_project:
|
118
118
|
rubygems_version: 1.8.25
|