rack-reqorder 0.5 → 0.6
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile +0 -1
- data/README.md +3 -3
- data/lib/rack/reqorder.rb +13 -2
- data/lib/rack/reqorder/monitor.rb +2 -1
- data/lib/rack/reqorder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cef69aa68defbc586329cb17eca47244d991bbe1
|
4
|
+
data.tar.gz: 74055f3c609c1dc40bbd9a50041890cb42b62b92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0852ea2f64e808e3bc60156564ecfd85cbaad5e43735a1da092dd5eb49c0bc19c64209539181905642ac88eb44b8463a707a21d5f04cd1d89f9f7beb3159ec65
|
7
|
+
data.tar.gz: c5eda0af38571b83b1f2dfaeeb05dd91a405ad0062cd2c65727778b7cc57ec5b5acdd3a67209d5562eca5c98474744e1de4d8c2aed432c7a430e15edd3fe731b
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,8 +6,8 @@ with [rack-reqorder-monitor](https://github.com/kollegorna/rack-reqorder-monitor
|
|
6
6
|
## Introduction
|
7
7
|
Simple gem that sits on top of Rack and can:
|
8
8
|
|
9
|
-
- monitors for exceptions
|
10
|
-
- record full requests/responses, based on a header
|
9
|
+
- monitors for exceptions and provides full details, like where it happened as well as the request details
|
10
|
+
- record full requests/responses timelined, based on a header
|
11
11
|
- record request/response statistics
|
12
12
|
|
13
13
|
It saves everything in MongoDB and exposes simple API for retrieving these data.
|
@@ -17,7 +17,7 @@ The API is very robust, built with the help of [mongoid_hash_query](https://gith
|
|
17
17
|
A simple, default, dashboard is build in ember can be found [here](https://github.com/kollegorna/rack-reqorder-monitor).
|
18
18
|
|
19
19
|
At the moment, Rails, Sinatra and Grape are supported.
|
20
|
-
We are looking forward to add support for Hanami (ex-
|
20
|
+
We are looking forward to add support for Hanami (ex-Lotus).
|
21
21
|
|
22
22
|
## Installation
|
23
23
|
|
data/lib/rack/reqorder.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rack/reqorder/version'
|
2
2
|
require 'active_support/inflector'
|
3
3
|
require 'mongoid'
|
4
|
-
require 'kaminari'
|
4
|
+
require 'kaminari/grape'
|
5
5
|
require 'rack/cors'
|
6
6
|
require 'kaminari/models/mongoid_extension'
|
7
7
|
require 'rack/reqorder/route_recognizers'
|
@@ -16,6 +16,17 @@ module Rack
|
|
16
16
|
attr_accessor :configuration
|
17
17
|
end
|
18
18
|
|
19
|
+
def self.clean_database!
|
20
|
+
[
|
21
|
+
:AppException, :AppFault, :HttpRequest, :HttpResponse, :Recording,
|
22
|
+
:RoutePath, :Statistic
|
23
|
+
].each do |model|
|
24
|
+
Object.const_get("#{self}::Models::#{model.to_s}").delete_all
|
25
|
+
end
|
26
|
+
|
27
|
+
return true
|
28
|
+
end
|
29
|
+
|
19
30
|
def self.configure
|
20
31
|
self.configuration ||= Configuration.new
|
21
32
|
yield(configuration)
|
@@ -49,7 +60,7 @@ module Rack
|
|
49
60
|
if Module.const_defined?(:Rails)
|
50
61
|
return Rails.env
|
51
62
|
else
|
52
|
-
return ENV['RAILS_ENV'] || ENV['RACK_ENV'] || '
|
63
|
+
return ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
|
53
64
|
end
|
54
65
|
end
|
55
66
|
|
@@ -30,7 +30,8 @@ module Rack::Reqorder::Monitor
|
|
30
30
|
|
31
31
|
before do
|
32
32
|
header 'Access-Control-Allow-Origin', '*'
|
33
|
-
header 'Access-Control-Allow-Methods', '
|
33
|
+
header 'Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD'
|
34
|
+
header 'Access-Control-Allow-Headers', 'Content-Type'
|
34
35
|
end
|
35
36
|
|
36
37
|
#collection routes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-reqorder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filippos Vasilakis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|