penetration 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ce6c4554e6c42965b4874d312840e50931e3f3e
4
- data.tar.gz: 055fe718d06f63f709dfeb7ce359c614c81dcc97
3
+ metadata.gz: d6ee7e5349fb6ee8b61671f3dd8ca9f65869948f
4
+ data.tar.gz: ea6a931cfdd66d69c7302a9b9e544b3656ed4c35
5
5
  SHA512:
6
- metadata.gz: 1c3c73f2cf1c45e62a44aca557b75cf14e4ec0eb16e3530a419014abef48e901d696a31fca6192f7a93b5ed6802673f0d744a47cf6781574c2634ed27f20fcc0
7
- data.tar.gz: 99c9d15c68d1e302e02d728ffed4ca279dadc5c93fc3c07c25af1f240d5a20205b65809be20a0dcbd8d3f272c7b3d2a686be55929f166fcfb4385690489d857d
6
+ metadata.gz: 76620784f514d39277df9565b38d0e807d62779d2d426bc33cd2f7c7c479a9fa3aa768ee2d140c78d3449a267b2fe93960c6a933d20d5bf9fb54ed1edf781bd4
7
+ data.tar.gz: 6875ed27139bb1f7ad041c856a9c30dc351e2b1e0bf565a945d3aa088f9080078fc9991ad053e97bef599c53b9afc15f2d9da50ac04189564a0948461678cdeb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- penetration (0.0.5)
4
+ penetration (0.0.6)
5
5
  rails (~> 4.0)
6
6
 
7
7
  GEM
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
@@ -1,3 +1,3 @@
1
1
  module Penetration
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -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
@@ -9,4 +9,5 @@ Dummy::Application.routes.draw do
9
9
  get 'penetrations/with_param'
10
10
  get 'penetrations/with_multiple_params'
11
11
  get 'penetrations/double'
12
+ get 'penetrations/with_scope'
12
13
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: penetration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmmpa