octave-ruby 2.0.0 → 2.0.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.
@@ -1,3 +1,8 @@
1
+ == 2.0.1 / 2012-11-09
2
+
3
+ * 1 major bug fix
4
+ * Fix crash when defining functions using eval
5
+
1
6
  == 2.0.0 / 2012-11-08
2
7
 
3
8
  * 2 major enhancements
@@ -28,6 +28,8 @@ VALUE or_feval(VALUE function_name, VALUE arguments)
28
28
 
29
29
  n = RARRAY_LEN(arguments);
30
30
 
31
+ bool is_function_definition = (n == 1 && FIXNUM_P(RARRAY_PTR(arguments)[0]) == 0 && strncmp(RSTRING_PTR(StringValue(RARRAY_PTR(arguments)[0])), "function ", 9) == 0);
32
+
31
33
  for (i = 0; i < n; i++) {
32
34
  argList(i) = OR_Variable(RARRAY_PTR(arguments)[i]).to_octave();
33
35
  }
@@ -44,7 +46,8 @@ VALUE or_feval(VALUE function_name, VALUE arguments)
44
46
  symbol_table::set_scope(symbol_table::top_scope());
45
47
  reset_error_handler();
46
48
 
47
- octave_value_list val = feval(std::string(RSTRING_PTR(function_name)), argList, 1);
49
+ int nargout = (is_function_definition ? 0 : 1);
50
+ octave_value_list val = feval(std::string(RSTRING_PTR(function_name)), argList, nargout);
48
51
  if(val.length() > 0 && val(0).is_defined()) {
49
52
  ruby_val = OR_Variable(val(0)).to_ruby();
50
53
  }
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{octave-ruby}
3
- s.version = "2.0.0"
3
+ s.version = "2.0.1"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Jonathan Younger"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 0
9
- version: 2.0.0
8
+ - 1
9
+ version: 2.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jonathan Younger