moesif_rack 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec9a7d8a1458019f25ec5638b642921be4c8be50
4
- data.tar.gz: cbe40d5f9f92844428f20fc8b974b53856d364a0
3
+ metadata.gz: 17fdfd9dc7dec268ff1ca36c5912acb91289eef5
4
+ data.tar.gz: 1f24b2712c21f1faf4a7be7c58ae7b6e95a69d8e
5
5
  SHA512:
6
- metadata.gz: 5dd232e683be3c8e32898719a2f40725e0f66ced2b0453acec6fabcaeb72e3853959c00325f553847a5e7695d640a391a7b3f18920f41cd7269e3cd8dada1ada
7
- data.tar.gz: eb6a52983cec544bbca557b0fac4ef4b7a7d197861e833b7077c5aac28dd38110581bd2dcc8b5bcbd807e7d241b440302d8c65daaa90eb8ca0eaaedbb4530276
6
+ metadata.gz: 3adf4d1ddc1d36cf0f4b6b092144be4ae2c46bdee157cd0f38f8c99e7b6be18eee706276ada9a9c1f5cbdcab8bc1ee61a51d9aa1b052b16911b2dbb8632aebdb
7
+ data.tar.gz: 7029a3fa64c8fd6a29474a613dcaf961f2c1a39faab6e818571cd5b86266a49d86685eb0dbbdf4cca748c68abd5550f4d03b6894008da77c161da6f4ff10d2e4
data/README.md CHANGED
@@ -117,6 +117,25 @@ moesif_options['mask_data'] = Proc.new { |event_model|
117
117
 
118
118
  For details for the spec of event model, please see the [moesifapi-ruby git](https://github.com/Moesif/moesifapi-ruby)
119
119
 
120
+ #### skip
121
+
122
+ Optional. A Proc that takes env, headers, body and returns a boolean.
123
+
124
+ ```ruby
125
+
126
+ moesif_options['skip'] = Proc.new { |env, headers, body|
127
+
128
+ #snip
129
+
130
+ false
131
+ }
132
+
133
+ ```
134
+
135
+ For details for the spec of event model, please see the [moesifapi-ruby git](https://github.com/Moesif/moesifapi-ruby)
136
+
137
+
138
+
120
139
 
121
140
  #### debug
122
141
 
@@ -17,6 +17,7 @@ module MoesifRack
17
17
  @identify_user = options['identify_user']
18
18
  @identify_session = options['identify_session']
19
19
  @mask_data = options['mask_data']
20
+ @skip = options['skip']
20
21
  @debug = options['debug']
21
22
  end
22
23
 
@@ -119,10 +120,20 @@ module MoesifRack
119
120
 
120
121
  end
121
122
 
122
- if @debug
123
- process_send.call
124
- else
125
- Thread.start(&process_send)
123
+ should_skip = false
124
+
125
+ if @skip
126
+ if @skip.call(env, headers, body)
127
+ should_skip = true;
128
+ end
129
+ end
130
+
131
+ if !should_skip
132
+ if @debug
133
+ process_send.call
134
+ else
135
+ Thread.start(&process_send)
136
+ end
126
137
  end
127
138
 
128
139
  [status, headers, body]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moesif_rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moesif, Inc
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-14 00:00:00.000000000 Z
12
+ date: 2016-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit