union_station_hooks_core 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTQ0Y2Q0ZTkxYjEyNWViMDZmMWVkYjAwOGM4MjcyYTU1M2E0MzgxMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTU2YzRiYmZlZmM3ZmIwMDNmMjA2YjUwZDY1NmJlOGIyNjM2NmJkOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWFmMjUwYTg2OGVjYjMxNmZkMGUzYWM4YTMyZjcyYmVmYmM4NzcyZGVhODkz
|
10
|
+
YzhiNGJhZWI2YjI0MGYxYzc2NWFhYTYzZDVjZDY4MGNmNWU4ZTc4MWY3ZTQ0
|
11
|
+
MWQ2MDZkMTRkNDJlNzg2YTJkMzMwMjRhNzg1NzZlMjZkMDM5ODM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2Y2MDFiNTY0ZWViZGRlMDA3YzQ0MGE1ZWZmZTlmZDc3MGRiMGQ4MTk4Y2My
|
14
|
+
MWY0NTY0NGI5ZmYwYWFkN2ZlYThhOTAyMmZkOTJjYTgyYWM2MmU3MWM4NjUy
|
15
|
+
N2M1Y2UxZWFhNzM0ZWI4OTRlMGMwZmNhMGNlYTQ4MGNlNDA1OWE=
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ If your application is a Rails application, then you should use the [union_stati
|
|
28
28
|
|
29
29
|
### Using with Passenger
|
30
30
|
|
31
|
-
**Note: This documentation section only applies to Passenger
|
31
|
+
**Note: This documentation section only applies to Passenger 5.0.20 or later!**
|
32
32
|
|
33
33
|
If you use [Passenger](https://www.phusionpassenger.com/), then you do not need to install the `union_station_hooks_core` gem. `union_station_hooks_core` is bundled with Passenger.
|
34
34
|
|
@@ -100,11 +100,11 @@ Please refer to [the API documentation website](http://www.rubydoc.info/github/p
|
|
100
100
|
|
101
101
|
## Legacy code
|
102
102
|
|
103
|
-
Before Passenger
|
103
|
+
Before Passenger 5.0.20, the Union Station setup instructions used to tell you to create a `config/initializers/passenger.rb` in which you call the following code:
|
104
104
|
|
105
105
|
PhusionPassenger.install_framework_extensions! if defined?(PhusionPassenger)
|
106
106
|
|
107
|
-
Since Passenger
|
107
|
+
Since Passenger 5.0.20, `PhusionPassenger.install_framework_extensions!` has become an alias for `UnionStationHooks.initialize!`, but the former is considered deprecated. Please replace the above code with:
|
108
108
|
|
109
109
|
if defined?(UnionStationHooks)
|
110
110
|
UnionStationHooks.initialize!
|
@@ -42,7 +42,7 @@ end
|
|
42
42
|
|
43
43
|
# The UnionStationHooks module is the entry point to the
|
44
44
|
# `union_station_hooks_core` gem's public API. Note that this API is only
|
45
|
-
# available since Passenger
|
45
|
+
# available since Passenger 5.0.20!
|
46
46
|
#
|
47
47
|
# **_Not familiar with `union_station_hooks_core`? Please read the
|
48
48
|
# [README](https://github.com/phusion/union_station_hooks_core)
|
@@ -81,6 +81,7 @@ end
|
|
81
81
|
# # object, you can log to Union Station information about the current
|
82
82
|
# # request.
|
83
83
|
# reporter = env['union_station_hooks']
|
84
|
+
# # -OR- (if you don't have access to the Rack env):
|
84
85
|
# reporter = Thread.current[:union_station_hooks]
|
85
86
|
#
|
86
87
|
# # The reporter object may be nil because of various error conditions,
|
@@ -145,11 +145,12 @@ module UnionStationHooks
|
|
145
145
|
# This is automatically called by Passenger's Rack handler.
|
146
146
|
#
|
147
147
|
# @private
|
148
|
-
# @return An ID to be passed later to {#log_writing_rack_body_end}
|
148
|
+
# @return An ID to be passed later to {#log_writing_rack_body_end}, or nil
|
149
|
+
# on error.
|
149
150
|
def log_writing_rack_body_begin
|
150
151
|
return do_nothing_on_null(:log_writing_rack_body_begin) if null?
|
151
152
|
@transaction.log_activity_begin('app writing out response body')
|
152
|
-
nil
|
153
|
+
:writing_rack_body # Random non-nil ID
|
153
154
|
end
|
154
155
|
|
155
156
|
# Logs that the application server is done writing out the Rack
|
@@ -162,8 +163,8 @@ module UnionStationHooks
|
|
162
163
|
# @private
|
163
164
|
def log_writing_rack_body_end(id)
|
164
165
|
return do_nothing_on_null(:log_writing_rack_body_end) if null?
|
166
|
+
return if id.nil?
|
165
167
|
@transaction.log_activity_end('app writing out response body')
|
166
|
-
nil
|
167
168
|
end
|
168
169
|
|
169
170
|
# Logs that the application server is about to call `#close` on the
|
@@ -175,11 +176,12 @@ module UnionStationHooks
|
|
175
176
|
# This is automatically called by Passenger's Rack handler.
|
176
177
|
#
|
177
178
|
# @private
|
178
|
-
# @return An ID to be passed later to {#log_closing_rack_body_end}
|
179
|
+
# @return An ID to be passed later to {#log_closing_rack_body_end}, or nil
|
180
|
+
# on error.
|
179
181
|
def log_closing_rack_body_begin
|
180
182
|
return do_nothing_on_null(:log_closing_rack_body_begin) if null?
|
181
183
|
@transaction.log_activity_begin('closing rack body object')
|
182
|
-
nil
|
184
|
+
:closing_rack_body # Random non-nil ID
|
183
185
|
end
|
184
186
|
|
185
187
|
# Logs that the application server is done calling `#close` on the
|
@@ -190,6 +192,7 @@ module UnionStationHooks
|
|
190
192
|
# @private
|
191
193
|
def log_closing_rack_body_end(id)
|
192
194
|
return do_nothing_on_null(:log_closing_rack_body_end) if null?
|
195
|
+
return if id.nil?
|
193
196
|
@transaction.log_activity_end('closing rack body object')
|
194
197
|
end
|
195
198
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: union_station_hooks_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hongli Lai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Union Station Ruby hooks core code.
|
14
14
|
email: info@phusion.nl
|