rubypython 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.11 2010-07-12
2
+ * Bug Fixes
3
+ * Fixed some issues with building the extension under ruby 1.9. Sould now be truly 1.9 compatible.
4
+
1
5
  == 0.2.10 2010-07-08
2
6
  * Bug Fixes
3
7
  * Made some changes to how the native extension is configured and build.
data/Manifest.txt CHANGED
@@ -4,8 +4,6 @@ Manifest.txt
4
4
  PostInstall.txt
5
5
  README.txt
6
6
  Rakefile
7
- config/hoe.rb
8
- config/requirements.rb
9
7
  ext/rubypython_bridge/cbridge.c
10
8
  ext/rubypython_bridge/cbridge.h
11
9
  ext/rubypython_bridge/config.h
@@ -36,25 +34,13 @@ lib/rubypython.rb
36
34
  lib/rubypython/session.rb
37
35
  lib/rubypython/version.rb
38
36
  lib/rubypython/wrapper_extensions.rb
39
- script/console
40
- script/destroy
41
- script/generate
42
- script/txt2html
43
37
  setup.rb
44
- tasks/deployment.rake
45
38
  tasks/environment.rake
46
39
  tasks/extconf.rake
47
40
  tasks/extconf/rubypython_bridge.rake
48
- tasks/website.rake
49
41
  test/python_helpers/objects.py
50
- test/python_helpers/objects.pyc
51
42
  test/test.wav
52
43
  test/test_helper.rb
53
44
  test/test_rubypython.rb
54
45
  test/test_rubypython_bridge_extn.rb
55
46
  test/test_session.rb
56
- website/index.html
57
- website/index.txt
58
- website/javascripts/rounded_corners_lite.inc.js
59
- website/stylesheets/screen.css
60
- website/template.html.erb
@@ -1,6 +1,8 @@
1
1
  #include "cbridge.h"
2
2
 
3
- #import "rtop.h"
3
+ #include "rtop.h"
4
+ #include "ptor.h"
5
+ #include "rp_error.h"
4
6
 
5
7
  /* Attempt to initialize the embedded python interpreter.
6
8
  Return 1 if we initialize it here and 0 if the interpreter is
@@ -8,7 +10,7 @@
8
10
  */
9
11
  int rpSafeStart()
