request_recorder 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- request_recorder (0.2.0)
4
+ request_recorder (0.2.1)
5
5
  activerecord
6
6
  multi_json
7
7
  rack
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/> ![Enable](http://cdn.craig.is/img/chromelogger/toggle.gif)
30
30
  - Open console<br/> ![Profit](https://dl.dropboxusercontent.com/u/2670385/Web/request_recorder_output.png)
31
31
 
32
- Frontend
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`.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/mgrosser/code/tools/request_recorder
3
3
  specs:
4
- request_recorder (0.1.2)
4
+ request_recorder (0.2.0)
5
5
  activerecord
6
6
  multi_json
7
7
  rack
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/mgrosser/code/tools/request_recorder
3
3
  specs:
4
- request_recorder (0.1.2)
4
+ request_recorder (0.2.0)
5
5
  activerecord
6
6
  multi_json
7
7
  rack
@@ -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
- {"X-ChromeLogger-Data" => Base64.encode64(MultiJson.dump(data).encode("UTF-8")).gsub("\n", "")}
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)
@@ -1,3 +1,3 @@
1
1
  module RequestRecorder
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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: -617741979871775185
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: -617741979871775185
115
+ hash: 3001746926882152200
116
116
  requirements: []
117
117
  rubyforge_project:
118
118
  rubygems_version: 1.8.25