delorean_lang 0.6.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c6e040929f0803bd19bee9c0cd459a1a1bdcbdc20e99da3998a2e8c7f0ef1d3
4
- data.tar.gz: 175ad860916a349b6a7bfe493e17a4e6c18a7eaaf3ce5625e7a71117f49581fa
3
+ metadata.gz: ceccc3c14fd2da0a5b33c8971602e5d485d8631115a29abe338abb4d64f82345
4
+ data.tar.gz: 4e19747d044a3f8005ec09fab2d48154e65c5f20a7539b5b920211fdda57825f
5
5
  SHA512:
6
- metadata.gz: 51d8f5e885171313517eab09ea2536bfb807aae2fde1e450ccce5ffabf4b3250dfebd84384f32a67856d6eaa00fc8b8c56cd15ec2c9d7b07f7a48e84495e994d
7
- data.tar.gz: 9896fef50b9852c7347048e5db5d4bb4412a78beb218d46117b0c805e8a9eccc3cb63aada6b9a04abf042d0357ea2e05977b9ab25e8f46acd662ef283c24b44e
6
+ metadata.gz: '09d1414f92ecd543dc8421d28847a505c66e9c263cabc0606b581eadbe46ea98626a145ed1a30cc437e72d5c2a03a9bdef8cc5aadb3b4212783fb65b12d2c64b'
7
+ data.tar.gz: b01a6e41dba8786b51c88514e1ff56a8c3620064da270d75c943299151505ba24873a3705ee1db8f5854259bf28241e64f78a451453a5b4584954a5ff78af0af
@@ -180,7 +180,7 @@ module Delorean
180
180
 
181
181
  matcher.match!(klass: klass, args: args)
182
182
 
183
- obj.send(msg, *args)
183
+ obj.public_send(msg, *args)
184
184
  end
185
185
 
186
186
  ######################################################################
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Delorean
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
@@ -101,7 +101,8 @@ describe 'Delorean Ruby whitelisting' do
101
101
  ' i = RootClassChildsChildsChild.test_method()',
102
102
  ' j = RootClassChildsChildsChild.test_method',
103
103
  ' k = RootClassChildsChildsChild.test_method(true, true)',
104
- ' l = RootClassChildsChildsChild.test_method2(true)'
104
+ ' l = RootClassChildsChildsChild.test_method2(true)',
105
+ ' m = RootClassChildsChildsChild.test_private_method',
105
106
  )
106
107
 
107
108
  engine
@@ -182,5 +183,12 @@ describe 'Delorean Ruby whitelisting' do
182
183
  'no such method test_method2'
183
184
  )
184
185
  end
186
+
187
+ it 'raises exception method is private' do
188
+ expect { engine.evaluate('A', 'm') }.to raise_error(
189
+ Delorean::InvalidGetAttribute,
190
+ /private method `test_private_method/
191
+ )
192
+ end
185
193
  end
186
194
  end
@@ -181,8 +181,16 @@ Delorean::Ruby.whitelist.add_class_method :test_method do |method|
181
181
  end
182
182
 
183
183
  class RootClassChildsChild < RootClassChild
184
- def self.test_method(_true_arg)
185
- :test_method_with_true_arg
184
+ class << self
185
+ def test_method(_true_arg)
186
+ :test_method_with_true_arg
187
+ end
188
+
189
+ private
190
+
191
+ def test_private_method
192
+ :test_private_method
193
+ end
186
194
  end
187
195
  end
188
196
 
@@ -190,6 +198,10 @@ Delorean::Ruby.whitelist.add_class_method :test_method do |method|
190
198
  method.called_on RootClassChildsChild, with: [TrueClass]
191
199
  end
192
200
 
201
+ Delorean::Ruby.whitelist.add_class_method :test_private_method do |method|
202
+ method.called_on RootClassChildsChild, with: []
203
+ end
204
+
193
205
  class RootClassChildsChildsChild < RootClassChildsChild
194
206
  def self.test_method2(bool_arg); end
195
207
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delorean_lang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-28 00:00:00.000000000 Z
11
+ date: 2019-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord