transparent-lua 0.7.3 → 0.8.0
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 +5 -13
- data/features/special_methods.feature +9 -2
- data/lib/transparent_lua.rb +3 -4
- data/lib/transparent_lua/version.rb +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZjZkY2ZlNDYyYzRiZDlmNWVkOTQ2M2Y2MDFkMTQ3NGE5MmY4ZDAyMA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4e9fc0292f215b9d4dc66db65420103555171b87
|
4
|
+
data.tar.gz: 7b8e6af49475493109512a0bab8adf6be5ce1121
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
Y2IxZDNiMjQwODRkN2U2Y2ZkMTM0OTcxMjY0ZjA2M2ZiNDlhNDQ4YzE5Nzc0
|
11
|
-
Y2VlNDIxYjhjZjhlMThiNTZjZTg0NGVmZWJjZTUyYWFlYzNhMmY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MjZhZGNhMzdkMzdkMGQ4ODI3NTRlOWJhZTYxNjI3OGEwOWJlNDhjMmVlNzdi
|
14
|
-
MzFiOTMyMWJlNjc3MjI5YmFhZWRmOWFhNzQzMmU3ZjhlZmVmMjIzZmJmNjNl
|
15
|
-
MTQxOTdjY2U1OGVjYmZhZTA5ZjM4NjJlYzg1YjJlYWFjNzNhNTI=
|
6
|
+
metadata.gz: f5be3b733bb3ee19333b3a21dee22a09c38928562dc3689bfcdc83f09ac8bdbc5e2620ee084cbcea142e9517311ccd33352f2cec0bc7a4f074b1bc2d4dd75a66
|
7
|
+
data.tar.gz: e09f213d28da67629262518af3ab49ef78ee89c7d49337f1c11feda0688ab917f2974cc939b1d2d82d2ed0a08298cd3437ca3c6aad46badf4322c114ba81990c
|
@@ -2,7 +2,14 @@ Feature: Special methods
|
|
2
2
|
|
3
3
|
Scenario: Calling a predicate method from Lua
|
4
4
|
Given an empty sandbox
|
5
|
-
And the following method definition as part of the sandbox: def
|
6
|
-
And the following line as Lua script: return(
|
5
|
+
And the following method definition as part of the sandbox: def truthy?; true; end;
|
6
|
+
And the following line as Lua script: return(is_truthy);
|
7
|
+
When I execute the script
|
8
|
+
Then it should return true
|
9
|
+
|
10
|
+
Scenario: Calling a predicate method from Lua
|
11
|
+
Given an empty sandbox
|
12
|
+
And the following method definition as part of the sandbox: def has_skill?; true; end;
|
13
|
+
And the following line as Lua script: return(has_skill);
|
7
14
|
When I execute the script
|
8
15
|
Then it should return true
|
data/lib/transparent_lua.rb
CHANGED
@@ -15,7 +15,7 @@ class TransparentLua
|
|
15
15
|
Array,
|
16
16
|
]
|
17
17
|
|
18
|
-
attr_reader :sandbox, :state, :logger
|
18
|
+
attr_reader :sandbox, :state, :logger
|
19
19
|
|
20
20
|
# @param [Object] sandbox The object which will be made visible to the lua script
|
21
21
|
# @param [Hash] options
|
@@ -27,7 +27,6 @@ class TransparentLua
|
|
27
27
|
@sandbox = sandbox
|
28
28
|
@state = options.fetch(:state) { Lua::State.new }
|
29
29
|
@logger = options.fetch(:logger) { Logger.new('/dev/null') }
|
30
|
-
@predicate_method_suffix = options.fetch(:predicate_method_suffix) { '_huh' }
|
31
30
|
leak_locals = options.fetch(:leak_globals) { false }
|
32
31
|
setup(leak_locals)
|
33
32
|
end
|
@@ -167,8 +166,8 @@ class TransparentLua
|
|
167
166
|
def get_ruby_method_name(lua_method_name)
|
168
167
|
lua_method_name = String(lua_method_name)
|
169
168
|
case lua_method_name
|
170
|
-
when
|
171
|
-
return
|
169
|
+
when /^is_(.*)$/, /^(has_.*)$/
|
170
|
+
return :"#{$1}?"
|
172
171
|
else
|
173
172
|
return lua_method_name.to_sym
|
174
173
|
end
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transparent-lua
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rlua
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.4'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cucumber
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.3'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.3'
|
69
69
|
description: A wrapper to pass complex objects between Ruby and Lua
|
@@ -73,8 +73,8 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
78
78
|
- Gemfile
|
79
79
|
- Guardfile
|
80
80
|
- README.md
|
@@ -100,17 +100,17 @@ require_paths:
|
|
100
100
|
- lib
|
101
101
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- -
|
103
|
+
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.6.6
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: This library enables an easy way to pass complex objects between Ruby and
|