rack-reqorder 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0d9d5b4fe1dadfe5ec2b8f248fb7862378ddd1b
4
- data.tar.gz: 238cce079cb09e7ef03f9d11b756a5da73386557
3
+ metadata.gz: cef69aa68defbc586329cb17eca47244d991bbe1
4
+ data.tar.gz: 74055f3c609c1dc40bbd9a50041890cb42b62b92
5
5
  SHA512:
6
- metadata.gz: b2c55e3216b4d70fc7fe3711b328781c5fad3e18526d545827d7163d150e9713cd871e8d9e7c2bf559b97075de58c0be47aff23a34261e5e1a3f33dc45ebc433
7
- data.tar.gz: 91c820d63adea800dd5c5ad1fec1c6257da3c26728822ca3fc7da43ec962cf4c8a9aea65da4d1658634fa93c795a1d70694a3602900a32915211891584e41cfc
6
+ metadata.gz: 0852ea2f64e808e3bc60156564ecfd85cbaad5e43735a1da092dd5eb49c0bc19c64209539181905642ac88eb44b8463a707a21d5f04cd1d89f9f7beb3159ec65
7
+ data.tar.gz: c5eda0af38571b83b1f2dfaeeb05dd91a405ad0062cd2c65727778b7cc57ec5b5acdd3a67209d5562eca5c98474744e1de4d8c2aed432c7a430e15edd3fe731b
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  mongoid.yml
11
11
  *.gem
12
+ lib/rack/reqorder/tasks/test.rake
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rack-reqorder.gemspec
4
4
  gemspec
5
-
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-lotus)
20
+ We are looking forward to add support for Hanami (ex-Lotus).
21
21
 
22
22
  ## Installation
23
23
 
@@ -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'] || 'unknown'
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
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module Reqorder
3
- VERSION = "0.5"
3
+ VERSION = "0.6"
4
4
  end
5
5
  end
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.5'
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-23 00:00:00.000000000 Z
12
+ date: 2016-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler