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 +4 -4
- data/lib/delorean/base.rb +1 -1
- data/lib/delorean/version.rb +1 -1
- data/spec/ruby/whitelist_spec.rb +9 -1
- data/spec/spec_helper.rb +14 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceccc3c14fd2da0a5b33c8971602e5d485d8631115a29abe338abb4d64f82345
|
4
|
+
data.tar.gz: 4e19747d044a3f8005ec09fab2d48154e65c5f20a7539b5b920211fdda57825f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09d1414f92ecd543dc8421d28847a505c66e9c263cabc0606b581eadbe46ea98626a145ed1a30cc437e72d5c2a03a9bdef8cc5aadb3b4212783fb65b12d2c64b'
|
7
|
+
data.tar.gz: b01a6e41dba8786b51c88514e1ff56a8c3620064da270d75c943299151505ba24873a3705ee1db8f5854259bf28241e64f78a451453a5b4584954a5ff78af0af
|
data/lib/delorean/base.rb
CHANGED
data/lib/delorean/version.rb
CHANGED
data/spec/ruby/whitelist_spec.rb
CHANGED
@@ -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
|
data/spec/spec_helper.rb
CHANGED
@@ -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
|
-
|
185
|
-
|
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.
|
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-
|
11
|
+
date: 2019-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|