pilfer 1.0.0 → 1.0.1
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 +8 -8
- data/README.md +2 -2
- data/lib/pilfer/middleware.rb +1 -1
- data/lib/pilfer/version.rb +1 -1
- data/spec/pilfer/middleware_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjNmY2MxMWQ3ZTU2ZmFhNzBjZTBhMDhhZmVhNjVmZGIwN2MyNDZmNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Nzg5ZDAzNTYyMGFhYzM2NjgyZjMxMDdmNWQ1ZGY3OWEwMGJjZWM5ZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjZjMWRkYTRlNTRmODlmNjkxYzQ3ZmE5ZjY4MDEwZTZlY2Q1NmQ5MTExNzA3
|
10
|
+
YTMzNTc2OGUwODUxOTg0M2E0ZGJmYzRmMjZkMTFjYzg5N2Q5MDg3MTY3MGFm
|
11
|
+
MjA3MDJkYTM5NTU2MTU2YzdlNDQ3Y2ZjMWQ5OGJmNWQ3ZWY2ZjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGZiNTVmZDk3OWI1YTI4OTUzZDJjZTIxMTVkNWUyNDMzZjQxYjAzNTg3OWQz
|
14
|
+
YWFmMDkyN2Q4NWQxYTdmNTllZTUyOTljNTIxOWI0NTdjYTQ5Yjg0Mjg3MDhk
|
15
|
+
YzE5NTQ0YzMwMjhjMmZmMTlkOWM2ODA0NWVjM2ZkNjFiNmZkNDQ=
|
data/README.md
CHANGED
@@ -43,7 +43,7 @@ Profile your Rack or Rails app using `Pilfer::Middleware`.
|
|
43
43
|
```ruby
|
44
44
|
reporter = Pilfer::Logger.new('pilfer.log')
|
45
45
|
profiler = Pilfer::Profiler.new(reporter)
|
46
|
-
use Pilfer::Middleware :profiler => profiler
|
46
|
+
use Pilfer::Middleware, :profiler => profiler
|
47
47
|
```
|
48
48
|
|
49
49
|
The profile report consists of the wall time and call count for each line of
|
@@ -179,7 +179,7 @@ Profile your entire Rack or Rails app using `Pilfer::Middleware`. Pass it a
|
|
179
179
|
```ruby
|
180
180
|
reporter = Pilfer::Server.new('https://pilfer.com', 'my-pilfer-server-token')
|
181
181
|
profiler = Pilfer::Profiler.new(reporter)
|
182
|
-
use Pilfer::Middleware :profiler => profiler
|
182
|
+
use Pilfer::Middleware, :profiler => profiler
|
183
183
|
```
|
184
184
|
|
185
185
|
Restrict profiling to files matching a regular expression using the
|
data/lib/pilfer/middleware.rb
CHANGED
data/lib/pilfer/version.rb
CHANGED
@@ -53,4 +53,14 @@ describe Pilfer::Middleware do
|
|
53
53
|
subject.call(env)
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
context 'with no guard' do
|
58
|
+
subject { Pilfer::Middleware.new(app, options) }
|
59
|
+
|
60
|
+
it 'profiles and calls the downstream app' do
|
61
|
+
profiler.should_receive(:profile).and_yield
|
62
|
+
app.should_receive(:call).with(env)
|
63
|
+
subject.call(env)
|
64
|
+
end
|
65
|
+
end
|
56
66
|
end
|