rubypython 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.rdoc +32 -0
- data/Manifest.txt +2 -5
- data/lib/rubypython.rb +73 -59
- data/lib/rubypython/conversion.rb +7 -5
- data/lib/rubypython/interpreter.rb +250 -0
- data/lib/rubypython/legacy.rb +2 -23
- data/lib/rubypython/operators.rb +10 -6
- data/lib/rubypython/pymainclass.rb +3 -2
- data/lib/rubypython/pyobject.rb +2 -1
- data/lib/rubypython/python.rb +185 -188
- data/lib/rubypython/rubypyproxy.rb +1 -1
- data/lib/rubypython/tuple.rb +10 -0
- data/spec/conversion_spec.rb +10 -2
- data/spec/python_helpers/basics.py +3 -0
- data/spec/rubypython_spec.rb +0 -24
- data/spec/spec_helper.rb +2 -0
- metadata +122 -122
- metadata.gz.sig +0 -0
- data/.gitignore +0 -13
- data/.hgignore +0 -14
- data/.hgtags +0 -9
- data/lib/rubypython/options.rb +0 -66
- data/lib/rubypython/pythonexec.rb +0 -145
data/spec/conversion_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe RubyPython::Conversion do
|
|
12
12
|
["a string", "a string", AString],
|
13
13
|
["a string_with_nulls", "a string_with_nulls", AStringWithNULLs],
|
14
14
|
["a list", "an array", AnArray],
|
15
|
-
["a tuple", "
|
15
|
+
["a tuple", "a tuple", ATuple],
|
16
16
|
["a dict", "a hash", AConvertedHash],
|
17
17
|
["python True", "true", true],
|
18
18
|
["python False", "false", false],
|
@@ -20,7 +20,9 @@ describe RubyPython::Conversion do
|
|
20
20
|
].each do |py_type, rb_type, output|
|
21
21
|
it "should convert #{py_type} to #{rb_type}" do
|
22
22
|
py_object_ptr = @objects.__send__(py_type.sub(' ', '_')).pObject.pointer
|
23
|
-
subject.ptorObject(py_object_ptr)
|
23
|
+
obj = subject.ptorObject(py_object_ptr)
|
24
|
+
obj.should == output
|
25
|
+
obj.class.should == output.class
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
@@ -38,6 +40,7 @@ describe RubyPython::Conversion do
|
|
38
40
|
["a string_with_nulls", "a string_with_nulls", AStringWithNULLs],
|
39
41
|
["a string", "a symbol", ASym],
|
40
42
|
["a list", "an array", AnArray],
|
43
|
+
["a tuple", "a tuple", ATuple ],
|
41
44
|
["a dict", "a hash", AConvertedHash],
|
42
45
|
["python True", "true", true],
|
43
46
|
["python False", "false", false],
|
@@ -56,5 +59,10 @@ describe RubyPython::Conversion do
|
|
56
59
|
it "should raise an exception when it cannot convert" do
|
57
60
|
lambda { subject.rtopObject(Class) }.should raise_exception(subject::UnsupportedConversion)
|
58
61
|
end
|
62
|
+
|
63
|
+
it "should convert a tuple correctly" do
|
64
|
+
@basics.expects_tuple(AnArray).should == false
|
65
|
+
@basics.expects_tuple(RubyPython::Tuple.tuple(AnArray)).should == true
|
66
|
+
end
|
59
67
|
end
|
60
68
|
end
|
data/spec/rubypython_spec.rb
CHANGED
@@ -56,28 +56,4 @@ describe RubyPython, :self_start => true do
|
|
56
56
|
RubyPython.stop.should be_false
|
57
57
|
end
|
58
58
|
end
|
59
|
-
|
60
|
-
describe '#reload_library', :slow => true do
|
61
|
-
it 'leaves RubyPython in a stable state' do
|
62
|
-
lambda do
|
63
|
-
RubyPython.instance_eval { reload_library }
|
64
|
-
RubyPython.run {}
|
65
|
-
end.should_not raise_exception
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe '.configure', :slow => true do
|
70
|
-
it 'allows python executable to be specified', :unless => `which python2.6`.empty? do
|
71
|
-
RubyPython.configure :python_exe => 'python2.6'
|
72
|
-
RubyPython.run do
|
73
|
-
sys = RubyPython.import 'sys'
|
74
|
-
sys.version.rubify.to_f.should == 2.6
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
after(:all) do
|
79
|
-
RubyPython.clear_options
|
80
|
-
RubyPython.instance_eval { reload_library }
|
81
|
-
end
|
82
|
-
end
|
83
59
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,150 +1,158 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypython
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 3
|
10
|
-
version: 0.5.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Steeve Morin
|
14
9
|
- Austin Ziegler
|
15
10
|
- Zach Raines
|
16
11
|
autorequire:
|
17
12
|
bindir: bin
|
18
|
-
cert_chain:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
cert_chain:
|
14
|
+
- !binary |-
|
15
|
+
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURTRENDQWpDZ0F3SUJB
|
16
|
+
Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREJLTVJ3d0dnWURWUVFEREJOeVlX
|
17
|
+
bHUKWlhONmJWOXlkV0o1Y0hsMGFHOXVNUlV3RXdZS0NaSW1pWlB5TEdRQkdS
|
18
|
+
WUZaMjFoYVd3eEV6QVJCZ29Ka2lhSgprL0lzWkFFWkZnTmpiMjB3SGhjTk1U
|
19
|
+
QXdPREE0TURJME5UTXdXaGNOTVRFd09EQTRNREkwTlRNd1dqQktNUnd3Ckdn
|
20
|
+
WURWUVFEREJOeVlXbHVaWE42YlY5eWRXSjVjSGwwYUc5dU1SVXdFd1lLQ1pJ
|
21
|
+
bWlaUHlMR1FCR1JZRloyMWgKYVd3eEV6QVJCZ29Ka2lhSmsvSXNaQUVaRmdO
|
22
|
+
amIyMHdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCRHdBdwpnZ0VLQW9J
|
23
|
+
QkFRRFBTbW14WXFXV041M1hyRDRidFowOHR3aXBSejVwcmlURnR3bUtMMD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cXlw
|
39
|
+
OWdkQjNqVmViN0puVExZK1dsSFd0MnJGVmJlcXY3S3RKbHA3KzR1V01La3pU
|
40
|
+
YlcvdWpkRwpjZ3VKTWlRQ1NPbFVQWnhDV1dNa2pmWmJYdnRTNVZkekpldlNx
|
41
|
+
UT09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
|
42
|
+
date: 2012-04-17 00:00:00.000000000 Z
|
43
|
+
dependencies:
|
44
|
+
- !ruby/object:Gem::Dependency
|
23
45
|
name: ffi
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
46
|
+
requirement: &70222401734660 !ruby/object:Gem::Requirement
|
26
47
|
none: false
|
27
|
-
requirements:
|
48
|
+
requirements:
|
28
49
|
- - ~>
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 25
|
31
|
-
segments:
|
32
|
-
- 1
|
33
|
-
- 0
|
34
|
-
- 7
|
50
|
+
- !ruby/object:Gem::Version
|
35
51
|
version: 1.0.7
|
36
52
|
type: :runtime
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: blankslate
|
40
53
|
prerelease: false
|
41
|
-
|
54
|
+
version_requirements: *70222401734660
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: blankslate
|
57
|
+
requirement: &70222401749300 !ruby/object:Gem::Requirement
|
42
58
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
hash: 105
|
47
|
-
segments:
|
48
|
-
- 2
|
49
|
-
- 1
|
50
|
-
- 2
|
51
|
-
- 3
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
52
62
|
version: 2.1.2.3
|
53
63
|
type: :runtime
|
54
|
-
version_requirements: *id002
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubyforge
|
57
64
|
prerelease: false
|
58
|
-
|
65
|
+
version_requirements: *70222401749300
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: rubyforge
|
68
|
+
requirement: &70222401748780 !ruby/object:Gem::Requirement
|
59
69
|
none: false
|
60
|
-
requirements:
|
61
|
-
- -
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
hash: 7
|
64
|
-
segments:
|
65
|
-
- 2
|
66
|
-
- 0
|
67
|
-
- 4
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
68
73
|
version: 2.0.4
|
69
74
|
type: :development
|
70
|
-
version_requirements: *id003
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rspec
|
73
75
|
prerelease: false
|
74
|
-
|
76
|
+
version_requirements: *70222401748780
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: rdoc
|
79
|
+
requirement: &70222401748240 !ruby/object:Gem::Requirement
|
75
80
|
none: false
|
76
|
-
requirements:
|
81
|
+
requirements:
|
77
82
|
- - ~>
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '3.10'
|
85
|
+
type: :development
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: *70222401748240
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: rspec
|
90
|
+
requirement: &70222401747560 !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ~>
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '2.0'
|
84
96
|
type: :development
|
85
|
-
version_requirements: *id004
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: tilt
|
88
97
|
prerelease: false
|
89
|
-
|
98
|
+
version_requirements: *70222401747560
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: tilt
|
101
|
+
requirement: &70222401746580 !ruby/object:Gem::Requirement
|
90
102
|
none: false
|
91
|
-
requirements:
|
103
|
+
requirements:
|
92
104
|
- - ~>
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
segments:
|
96
|
-
- 1
|
97
|
-
- 0
|
98
|
-
version: "1.0"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '1.0'
|
99
107
|
type: :development
|
100
|
-
version_requirements: *id005
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: hoe
|
103
108
|
prerelease: false
|
104
|
-
|
109
|
+
version_requirements: *70222401746580
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: hoe
|
112
|
+
requirement: &70222401745800 !ruby/object:Gem::Requirement
|
105
113
|
none: false
|
106
|
-
requirements:
|
114
|
+
requirements:
|
107
115
|
- - ~>
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
segments:
|
111
|
-
- 2
|
112
|
-
- 12
|
113
|
-
version: "2.12"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.0'
|
114
118
|
type: :development
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: *70222401745800
|
121
|
+
description: ! 'RubyPython is a bridge between the Ruby and Python interpreters. It
|
122
|
+
embeds a
|
123
|
+
|
124
|
+
running Python interpreter in the Ruby application''s process using FFI and
|
125
|
+
|
119
126
|
provides a means for wrapping, converting, and calling Python objects and
|
127
|
+
|
120
128
|
methods.
|
121
|
-
|
129
|
+
|
130
|
+
|
122
131
|
RubyPython uses FFI to marshal the data between the Ruby and Python VMs and
|
132
|
+
|
123
133
|
make Python calls. You can:
|
124
|
-
|
134
|
+
|
135
|
+
|
125
136
|
* Inherit from Python classes.
|
137
|
+
|
126
138
|
* Configure callbacks from Python.
|
127
|
-
|
128
|
-
|
139
|
+
|
140
|
+
* Run Python generators (on Ruby 1.9.2 or later).'
|
141
|
+
email:
|
129
142
|
- swiuzzz+rubypython@gmail.com
|
130
143
|
- austin@rubyforge.org
|
131
144
|
- raineszm+rubypython@gmail.com
|
132
145
|
executables: []
|
133
|
-
|
134
146
|
extensions: []
|
135
|
-
|
136
|
-
extra_rdoc_files:
|
137
|
-
- Manifest.txt
|
138
|
-
- PostInstall.txt
|
147
|
+
extra_rdoc_files:
|
139
148
|
- Contributors.rdoc
|
140
149
|
- History.rdoc
|
141
150
|
- License.rdoc
|
151
|
+
- Manifest.txt
|
152
|
+
- PostInstall.txt
|
142
153
|
- README.rdoc
|
143
|
-
files:
|
154
|
+
files:
|
144
155
|
- .autotest
|
145
|
-
- .gitignore
|
146
|
-
- .hgignore
|
147
|
-
- .hgtags
|
148
156
|
- .rspec
|
149
157
|
- Contributors.rdoc
|
150
158
|
- History.rdoc
|
@@ -157,17 +165,17 @@ files:
|
|
157
165
|
- lib/rubypython.rb
|
158
166
|
- lib/rubypython/blankobject.rb
|
159
167
|
- lib/rubypython/conversion.rb
|
168
|
+
- lib/rubypython/interpreter.rb
|
160
169
|
- lib/rubypython/legacy.rb
|
161
170
|
- lib/rubypython/macros.rb
|
162
171
|
- lib/rubypython/operators.rb
|
163
|
-
- lib/rubypython/options.rb
|
164
172
|
- lib/rubypython/pygenerator.rb
|
165
173
|
- lib/rubypython/pymainclass.rb
|
166
174
|
- lib/rubypython/pyobject.rb
|
167
175
|
- lib/rubypython/python.rb
|
168
176
|
- lib/rubypython/pythonerror.rb
|
169
|
-
- lib/rubypython/pythonexec.rb
|
170
177
|
- lib/rubypython/rubypyproxy.rb
|
178
|
+
- lib/rubypython/tuple.rb
|
171
179
|
- lib/rubypython/type.rb
|
172
180
|
- spec/basic_spec.rb
|
173
181
|
- spec/callback_spec.rb
|
@@ -187,37 +195,29 @@ files:
|
|
187
195
|
- .gemtest
|
188
196
|
homepage:
|
189
197
|
licenses: []
|
190
|
-
|
191
198
|
post_install_message:
|
192
|
-
rdoc_options:
|
199
|
+
rdoc_options:
|
193
200
|
- --main
|
194
201
|
- README.rdoc
|
195
|
-
require_paths:
|
202
|
+
require_paths:
|
196
203
|
- lib
|
197
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
204
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
198
205
|
none: false
|
199
|
-
requirements:
|
200
|
-
- -
|
201
|
-
- !ruby/object:Gem::Version
|
202
|
-
|
203
|
-
|
204
|
-
- 0
|
205
|
-
version: "0"
|
206
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - ! '>='
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '0'
|
210
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
211
|
none: false
|
208
|
-
requirements:
|
209
|
-
- -
|
210
|
-
- !ruby/object:Gem::Version
|
211
|
-
|
212
|
-
|
213
|
-
- 0
|
214
|
-
version: "0"
|
215
|
-
requirements:
|
212
|
+
requirements:
|
213
|
+
- - ! '>='
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
requirements:
|
216
217
|
- Python, ~> 2.4
|
217
218
|
rubyforge_project: rubypython
|
218
|
-
rubygems_version: 1.8.
|
219
|
+
rubygems_version: 1.8.17
|
219
220
|
signing_key:
|
220
221
|
specification_version: 3
|
221
222
|
summary: RubyPython is a bridge between the Ruby and Python interpreters
|
222
223
|
test_files: []
|
223
|
-
|
metadata.gz.sig
ADDED
Binary file
|