10
12
  {
11
- int here;
13
+ int here = 0;
12
14
 
13
15
  if(!Py_IsInitialized())
14
16
  {
@@ -73,10 +75,9 @@ VALUE rpCall(PyObject* pFunc, VALUE args)
73
75
  VALUE rpCallWithModule(VALUE module, VALUE name, VALUE args)
74
76
  {
75
77
 
76
- VALUE rArgs;
77
78
  VALUE rReturn;
78
79
 
79
- PyObject *pModule, *pFunc, *pArgs, *pReturn;
80
+ PyObject *pModule, *pFunc;
80
81
 
81
82
 
82
83
  // Load the requested python module
@@ -32,12 +32,12 @@ end
32
32
  # exit -1
33
33
  #end
34
34
  $LDFLAGS << " " + `python-config --ldflags`
35
+ $CPPFLAGS << " " + `python-config --includes`.chomp
35
36
 
36
37
  if RUBY_VERSION=~/1\.9/ then
37
38
  puts "Building for Ruby 1.9"
38
39
  $CPPFLAGS += " -DRUBY_19"
39
40
  end
40
41
 
41
- find_header("Python.h",*`python-config --includes`.split.map{|s| s[2..-1]<<"/"})
42
42
 
43
43
  create_makefile("rubypython_bridge")
@@ -1,5 +1,10 @@
1
1
  #include "ptor.h"
2
2
 
3
+ #include "rp_error.h"
4
+ #include "rp_function.h"
5
+ #include "rp_instance.h"
6
+ #include "rp_class.h"
7
+
3
8
 
4
9
  /* Note:
5
10
  The conversion functions for the builtin types are just that,
@@ -6,5 +6,6 @@
6
6
 
7
7
  VALUE blank_undef_if(VALUE, VALUE);
8
8
  VALUE blank_obj_prep(VALUE);
9
+ inline void Init_BlankObject();
9
10
 
10
- #endif
11
+ #endif
@@ -48,9 +48,9 @@ from within ruby. Most users need not concern themselves with anything about thi
48
48
  its existence.
49
49
 
50
50
  */
51
- void Init_RubyPyClass()
51
+ inline void Init_RubyPyClass()
52
52
  {
53
53
  cRubyPyClass = rb_define_class_under(mRubyPythonBridge,"RubyPyClass", cRubyPyObject);
54
54
  rb_define_method(cRubyPyClass,"method_missing", rpModuleDelegate,- 2);
55
55
  rb_define_method(cRubyPyClass,"new", rpClassNew,- 2);
56
- }
56
+ }
@@ -3,4 +3,5 @@
3
3
  #ifndef _RP_CLASS_H_
4
4
  #define _RP_CLASS_H_
5
5
  VALUE rpClassFromPyObject(PyObject*);
6
- #endif
6
+ inline void Init_RubyPyClass();
7
+ #endif
@@ -1,4 +1,5 @@
1
1
  #include "rp_error.h"
2
+ #include "ptor.h"
2
3
 
3
4
  VALUE ePythonError;
4
5
  VALUE eRubyPyError;
@@ -26,8 +27,8 @@ void rpRubyPyError(char* eString) {
26
27
  Used to pass error information back into Ruby should an error occur in the embedded Python
27
28
  interpreter.
28
29
  */
29
- void Init_RubyPyError()
30
+ inline void Init_RubyPyError()
30
31
  {
31
32
  ePythonError = rb_define_class("PythonError", rb_eException);
32
33
  eRubyPyError = rb_define_class("RubyPyError", rb_eException);
33
- }
34
+ }
@@ -6,5 +6,6 @@
6
6
  void rpPythonError();
7
7
 
8
8
  void rpRubyPyError(char*);
9
+ inline void Init_RubyPyError();
9
10
 
10
11
  #endif /* _RP_ERROR_H_ */
@@ -25,7 +25,7 @@ VALUE rpFunctionFromPyObject(PyObject *pFunc)
25
25
  // This is used internally to aid RubyPyClass in delegating method calls.
26
26
  //
27
27
 
28
- void Init_RubyPyFunction()
28
+ inline void Init_RubyPyFunction()
29
29
  {
30
30
  cRubyPyFunction = rb_define_class_under(mRubyPythonBridge,"RubyPyFunction", cRubyPyObject);
31
- }
31
+ }
@@ -3,4 +3,5 @@
3
3
  #ifndef _RP_FUNCTION_H_
4
4
  #define _RP_FUNCTION_H_
5
5
  VALUE rpFunctionFromPyObject(PyObject*);
6
- #endif
6
+ inline void Init_RubyPyFunction();
7
+ #endif
@@ -2,6 +2,7 @@
2
2
 
3
3
  #include "rp_object.h"
4
4
  #include "rp_function.h"
5
+ #include "rp_util.h"
5
6
 
6
7
  RUBY_EXTERN VALUE mRubyPythonBridge;
7
8
 
@@ -39,10 +40,8 @@ VALUE rpInstanceFromPyObject(PyObject* pInst)
39
40
  static
40
41
  VALUE rpInstanceSetAttr(VALUE self, VALUE args)
41
42
  {
42
- VALUE name, name_string, rClassDict, result, rInstDict;
43
- VALUE ret;
43
+ VALUE name, name_string, rClassDict, rInstDict;
44
44
 
45
- int instance;
46
45
  char* cname;
47
46
 
48
47
  PObj *pClassDict,*pInstDict,*pDict;
@@ -156,7 +155,7 @@ VALUE rpInstanceDelegate(VALUE self, VALUE args)
156
155
  }
157
156
 
158
157
 
159
- void Init_RubyPyInstance()
158
+ inline void Init_RubyPyInstance()
160
159
  {
161
160
  cRubyPyInstance = rb_define_class_under(mRubyPythonBridge,"RubyPyInstance", cRubyPyObject);
162
161
  rb_define_method(cRubyPyInstance,"method_missing", rpInstanceDelegate,- 2);
@@ -3,4 +3,5 @@
3
3
  #ifndef _RP_INSTANCE_H_
4
4
  #define _RP_INSTANCE_H_
5
5
  VALUE rpInstanceFromPyObject(PyObject*);
6
- #endif
6
+ inline void Init_RubyPyInstance();
7
+ #endif
@@ -2,6 +2,7 @@
2
2
 
3
3
  #include "rp_object.h"
4
4
  #include "rp_function.h"
5
+ #include "rp_util.h"
5
6
 
6
7
  VALUE cRubyPyModule;
7
8
 
@@ -10,21 +11,21 @@ RUBY_EXTERN VALUE cRubyPyFunction;
10
11
  RUBY_EXTERN VALUE cRubyPyClass;
11
12
  RUBY_EXTERN VALUE cRubyPyObject;
12
13
 
13
- static
14
- VALUE rpModuleCallFunction(VALUE self, VALUE func_name, VALUE args)
15
- {
16
- PyObject *pModule,*pFunc;
17
- VALUE rReturn;
18
-
19
- pModule = rpObjectGetPyObject(self);
20
-
21
- pFunc = rpGetFunctionWithModule(pModule, func_name);
22
- rReturn = rpCall(pFunc, args);
23
- Py_XDECREF(pFunc);
24
-
25
- return rReturn;
26
-
27
- }
14
+ //static
15
+ //VALUE rpModuleCallFunction(VALUE self, VALUE func_name, VALUE args)
16
+ //{
17
+ // PyObject *pModule,*pFunc;
18
+ // VALUE rReturn;
19
+ //
20
+ // pModule = rpObjectGetPyObject(self);
21
+ //
22
+ // pFunc = rpGetFunctionWithModule(pModule, func_name);
23
+ // rReturn = rpCall(pFunc, args);
24
+ // Py_XDECREF(pFunc);
25
+ //
26
+ // return rReturn;
27
+ //
28
+ //}
28
29
 
29
30
  //:nodoc:
30
31
  static
@@ -151,9 +152,9 @@ return either the equivalent attribute converted to a native Ruby type, or wrapp
151
152
  to a Python object. RubyPyModule instances should be created through the use of RubyPython.import.
152
153
 
153
154
  */
154
- void Init_RubyPyModule()
155
+ inline void Init_RubyPyModule()
155
156
  {
156
157
  cRubyPyModule = rb_define_class_under(mRubyPythonBridge,"RubyPyModule", cRubyPyObject);
157
158
  rb_define_method(cRubyPyModule,"initialize", rpModuleInit, 1);
158
159
  rb_define_method(cRubyPyModule,"method_missing", rpModuleDelegate,- 2);
159
- }
160
+ }
@@ -4,4 +4,5 @@
4
4
  #define _RP_MODULE_H_
5
5
  // Ruby wrapper for Python Modules
6
6
  VALUE rpModuleDelegate(VALUE, VALUE);
7
- #endif
7
+ inline void Init_RubyPyModule();
8
+ #endif
@@ -19,4 +19,5 @@ VALUE rpObjectFromPyObject(PyObject*);
19
19
  int rpHasSymbol(VALUE, ID);
20
20
 
21
21
  VALUE rpRespondsTo(VALUE, VALUE);
22
- #endif
22
+ inline void Init_RubyPyObject();
23
+ #endif
@@ -2,6 +2,8 @@
2
2
 
3
3
  #include "rp_object.h"
4
4
  #include "rp_function.h"
5
+ #include "rp_instance.h"
6
+ #include "rp_class.h"
5
7
 
6
8
  RUBY_EXTERN VALUE mRubyPythonBridge;
7
9
  RUBY_EXTERN VALUE ePythonError;
@@ -55,7 +55,7 @@ PyObject* rtopArrayToTuple(VALUE rArray)
55
55
 
56
56
  PyObject* rtopHash(VALUE rHash)
57
57
  {
58
- PyObject *pDict,*pKey,*pVal;
58
+ PyObject *pDict;
59
59
  VALUE rKeys;
60
60
  VALUE rKey, rVal;
61
61
  int i;
@@ -10,6 +10,7 @@
10
10
  #include "rp_module.h"
11
11
  #include "rp_class.h"
12
12
  #include "rp_function.h"
13
+ #include "rp_instance.h"
13
14
 
14
15
  VALUE mRubyPythonBridge;
15
16
 
@@ -2,7 +2,7 @@ module RubyPython
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 10
5
+ TINY = 11
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -38,7 +38,7 @@ namespace :extconf do
38
38
 
39
39
  file ext_so => ext_files do
40
40
  Dir.chdir(ext) do
41
- sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
41
+ sh(RUBY_PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
42
42
  if !ok
43
43
  require "fileutils"
44
44
  FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
@@ -46,4 +46,4 @@ namespace :extconf do
46
46
  end
47
47
  end
48
48
  end
49
- end
49
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubypython
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 10
10
- version: 0.2.10
9
+ - 11
10
+ version: 0.2.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Zach Raines
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-08 00:00:00 -04:00
18
+ date: 2010-07-12 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -63,7 +63,6 @@ extra_rdoc_files:
63
63
  - Manifest.txt
64
64
  - PostInstall.txt
65
65
  - README.txt
66
- - website/index.txt
67
66
  files:
68
67
  - History.txt
69
68
  - License.txt
@@ -71,8 +70,6 @@ files:
71
70
  - PostInstall.txt
72
71
  - README.txt
73
72
  - Rakefile
74
- - config/hoe.rb
75
- - config/requirements.rb
76
73
  - ext/rubypython_bridge/cbridge.c
77
74
  - ext/rubypython_bridge/cbridge.h
78
75
  - ext/rubypython_bridge/config.h
@@ -103,28 +100,16 @@ files:
103
100
  - lib/rubypython/session.rb
104
101
  - lib/rubypython/version.rb
105
102
  - lib/rubypython/wrapper_extensions.rb
106
- - script/console
107
- - script/destroy
108
- - script/generate
109
- - script/txt2html
110
103
  - setup.rb
111
- - tasks/deployment.rake
112
104
  - tasks/environment.rake
113
105
  - tasks/extconf.rake
114
106
  - tasks/extconf/rubypython_bridge.rake
115
- - tasks/website.rake
116
107
  - test/python_helpers/objects.py
117
- - test/python_helpers/objects.pyc
118
108
  - test/test.wav
119
109
  - test/test_helper.rb
120
110
  - test/test_rubypython.rb
121
111
  - test/test_rubypython_bridge_extn.rb
122
112
  - test/test_session.rb
123
- - website/index.html
124
- - website/index.txt
125
- - website/javascripts/rounded_corners_lite.inc.js
126
- - website/stylesheets/screen.css
127
- - website/template.html.erb
128
113
  has_rdoc: true
129
114
  homepage: http://rubypython.rubyforge.org
130
115
  licenses: []
@@ -143,7 +128,6 @@ rdoc_options:
143
128
  - README.txt
144
129
  require_paths:
145
130
  - lib
146
- - ext/rubypyapi
147
131
  - ext/rubypython_bridge
148
132
  required_ruby_version: !ruby/object:Gem::Requirement
149
133
  none: false
data/config/hoe.rb DELETED
@@ -1,75 +0,0 @@
1
- require 'rubypython/version'
2
-
3
- AUTHOR = 'Zach Raines'
4
- EMAIL = "achatesavc+rubypython@gmail.com"
5
- DESCRIPTION = "A bridge between ruby and python"
6
- GEM_NAME = 'rubypython'
7
- RUBYFORGE_PROJECT = 'rubypython'
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
10
- EXTRA_DEPENDENCIES = [
11
- # ['activesupport', '>= 1.3.1']
12
- ] # An array of rubygem dependencies [name, version]
13
-
14
- @config_file = "~/.rubyforge/user-config.yml"
15
- @config = nil
16
- RUBYFORGE_USERNAME = "sentient6"
17
- def rubyforge_username
18
- unless @config
19
- begin
20
- @config = YAML.load(File.read(File.expand_path(@config_file)))
21
- rescue
22
- puts <<-EOS
23
- ERROR: No rubyforge config file found: #{@config_file}
24
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
25
- - See http://newgem.rubyforge.org/rubyforge.html for more details
26
- EOS
27
- exit
28
- end
29
- end
30
- RUBYFORGE_USERNAME.replace @config["username"]
31
- end
32
-
33
-
34
- REV = nil
35
- # UNCOMMENT IF REQUIRED:
36
- # REV = YAML.load(`svn info`)['Revision']
37
- VERS = RubyPython::VERSION::STRING + (REV ? ".#{REV}" : "")
38
- RDOC_OPTS = ['--quiet', '--title', 'rubypython documentation',
39
- "--opname", "index.html",
40
- "--line-numbers",
41
- "--main", "README",
42
- "--inline-source"]
43
-
44
- class Hoe
45
- def extra_deps
46
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
47
- @extra_deps
48
- end
49
- end
50
-
51
- # Generate all the Rake tasks
52
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
53
- $hoe = Hoe.spec(GEM_NAME) do
54
- self.developer(AUTHOR, EMAIL)
55
- self.description = DESCRIPTION
56
- self.summary = DESCRIPTION
57
- self.url = HOMEPATH
58
- self.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
59
- self.test_globs = ["test/**/test_*.rb"]
60
- self.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
61
- self.version = VERS
62
- # == Optional
63
- self.changes = self.paragraphs_of("History.txt", 0..1).join("\n\n")
64
- #p.extra_deps = EXTRA_DEPENDENCIES
65
-
66
- self.spec_extras = {
67
- :requirements => ["Python, ~>2.4"]
68
- } # A hash of extra values to set in the gemspec.
69
- end
70
-
71
- CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
72
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
73
- $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
74
- $hoe.rsync_args = '-av --delete --ignore-errors'
75
- $hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""