thirtysix 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thirtysix/app_request.rb +54 -0
- data/lib/thirtysix/rack/railtie.rb +10 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10701e01eef03ec1d4bc4a96b52f558e4699a1a8
|
4
|
+
data.tar.gz: 2385b6fa710f5c40ef25df28c5622c56826558cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc0e20999be623a8a101c83029b64c1db25ff339e2d8f109e42d8545d9e82949fa12abcbfa2255c5cc9b09bb40420f97459864930abd3e1154fdf8726c5234e
|
7
|
+
data.tar.gz: c873f31704369a0bb40405777512e7bc923ed1ac82c5d591cb2085c7cc7dbf0e2322cba3fccb6e8058cafbbcdd624c69c1d4b7556e07bd632ed5103ebb9b7cd8
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module Thirtysix
|
4
|
+
class AppRequest
|
5
|
+
attr_accessor :objects,
|
6
|
+
:classes,
|
7
|
+
:modules,
|
8
|
+
:floats,
|
9
|
+
:strings,
|
10
|
+
:regexps,
|
11
|
+
:arrays,
|
12
|
+
:hashes,
|
13
|
+
:files,
|
14
|
+
:request_time_in_milliseconds,
|
15
|
+
:controller,
|
16
|
+
:action,
|
17
|
+
:query_parameters,
|
18
|
+
:memory_in_mb
|
19
|
+
|
20
|
+
def build(start_objects, end_objects, env)
|
21
|
+
@objects = (end_objects[:T_OBJECT] || 0) - (start_objects[:T_OBJECT] || 0)
|
22
|
+
@classes = (end_objects[:T_CLASS] || 0) - (start_objects[:T_CLASS] || 0)
|
23
|
+
@modules = (end_objects[:T_MODULE] || 0) - (start_objects[:T_MODULE] || 0)
|
24
|
+
@floats = (end_objects[:T_FLOAT] || 0) - (start_objects[:T_FLOAT] || 0)
|
25
|
+
@strings = (end_objects[:T_STRING] || 0) - (start_objects[:T_STRING] || 0)
|
26
|
+
@regexps = (end_objects[:T_REGEXP] || 0) - (start_objects[:T_REGEXP] || 0)
|
27
|
+
@arrays = (end_objects[:T_ARRAY] || 0) - (start_objects[:T_ARRAY] || 0)
|
28
|
+
@hashes = (end_objects[:T_HASH] || 0) - (start_objects[:T_HASH] || 0)
|
29
|
+
@files = (end_objects[:T_FILE] || 0) - (start_objects[:T_FILE] || 0)
|
30
|
+
@controller = env.fetch("action_dispatch.request.path_parameters", {})[:controller]
|
31
|
+
@action = env.fetch("action_dispatch.request.path_parameters", {})[:action]
|
32
|
+
@query_parameters = env.fetch("action_dispatch.request.query_parameters", nil)
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_json
|
36
|
+
{
|
37
|
+
objects: objects,
|
38
|
+
classes: classes,
|
39
|
+
modules: modules,
|
40
|
+
floats: floats,
|
41
|
+
strings: strings,
|
42
|
+
regexps: regexps,
|
43
|
+
arrays: arrays,
|
44
|
+
hashes: hashes,
|
45
|
+
files: files,
|
46
|
+
request_time_in_milliseconds: request_time_in_milliseconds,
|
47
|
+
controller: controller,
|
48
|
+
action: action,
|
49
|
+
query_parameters: query_parameters,
|
50
|
+
memory_in_mb: memory_in_mb
|
51
|
+
}.to_json
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thirtysix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary Moore
|
@@ -18,7 +18,9 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- Gemfile
|
20
20
|
- README.md
|
21
|
+
- lib/thirtysix/app_request.rb
|
21
22
|
- lib/thirtysix/rack/middleware.rb
|
23
|
+
- lib/thirtysix/rack/railtie.rb
|
22
24
|
homepage: http://github.com/gmoore/thirtysix
|
23
25
|
licenses:
|
24
26
|
- MIT
|