rsruby 0.5 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -1
- data/Rakefile.rb +3 -3
- data/ext/R_eval.c +16 -10
- data/ext/rsruby.c +4 -4
- data/ext/rsruby.h +0 -1
- data/lib/rsruby.rb +1 -1
- metadata +6 -6
data/History.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
= 0.5.1 2008-11-11
|
2
|
+
|
3
|
+
* removed #include of Rdevices.h so installation is possible with R 2.8.0 packages
|
4
|
+
|
1
5
|
= 0.5 2008-04-18
|
2
6
|
|
3
7
|
* Added easy figure method RSRuby.img()
|
@@ -8,4 +12,5 @@
|
|
8
12
|
|
9
13
|
* Several bugs in the conversion system are fixed
|
10
14
|
* The test suite was expanded and tidied
|
11
|
-
* Using Hoe for package management
|
15
|
+
* Using Hoe for package management
|
16
|
+
|
data/Rakefile.rb
CHANGED
@@ -4,10 +4,10 @@ $LOAD_PATH.unshift("./lib")
|
|
4
4
|
$LOAD_PATH.unshift("./ext")
|
5
5
|
|
6
6
|
gem_name = RUBY_PLATFORM !~ /mswin32$/ ? "rsruby" : "rsrubywin"
|
7
|
-
hoe = Hoe.new(gem_name,'0.5') do |p|
|
7
|
+
hoe = Hoe.new(gem_name,'0.5.1') do |p|
|
8
8
|
|
9
|
-
p.author = "Alex Gutteridge"
|
10
|
-
p.email = "ag357@cam.ac.uk"
|
9
|
+
p.author = "Alex Gutteridge, Ben J Woodcroft"
|
10
|
+
p.email = "ag357@cam.ac.uk, b.woodcroft@pgrad.unimelb.edu.au"
|
11
11
|
p.url = "http://web.kuicr.kyoto-u.ac.jp/~alexg/rsruby/"
|
12
12
|
|
13
13
|
p.description = p.paragraphs_of("README.txt",1..3)[0]
|
data/ext/R_eval.c
CHANGED
@@ -32,11 +32,13 @@
|
|
32
32
|
#include <rsruby.h>
|
33
33
|
#include <R_eval.h>
|
34
34
|
|
35
|
+
int interrupted = 0;
|
36
|
+
|
35
37
|
/* Abort the current R computation due to a SIGINT */
|
36
38
|
void interrupt_R(int signum)
|
37
39
|
{
|
38
|
-
|
39
|
-
|
40
|
+
interrupted = 1;
|
41
|
+
error("Interrupted");
|
40
42
|
}
|
41
43
|
|
42
44
|
|
@@ -47,17 +49,21 @@ SEXP do_eval_expr(SEXP e) {
|
|
47
49
|
VALUE rb_eRException;
|
48
50
|
int error = 0;
|
49
51
|
|
52
|
+
signal(SIGINT, interrupt_R);
|
53
|
+
interrupted = 0;
|
54
|
+
|
50
55
|
res = R_tryEval(e, R_GlobalEnv, &error);
|
51
56
|
|
52
57
|
if (error) {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
if (interrupted) {
|
59
|
+
rb_raise(rb_eInterrupt,"RSRuby interrupted");
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
rb_eRException = rb_const_get(rb_cObject,
|
63
|
+
rb_intern("RException"));
|
64
|
+
rb_raise(rb_eRException, get_last_error_msg());
|
65
|
+
return NULL;
|
66
|
+
}
|
61
67
|
}
|
62
68
|
|
63
69
|
return res;
|
data/ext/rsruby.c
CHANGED
@@ -152,9 +152,9 @@ void init_R(int argc, char **argv){
|
|
152
152
|
|
153
153
|
/* This method is for testing catching of segfaults */
|
154
154
|
VALUE crash(){
|
155
|
-
|
156
|
-
|
157
|
-
|
155
|
+
int* ptr = (int*)0;
|
156
|
+
*ptr = 1;
|
157
|
+
return Qtrue;
|
158
158
|
}
|
159
159
|
|
160
160
|
|
@@ -171,7 +171,7 @@ void Init_rsruby_c(){
|
|
171
171
|
rb_define_method(cRRuby, "get_fun", get_fun, 1);
|
172
172
|
rb_define_method(cRRuby, "shutdown", rs_shutdown, 0);
|
173
173
|
|
174
|
-
rb_define_method(cRRuby, "crash", crash, 0);
|
174
|
+
rb_define_method(cRRuby, "crash", crash, 0);
|
175
175
|
|
176
176
|
//Add the lcall method to RObj
|
177
177
|
cRObj = rb_const_get(rb_cObject,rb_intern("RObj"));
|
data/ext/rsruby.h
CHANGED
data/lib/rsruby.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Alex Gutteridge
|
7
|
+
- Alex Gutteridge, Ben J Woodcroft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-26 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: RSRuby is a bridge library for Ruby giving Ruby developers access to the full R statistical programming environment. RSRuby embeds a full R interpreter inside the running Ruby script, allowing R methods to be called and data passed between the Ruby script and the R interpreter. Most data conversion is handled automatically, but user-definable conversion routines can also be written to handle any R or Ruby class.
|
17
|
-
email: ag357@cam.ac.uk
|
17
|
+
email: ag357@cam.ac.uk, b.woodcroft@pgrad.unimelb.edu.au
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions:
|
@@ -23,9 +23,9 @@ extra_rdoc_files:
|
|
23
23
|
- README.txt
|
24
24
|
- History.txt
|
25
25
|
- License.txt
|
26
|
-
- examples/arrayfields.rb
|
27
26
|
- examples/bioc.rb
|
28
27
|
- examples/dataframe.rb
|
28
|
+
- examples/arrayfields.rb
|
29
29
|
- examples/erobj.rb
|
30
30
|
files:
|
31
31
|
- History.txt
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
requirements: []
|
96
96
|
|
97
97
|
rubyforge_project: rsruby
|
98
|
-
rubygems_version: 1.1
|
98
|
+
rubygems_version: 1.3.1
|
99
99
|
signing_key:
|
100
100
|
specification_version: 2
|
101
101
|
summary: RSRuby is a bridge library for Ruby giving Ruby developers access to the full R statistical programming environment. RSRuby embeds a full R interpreter inside the running Ruby script, allowing R methods to be called and data passed between the Ruby script and the R interpreter. Most data conversion is handled automatically, but user-definable conversion routines can also be written to handle any R or Ruby class.
|