eleetscript 0.0.16a → 0.0.17a
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/engine/ruby_to_eleet_wrapper.rb +37 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cda030af5d597bad4202bfb153eb6fd35b7d0d79
|
4
|
+
data.tar.gz: 5ca3d822978e7008a672f46c302ea3ff0aee8666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50172cc578133afd458336c3a81b10f276531c2ed91fc1f946e9e5ce0a972c8bfef67d6d3e315bdd84688a0f5b7666add153e6c901284df70bb4a3fa2eb88453
|
7
|
+
data.tar.gz: 87c7676cf9c776dfce85a64d467e2a9f6987d8549bc908603e5783b71f5405755e8c3830f6a19b45b6ec42e3dd72d4e9f5c14e942d40342d34bb62187a86c621
|
@@ -7,6 +7,9 @@ module EleetScript
|
|
7
7
|
if @options[:lock]
|
8
8
|
@options[:lock] = [@options[:lock]] unless @options[:lock].kind_of?(Array)
|
9
9
|
end
|
10
|
+
if @options[:allow]
|
11
|
+
@options[:allow] = [@options[:allow]] unless @options[:allow].kind_of?(Array)
|
12
|
+
end
|
10
13
|
end
|
11
14
|
|
12
15
|
def call(method_name, args = [])
|
@@ -41,12 +44,44 @@ module EleetScript
|
|
41
44
|
|
42
45
|
def can_call_method?(method_name)
|
43
46
|
method_name = method_name.to_sym
|
44
|
-
|
47
|
+
# Check our options first, they can override class defined locks/allows.
|
48
|
+
if @options[:allow]
|
49
|
+
if @options[:allow].include?(method_name)
|
50
|
+
return true
|
51
|
+
else
|
52
|
+
return false
|
53
|
+
end
|
54
|
+
end
|
55
|
+
if @options[:lock]
|
56
|
+
if @options[:lock].include?(method_name)
|
57
|
+
return false
|
58
|
+
else
|
59
|
+
return true
|
60
|
+
end
|
61
|
+
end
|
62
|
+
# Check the Whitelist
|
63
|
+
if @ruby_obj.respond_to?(:eleetscript_allow_methods)
|
64
|
+
val = @ruby_obj.eleetscript_allow_methods
|
65
|
+
return false if val == :none
|
66
|
+
return true if val == :all
|
67
|
+
if val.kind_of?(Array) && val.include?(method_name)
|
68
|
+
return true
|
69
|
+
else
|
70
|
+
return false
|
71
|
+
end
|
72
|
+
end
|
73
|
+
# Check the Blacklist
|
45
74
|
if @ruby_obj.respond_to?(:eleetscript_lock_methods)
|
46
75
|
val = @ruby_obj.eleetscript_lock_methods
|
76
|
+
return true if val == :none
|
47
77
|
return false if val == :all
|
48
|
-
|
78
|
+
if val.kind_of?(Array) && val.include?(method_name)
|
79
|
+
return false
|
80
|
+
else
|
81
|
+
return true
|
82
|
+
end
|
49
83
|
end
|
84
|
+
# If not specifically allowed/denied, then it can be accessed.
|
50
85
|
true
|
51
86
|
end
|
52
87
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eleetscript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17a
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Buck
|
@@ -17,6 +17,7 @@ executables:
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- bin/eleet
|
20
21
|
- lib/eleetscript.rb
|
21
22
|
- lib/engine/eleet_to_ruby_wrapper.rb
|
22
23
|
- lib/engine/engine.rb
|
@@ -65,7 +66,6 @@ files:
|
|
65
66
|
- lib/lang/runtime/ruby/string_methods.rb
|
66
67
|
- lib/lang/runtime/ruby/symbol_methods.rb
|
67
68
|
- lib/util/processed_key_hash.rb
|
68
|
-
- bin/eleet
|
69
69
|
homepage: http://github.com/bbuck/eleetscript
|
70
70
|
licenses:
|
71
71
|
- MIT
|
@@ -76,17 +76,17 @@ require_paths:
|
|
76
76
|
- lib
|
77
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ">"
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: 1.3.1
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.
|
89
|
+
rubygems_version: 2.2.2
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: EleetScript Engine
|