penetration 0.0.6 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6ee7e5349fb6ee8b61671f3dd8ca9f65869948f
|
4
|
+
data.tar.gz: ea6a931cfdd66d69c7302a9b9e544b3656ed4c35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76620784f514d39277df9565b38d0e807d62779d2d426bc33cd2f7c7c479a9fa3aa768ee2d140c78d3449a267b2fe93960c6a933d20d5bf9fb54ed1edf781bd4
|
7
|
+
data.tar.gz: 6875ed27139bb1f7ad041c856a9c30dc351e2b1e0bf565a945d3aa088f9080078fc9991ad053e97bef599c53b9afc15f2d9da50ac04189564a0948461678cdeb
|
data/Gemfile.lock
CHANGED
data/lib/penetration.rb
CHANGED
@@ -38,8 +38,9 @@ module Penetration
|
|
38
38
|
end
|
39
39
|
|
40
40
|
class Core
|
41
|
-
def initialize(session, text = nil, &block)
|
41
|
+
def initialize(controller, session, text = nil, &block)
|
42
42
|
@session = session
|
43
|
+
@controller = controller
|
43
44
|
@caller = Caller.new(@session, :rough_penetration)
|
44
45
|
@caller.add_raw(text) if text
|
45
46
|
instance_eval(&block) if block_given?
|
@@ -50,6 +51,10 @@ module Penetration
|
|
50
51
|
@caller.add_preset([name, *rest].flatten)
|
51
52
|
end
|
52
53
|
end
|
54
|
+
|
55
|
+
def my(&block)
|
56
|
+
@controller.instance_eval(&block)
|
57
|
+
end
|
53
58
|
end
|
54
59
|
|
55
60
|
class Penetrator
|
@@ -112,7 +117,7 @@ module Penetration
|
|
112
117
|
|
113
118
|
class Base
|
114
119
|
def penetrate(text = nil, &block)
|
115
|
-
Penetration::Core.new(session, text, &block)
|
120
|
+
Penetration::Core.new(self, session, text, &block)
|
116
121
|
end
|
117
122
|
end
|
118
123
|
end
|
data/lib/penetration/version.rb
CHANGED
@@ -39,6 +39,17 @@ class PenetrationsController < ApplicationController
|
|
39
39
|
render json: {}
|
40
40
|
end
|
41
41
|
|
42
|
+
def with_scope
|
43
|
+
penetrate {
|
44
|
+
alert my { do_mine }
|
45
|
+
}
|
46
|
+
render :index
|
47
|
+
end
|
48
|
+
|
49
|
+
def do_mine
|
50
|
+
'doing!'
|
51
|
+
end
|
52
|
+
|
42
53
|
def with_no_param
|
43
54
|
penetrate {
|
44
55
|
no_param
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -16,7 +16,7 @@ describe 'Penetrations', type: :request do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it do
|
19
|
-
expect{
|
19
|
+
expect {
|
20
20
|
get '/penetrations/dynamic_too_long'
|
21
21
|
}.to raise_exception(ActionDispatch::Cookies::CookieOverflow)
|
22
22
|
end
|
@@ -61,4 +61,10 @@ describe 'Penetrations', type: :request do
|
|
61
61
|
get '/penetrations/double'
|
62
62
|
expect(response.body).to include('penetrated alert2!')
|
63
63
|
end
|
64
|
+
|
65
|
+
it do
|
66
|
+
get '/penetrations/with_scope'
|
67
|
+
expect(response.body).to include('penetrated doing')
|
68
|
+
end
|
69
|
+
|
64
70
|
end
|