rserve-client 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/.gemtest ADDED
File without changes
@@ -1,3 +1,3 @@
1
1
  --color
2
2
  -f s
3
- -b
3
+ -b
data/History.txt CHANGED
@@ -1,3 +1,13 @@
1
+ === 0.3.0 / 2011-12-26
2
+
3
+ * Added some extra documentation
4
+ * Double#to_double return nils for NA values
5
+ * Make Rserve exceptions subclass StandardError instead of exception, so they can be rescued by `rescue` blocks. [Jamison Dance]
6
+ * Funtions raises an exception when using REXP#to_ruby. We can't work with them, yet, but at least we can see what they have
7
+ * New options on Rserve::Connection - :cmd_init : Command to init Rserve - :proc_rserve_ok: Proc to test if Rserve is running (see source code). Thanks to John Prince for the idea.
8
+ * String now accepts \xFF as NA value (Rserve-0.6.2)
9
+ * Updated for rspec 2.0 [John Prince]
10
+
1
11
  === 0.2.5 / 2010-07-06
2
12
  * Fixed warning: NA values on Double and shadowed variables on blocks
3
13
 
data/Manifest.txt CHANGED
@@ -1,4 +1,5 @@
1
1
  .autotest
2
+ .rspec
2
3
  History.txt
3
4
  Introduction.txt
4
5
  Manifest.txt
@@ -24,6 +25,7 @@ lib/rserve/rexp/double.rb
24
25
  lib/rserve/rexp/environment.rb
25
26
  lib/rserve/rexp/expressionvector.rb
26
27
  lib/rserve/rexp/factor.rb
28
+ lib/rserve/rexp/function.rb
27
29
  lib/rserve/rexp/genericvector.rb
28
30
  lib/rserve/rexp/integer.rb
29
31
  lib/rserve/rexp/language.rb
@@ -62,5 +64,4 @@ spec/rserve_session_spec.rb
62
64
  spec/rserve_spec.rb
63
65
  spec/rserve_talk_spec.rb
64
66
  spec/rserve_withnames_spec.rb
65
- spec/spec.opts
66
67
  spec/spec_helper.rb
data/Rakefile CHANGED
@@ -3,7 +3,14 @@ $:.unshift(File.dirname(__FILE__)+"/lib")
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
5
  require 'rserve'
6
+ require 'rubyforge'
6
7
  Hoe.plugin :git
8
+ Hoe.plugin :rubyforge
9
+
10
+ require 'rspec'
11
+ require 'rspec/core/rake_task'
12
+
13
+
7
14
  Hoe.spec 'rserve-client' do
8
15
  self.testlib=:rspec
9
16
  self.test_globs="spec/*_spec.rb"
@@ -11,6 +18,7 @@ Hoe.spec 'rserve-client' do
11
18
  self.rubyforge_name = 'ruby-statsample' # if different than 'rserve'
12
19
  self.remote_rdoc_dir = "rserve-client"
13
20
  self.developer('Claudio Bustos', 'clbustos_AT_gmail.com')
21
+ self.extra_dev_deps << ["rspec","~>2.0"]
14
22
  end
15
23
 
16
24
  # vim: syntax=ruby
data/lib/rserve.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'socket'
2
2
  require 'rbconfig'
3
3
  module Rserve
4
- VERSION = '0.2.5'
4
+ VERSION = '0.3.0'
5
5
  ON_WINDOWS=RbConfig::CONFIG['arch']=~/mswin|mingw/
6
6
  end
7
7
 
@@ -1,15 +1,16 @@
1
1
  module Rserve
2
+ # class providing TCP/IP connection to an Rserve
2
3
  class Connection < Rserve::Engine
3
4
  @@connected_object=nil
4
5
  include Rserve::Protocol
5
6
 
6
- # :section: Exceptions
7
- RserveNotStarted=Class.new(Exception)
8
- ServerNotAvailable=Class.new(Exception)
9
- IncorrectServer=Class.new(Exception)
10
- IncorrectServerVersion=Class.new(Exception)
11
- IncorrectProtocol=Class.new(Exception)
12
- NotConnected=Class.new(Exception)
7
+ # :section: Errors
8
+ RserveNotStartedError=Class.new(StandardError)
9
+ ServerNotAvailableError=Class.new(StandardError)
10
+ IncorrectServerError=Class.new(StandardError)
11
+ IncorrectServerVersionError=Class.new(StandardError)
12
+ IncorrectProtocolError=Class.new(StandardError)
13
+ NotConnectedError=Class.new(StandardError)
13
14
  # Eval error
14
15
  class EvalError < RuntimeError
15
16
  attr_accessor :request_packet
@@ -32,9 +33,20 @@ module Rserve
32
33
  attr_writer :transfer_charset
33
34
  attr_reader :rsrv_version
34
35
  attr_writer :persistent
36
+ # authorization type: plain text
35
37
  AT_plain=0
38
+ # authorization type: unix crypt
36
39
  AT_crypt=1
37
-
40
+ # Make a new local connection
41
+ # You could provide a hash with options. Options are analog to java client:
42
+ # [+:auth_req+] If authentification is required (false by default)
43
+ # [+:transfer_charset+] Transfer charset ("UTF-8" by default)
44
+ # [+:auth_type+] Type of authentification (AT_plain by default)
45
+ # [+:hostname+] Hostname of Rserve ("127.0.0.1" by default)
46
+ # [+:port_number+] Port Number of Rserve (6311 by default)
47
+ # [+:max_tries+] Maximum number of tries before give up (5 by default)
48
+ # [+:cmd_init+] Command to init Rserve if not initialized ("R CMD Rserve" by default)
49
+ # [+:proc_rserve_ok+] Proc testing if Rserve works (uses system by default)
38
50
  def initialize(opts=Hash.new)
39
51
  @auth_req = opts.delete(:auth_req) || false
40
52
  @transfer_charset = opts.delete(:transfer_charset) || "UTF-8"
@@ -42,6 +54,8 @@ module Rserve
42
54
  @hostname = opts.delete(:hostname) || "127.0.0.1"
43
55
  @port_number = opts.delete(:port_number) || 6311
44
56
  @max_tries = opts.delete(:max_tries) || 5
57
+ @cmd_init = opts.delete(:cmd_init) || "R CMD Rserve"
58
+ @proc_rserve_ok = opts.delete(:proc_rserve_ok) || lambda { system "killall -s 0 Rserve" }
45
59
  @session = opts.delete(:session) || nil
46
60
  @tries = 0
47
61
  @connected=false
@@ -56,17 +70,17 @@ module Rserve
56
70
  if @tries<@max_tries
57
71
  @tries+=1
58
72
  # Rserve is available?
59
- if system "killall -s 0 Rserve"
73
+ if @proc_rserve_ok.call
60
74
  # Rserve is available. Incorrect host and/or portname
61
- raise ServerNotAvailable, "Rserve started, but not available on #{hostname}:#{port_number}"
75
+ raise ServerNotAvailableError, "Rserve started, but not available on #{hostname}:#{port_number}"
62
76
  # Rserve not available. We should instanciate it first
63
77
  else
64
- if system "R CMD Rserve"
65
- # Wait a moment please
78
+ if system @cmd_init
79
+ # Wait a moment, please
66
80
  sleep(0.25)
67
81
  retry
68
82
  else
69
- raise RserveNotStarted, "Can't start Rserve"
83
+ raise RserveNotStartedError, "Can't start Rserve"
70
84
  end
71
85
  end
72
86
  #puts "Init RServe"
@@ -76,6 +90,8 @@ module Rserve
76
90
  end
77
91
  end
78
92
  end
93
+
94
+
79
95
  def connect
80
96
  # On windows, Rserve doesn't allows concurrent connections.
81
97
  # So, we must close the last open connection first
@@ -91,11 +107,11 @@ module Rserve
91
107
  #puts "Connected"
92
108
  # Accept first input
93
109
  input=@s.recv(32).unpack("a4a4a4a4a4a4a4a4")
94
- raise IncorrectServer,"Handshake failed: Rsrv signature expected, but received [#{input[0]}]" unless input[0]=="Rsrv"
110
+ raise IncorrectServerError, "Handshake failed: Rsrv signature expected, but received [#{input[0]}]" unless input[0]=="Rsrv"
95
111
  @rsrv_version=input[1].to_i
96
- raise IncorrectServerVersion, "Handshake failed: The server uses more recent protocol than this client." if @rsrv_version>103
112
+ raise IncorrectServerVersionError, "Handshake failed: The server uses more recent protocol than this client." if @rsrv_version>103
97
113
  @protocol=input[2]
98
- raise IncorrectProtocol, "Handshake failed: unsupported transfer protocol #{@protocol}, I talk only QAP1." if @protocol!="QAP1"
114
+ raise IncorrectProtocolError, "Handshake failed: unsupported transfer protocol #{@protocol}, I talk only QAP1." if @protocol!="QAP1"
99
115
  (3..7).each do |i|
100
116
  attr=input[i]
101
117
  if (attr=="ARpt")
@@ -121,9 +137,13 @@ module Rserve
121
137
  @@connected_object=self
122
138
  @last_error="OK"
123
139
  end
140
+ # Check connection state. Note that currently this state is not checked on-the-spot, that is if connection went down by an outside event this is not reflected by the flag.
141
+ # return +true+ if this connection is alive
124
142
  def connected?
125
143
  @connected
126
144
  end
145
+
146
+ # Closes current connection
127
147
  def close
128
148
  if !@s.nil? and !@s.closed?
129
149
  @s.close_write
@@ -134,6 +154,7 @@ module Rserve
134
154
  @@connected_object=nil
135
155
  true
136
156
  end
157
+ # Get server version as reported during the handshake.
137
158
  def get_server_version
138
159
  @rsrv_version
139
160
  end
@@ -141,7 +162,7 @@ module Rserve
141
162
  # evaluates the given command, but does not fetch the result (useful for assignment operations)
142
163
  # * @param cmd command/expression string */
143
164
  def void_eval(cmd)
144
- raise NotConnected if !connected? or rt.nil?
165
+ raise NotConnectedError if !connected? or rt.nil?
145
166
  rp=rt.request(:cmd=>Rserve::Protocol::CMD_voidEval, :cont=>cmd+"\n")
146
167
  if !rp.nil? and rp.ok?
147
168
  true
@@ -151,9 +172,13 @@ module Rserve
151
172
 
152
173
  end
153
174
 
154
-
175
+
176
+ # Evaluates the given command, detaches the session (see detach()) and closes connection while the command is being evaluted (requires Rserve 0.4+).
177
+ # Note that a session cannot be attached again until the commad was successfully processed. Technically the session is put into listening mode while the command is being evaluated but accept is called only after the command was evaluated. One commonly used techique to monitor detached working sessions is to use second connection to poll the status (e.g. create a temporary file and return the full path before detaching thus allowing new connections to read it).
178
+ # * @param cmd command/expression string.
179
+ # * @return session object that can be use to attach back to the session once the command completed
155
180
  def void_eval_detach(cmd)
156
- raise NotConnected if !connected? or rt.nil?
181
+ raise NotConnectedError if !connected? or rt.nil?
157
182
  rp=rt.request(:cmd=>Rserve::Protocol::CMD_detachedVoidEval,:cont=>cmd+"\n")
158
183
  if rp.nil? or !rp.ok?
159
184
  raise EvalError.new(rp), "detached void eval failed : #{rp.to_s}"
@@ -170,7 +195,7 @@ module Rserve
170
195
  # * @param cmd command/expression string
171
196
  # * @return R-xpression or <code>null</code> if an error occured */
172
197
  def eval(cmd)
173
- raise NotConnected if !connected? or rt.nil?
198
+ raise NotConnectedError if !connected? or rt.nil?
174
199
  rp=rt.request(:cmd=>Rserve::Protocol::CMD_eval, :cont=>cmd+"\n")
175
200
  if !rp.nil? and rp.ok?
176
201
  parse_eval_response(rp)
@@ -186,9 +211,12 @@ module Rserve
186
211
  if (rsrv_version>100) # /* since 0101 eval responds correctly by using DT_SEXP type/len header which is 4 bytes long */
187
212
  rxo=4
188
213
  # we should check parameter type (should be DT_SEXP) and fail if it's not
189
- if (pc[0]!=Rserve::Protocol::DT_SEXP && pc[0]!=(Rserve::Protocol::DT_SEXP|Rserve::Protocol::DT_LARGE))
190
- raise "Error while processing eval output: SEXP (type "+Rserve::Protocol::DT_SEXP+") expected but found result type "+pc[0].to_s+"."
214
+ if pc.nil?
215
+ raise "Error while processing eval output: SEXP (type #{Rserve::Protocol::DT_SEXP}) expected but nil returned"
216
+ elsif (pc[0]!=Rserve::Protocol::DT_SEXP and pc[0]!=(Rserve::Protocol::DT_SEXP|Rserve::Protocol::DT_LARGE))
217
+ raise "Error while processing eval output: SEXP (type #{Rserve::Protocol::DT_SEXP}) expected but found result type "+pc[0].to_s+"."
191
218
  end
219
+
192
220
  if (pc[0]==(Rserve::Protocol::DT_SEXP|Rserve::Protocol::DT_LARGE))
193
221
  rxo=8; # large data need skip of 8 bytes
194
222
  end
@@ -207,7 +235,7 @@ module Rserve
207
235
  # @param sym symbol name. Currently assign uses CMD_setSEXP command of Rserve, i.e. the symbol value is NOT parsed. It is the responsibility of the user to make sure that the symbol name is valid in R (recall the difference between a symbol and an expression!). In fact R will always create the symbol, but it may not be accessible (examples: "bar\nfoo" or "bar$foo").
208
236
  # @param ct contents
209
237
  def assign(sym, ct)
210
- raise NotConnected if !connected? or rt.nil?
238
+ raise NotConnectedError if !connected? or rt.nil?
211
239
  case ct
212
240
  when String
213
241
  assign_string(sym,ct)
@@ -217,6 +245,7 @@ module Rserve
217
245
  assign_rexp(sym, Rserve::REXP::Wrapper.wrap(ct))
218
246
  end
219
247
  end
248
+
220
249
  def assign_string(sym,ct)
221
250
  symn = sym.unpack("C*")
222
251
  ctn = ct.unpack("C*")
@@ -271,8 +300,12 @@ module Rserve
271
300
  raise "Assign Failed"
272
301
  end
273
302
  end
303
+
304
+
305
+ # Shutdown remote Rserve.
306
+ # Note that some Rserves cannot be shut down from the client side
274
307
  def shutdown
275
- raise NotConnected if !connected? or rt.nil?
308
+ raise NotConnectedError if !connected? or rt.nil?
276
309
  rp=rt.request(:cmd=>Rserve::Protocol::CMD_shutdown)
277
310
  if !rp.nil? and rp.ok?
278
311
  true
@@ -280,11 +313,11 @@ module Rserve
280
313
  raise "Shutdown failed"
281
314
  end
282
315
  end
283
- # detaches the session and closes the connection (requires Rserve 0.4+).
284
- # The session can be only resumed by calling RSession.attach
285
316
 
317
+ # Detaches the session and closes the connection (requires Rserve 0.4+).
318
+ # The session can be only resumed by calling RSession.attach
286
319
  def detach
287
- raise NotConnected if !connected? or rt.nil?
320
+ raise NotConnectedError if !connected? or rt.nil?
288
321
  rp=rt.request(:cmd=>Rserve::Protocol::CMD_detachSession)
289
322
  if !rp.nil? and rp.ok?
290
323
  s=Rserve::Session.new(self,rp)
@@ -9,7 +9,7 @@ module Rserve
9
9
  # See Rtalk class on Java version.
10
10
  module Protocol
11
11
  # Arch dependent Long Nil value
12
- case Config::CONFIG['arch']
12
+ case RbConfig::CONFIG['arch']
13
13
  when /i686-linux|mswin|mingw/
14
14
  LONG_NA=9221120237041092514 # :nodoc:
15
15
  else
@@ -282,7 +282,7 @@ module Rserve
282
282
 
283
283
  name=nf.cont.as_string if(nf.cont.symbol? or nf.cont.string?)
284
284
  end
285
- puts "Agregando '#{name}'='#{lc.cont.inspect}'" if $DEBUG
285
+ puts "Adding '#{name}'='#{lc.cont.inspect}'" if $DEBUG
286
286
  if name.nil?
287
287
  l.push(lc.cont)
288
288
  else
@@ -436,7 +436,15 @@ module Rserve
436
436
  end
437
437
 
438
438
  if (xt==XT_CLOS)
439
- o=eox;
439
+ headf = REXPFactory.new()
440
+ bodyf = REXPFactory.new()
441
+ o=headf.parse_REXP(buf,o)
442
+ o=bodyf.parse_REXP(buf,o)
443
+ @cont=REXP::Function.new(headf.cont,bodyf.cont)
444
+ if o!=eox
445
+ $STDERR.puts "CLOS SEXP size mismatch"
446
+ o=eox
447
+ end
440
448
  return o;
441
449
  end
442
450
 
data/lib/rserve/rexp.rb CHANGED
@@ -1,12 +1,11 @@
1
1
  module Rserve
2
- # Basic class representing an object of any type in R. Each type in R in represented by a specific subclass.
3
- #
4
- # This class defines basic accessor methods (<tt>as</tt>_<i>xxx</i>), type check methods (<i>XXX</i><tt>?</tt>), gives access to attributes (REXP.get_attribute, REXP.has_attribute?) as well as several convenience methods. If a given method is not applicable to a particular type, it will throw the MismatchException exception.
2
+ # Basic class representing an object of any type in R. Each type in R in represented by a specific subclass.
3
+ # This class defines basic accessor methods (<tt>as</tt>_<i>xxx</i>), type check methods (<i>XXX</i><tt>?</tt>), gives access to attributes (REXP.get_attribute, REXP.has_attribute?) as well as several convenience methods. If a given method is not applicable to a particular type, it will throw the MismatchError exception.
5
4
  #
6
5
  # This root class will throw on any accessor call and returns <code>false</code> for all type methods. This allows subclasses to override accessor and type methods selectively.
7
6
  #
8
7
  class REXP
9
- MismatchException= Class.new(Exception)
8
+ MismatchError= Class.new(StandardError)
10
9
  attr_reader :attr
11
10
  def initialize(attr=nil)
12
11
  # Sorry for this, but I think is necessary to maintain sanity of attributes
@@ -126,14 +125,14 @@ module Rserve
126
125
  #
127
126
  # @return [Array]
128
127
  def as_strings
129
- raise MismatchException, "String"
128
+ raise MismatchError, "String"
130
129
  end
131
130
  # returns the contents as an array of integers (if supported by the represented object)
132
131
  #
133
132
  # @return [Array]
134
133
 
135
134
  def as_integers
136
- raise MismatchException, "int"
135
+ raise MismatchError, "int"
137
136
  end
138
137
 
139
138
  # returns the contents as an array of floats (C double precision) (if supported by the represented object).
@@ -141,7 +140,7 @@ module Rserve
141
140
  # @return [Array]
142
141
 
143
142
  def as_doubles
144
- raise MismatchException,"double"
143
+ raise MismatchError,"double"
145
144
  end
146
145
 
147
146
  # On Ruby, Float are stored in double precision.
@@ -156,26 +155,26 @@ module Rserve
156
155
  # @return [Array]
157
156
 
158
157
  def as_bytes
159
- raise MismatchException , "byte"
158
+ raise MismatchError , "byte"
160
159
  end
161
160
  # returns the contents as a (named) list (if supported by the represented object)
162
161
  #
163
162
  # @return [Array]
164
163
  def as_list
165
- raise MismatchException,"list"
164
+ raise MismatchError,"list"
166
165
  end
167
166
  # returns the contents as a factor (if supported by the represented object).
168
167
  #
169
168
  # @return [RFactor]
170
169
  def as_factor
171
- raise MismatchException,"factor"
170
+ raise MismatchError,"factor"
172
171
  end
173
172
 
174
173
  # returns the length of a vector object. Note that we use R semantics here, i.e. a matrix will have a length of <i>m * n</i> since it is represented by a single vector (see REXP.dim) for retrieving matrix and multidimentional-array dimensions).
175
174
  #
176
175
  # @return [Integer] length (number of elements) in a vector object.
177
176
  def length
178
- raise MismatchException, "vector"
177
+ raise MismatchError, "vector"
179
178
  end
180
179
 
181
180
  # returns a boolean vector of the same length as this vector with <code>true</code> for NA values and <code>false</code> for any other values.
@@ -183,7 +182,7 @@ module Rserve
183
182
  # @return [boolean] a boolean vector of the same length as this vector with <code>true</code> for NA values and <code>false</code> for any other values.
184
183
  #
185
184
  def na?
186
- raise MismatchException, "vector"
185
+ raise MismatchError, "vector"
187
186
  end
188
187
 
189
188
  # :section: convenience accessor methods
@@ -255,7 +254,7 @@ module Rserve
255
254
  def dim
256
255
  begin
257
256
  return has_attribute?("dim") ? @attr.as_list['dim'].as_integers : nil;
258
- rescue MismatchException
257
+ rescue MismatchError
259
258
  # nothing to do
260
259
  end
261
260
  nil
@@ -272,7 +271,7 @@ module Rserve
272
271
  if (!c.nil?)
273
272
  return c.any? {|v| v.equals klass}
274
273
  end
275
- rescue MismatchException
274
+ rescue MismatchError
276
275
  end
277
276
  false
278
277
  end
@@ -298,9 +297,9 @@ module Rserve
298
297
  def as_double_matrix
299
298
  ct = as_doubles()
300
299
  dim = get_attribute "dim"
301
- raise MismatchException, "matrix (dim attribute missing)" if dim.nil?
300
+ raise MismatchError, "matrix (dim attribute missing)" if dim.nil?
302
301
  ds = dim.as_integers
303
- raise MismatchException, "matrix (wrong dimensionality)" if (ds.length!=2)
302
+ raise MismatchError, "matrix (wrong dimensionality)" if (ds.length!=2)
304
303
  as_nested_array
305
304
 
306
305
  #m,n = ds[0], ds[1]
@@ -321,7 +320,7 @@ module Rserve
321
320
  def as_nested_array
322
321
  ct=as_doubles
323
322
  dim = get_attribute "dim"
324
- raise MismatchException, "array (dim attribute missing" if dim.nil?
323
+ raise MismatchError, "array (dim attribute missing" if dim.nil?
325
324
  ds = dim.as_integers.reverse
326
325
  split_array(ct,ds)
327
326
  end
@@ -367,8 +366,8 @@ module Rserve
367
366
  # * @param [Rlist] a (named) list of vectors (REXP::Vector subclasses), each element corresponds to a column and all elements must have the same length.
368
367
  # * @return [GenericVector] a data frame object representation.
369
368
  def self.create_data_frame(l)
370
- raise(MismatchException, "data frame (must have dim>0)") if l.nil? or l.size<1
371
- raise MismatchException, "data frame (contents must be vectors)" if (!(l[0].is_a? REXP::Vector))
369
+ raise(MismatchError, "data frame (must have dim>0)") if l.nil? or l.size<1
370
+ raise MismatchError, "data frame (contents must be vectors)" if (!(l[0].is_a? REXP::Vector))
372
371
  fe = l[0]
373
372
  return REXP::GenericVector.new(l,
374
373
  REXP::List.new(
@@ -385,8 +384,7 @@ module Rserve
385
384
  # Retrieves the best Ruby representation of data
386
385
  #
387
386
  # If R object has attributes, the Ruby object is extended with Rserve::WithAttributes.
388
- # If R object is names, the Ruby object is extended with Rserve::WithNames and
389
- # their elements can be accessed with [] using numbers and literals.
387
+ # If R object have names, the Ruby object is extended with Rserve::WithNames and their elements can be accessed with [] using numbers and literals.
390
388
  #
391
389
  # @return [Object] Ruby object.
392
390
  def to_ruby
@@ -410,7 +408,6 @@ module Rserve
410
408
  v.attributes['row.names']=(1..(-attr.as_list['row.names'].as_integers[1])).to_a
411
409
  end
412
410
 
413
-
414
411
  v
415
412
  end
416
413
  # Return the bare-bone representation of REXP as a Ruby Object.
@@ -450,4 +447,5 @@ require 'rserve/rexp/s4'
450
447
  require 'rserve/rexp/reference'
451
448
 
452
449
  require 'rserve/rexp/wrapper'
450
+ require 'rserve/rexp/function'
453
451
 
@@ -4,7 +4,7 @@ module Rserve
4
4
  class Double < REXP::Vector
5
5
  attr_reader :payload
6
6
  # NA is arch dependent
7
- case Config::CONFIG['arch']
7
+ case RbConfig::CONFIG['arch']
8
8
  when /i686-linux|mswin|mingw/
9
9
  NA = 269653970229425383598692395468593241088322026492507901905402939417320933254485890939796955099302180188971623023005661539310855695935759376615857567599472873400528811349204333736152257830107446553333670133666606746438802800063353690283455789426038632208916715592554825644961573453826957827246636338344317943808
10
10
  else
@@ -34,11 +34,13 @@ module Rserve
34
34
  true
35
35
  end
36
36
  def as_integers
37
- @payload.map(&:to_i)
37
+ @payload.map do |v|
38
+ na?(v) ? nil : v.to_i
39
+ end
38
40
  end
39
41
  def as_doubles
40
42
  @payload.map do |v|
41
- na?(v) ? NA : v.to_f
43
+ na?(v) ? nil : v.to_f
42
44
  end
43
45
  end
44
46
  def as_strings
@@ -8,9 +8,9 @@ module Rserve
8
8
  # * @param eng engine responsible for this environment
9
9
  # * @param handle handle used by the engine to identify this environment
10
10
  def initialize(e,h)
11
- super();
12
- @eng = e;
13
- @handle = h;
11
+ super()
12
+ @eng = e
13
+ @handle = h
14
14
  end
15
15
  def environment?
16
16
  true
@@ -0,0 +1,16 @@
1
+ module Rserve
2
+ class REXP
3
+ # represents a Function in R
4
+ class Function < REXP
5
+ attr_accessor :head, :body
6
+ def initialize(head,body)
7
+ super()
8
+ @head=head
9
+ @body=body
10
+ end
11
+ def to_ruby
12
+ {:head=>@head.to_ruby,:body=>@body.to_ruby}
13
+ end
14
+ end
15
+ end
16
+ end
@@ -3,7 +3,6 @@ module Rserve
3
3
  class Language < REXP::List
4
4
  def initialize(list, attr=nil)
5
5
  super(list,attr)
6
-
7
6
  end
8
7
  def language?
9
8
  true
@@ -2,7 +2,7 @@ module Rserve
2
2
  class REXP
3
3
  class String < REXP::Vector
4
4
  attr_reader :payload
5
- NA="NA"
5
+ NA=["NA", "\xFF"]
6
6
  def initialize(data, attrs=nil)
7
7
  @payload=case data
8
8
  when Array
@@ -24,9 +24,9 @@ module Rserve
24
24
 
25
25
  def na?(value=nil)
26
26
  if value.nil?
27
- @payload.map {|v| v==NA}
27
+ @payload.map {|v| NA.include? v}
28
28
  else
29
- value==NA
29
+ NA.include? value
30
30
  end
31
31
  end
32
32
  def to_debug_string
data/lib/rserve/rlist.rb CHANGED
@@ -5,7 +5,7 @@ module Rserve
5
5
  @names=nil
6
6
  if data.nil?
7
7
  super()
8
- else
8
+ else
9
9
  case data
10
10
  when Array
11
11
  super(data)
@@ -15,7 +15,6 @@ module Rserve
15
15
  raise ArgumentError
16
16
  end
17
17
  end
18
-
19
18
  if n
20
19
  @names=Array.new(size)
21
20
  n.each_index {|i| @names[i]=n[i]} if n.respond_to? :each_index
@@ -1,9 +1,12 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
  describe "Rserve::Connection on unix" do
3
3
  if !Rserve::ON_WINDOWS
4
- before do
5
- @r=Rserve::Connection.new
6
- end
4
+ before do
5
+ @r=Rserve::Connection.new
6
+ end
7
+ after do
8
+ @r.close if @r.connected?
9
+ end
7
10
  it "method eval_void should raise an error with an incorrect expression" do
8
11
  lambda {@r.void_eval("x<-")}.should raise_exception(Rserve::Connection::EvalError) {|e| e.request_packet.stat.should==2}
9
12
  lambda {@r.void_eval("as.stt(c(1))")}.should raise_exception(Rserve::Connection::EvalError) {|e|
@@ -14,8 +17,8 @@ describe "Rserve::Connection on unix" do
14
17
  lambda {@r.eval("as.stt(c(1))")}.should raise_exception(Rserve::Connection::EvalError) {|e|
15
18
  e.request_packet.stat.should==127}
16
19
  end
17
- it "should raise ServerNotAvailable if started another instance on another port" do
18
- lambda {Rserve::Connection.new(:port_number=>6700)}.should raise_exception(Rserve::Connection::ServerNotAvailable)
20
+ it "should raise ServerNotAvailableError if started another instance on another port" do
21
+ lambda {Rserve::Connection.new(:port_number=>6700)}.should raise_exception(Rserve::Connection::ServerNotAvailableError)
19
22
  end
20
23
  it "should create different session on *nix" do
21
24
  s=Rserve::Connection.new
@@ -32,20 +35,20 @@ describe "Rserve::Connection on unix" do
32
35
  s.host.should==@r.hostname
33
36
  s.key.size.should==32
34
37
  end
35
- it "should detach correctly" do
38
+ it "should detach and attach correctly" do
36
39
  x=rand(100)
37
- @r.void_eval("x<-#{x}")
40
+ @r.void_eval("x<-#{x}")
38
41
  s=@r.detach
39
42
  @r.should_not be_connected
40
43
  s.should be_instance_of(Rserve::Session)
41
44
  s.host.should==@r.hostname
42
45
  s.key.size.should==32
43
46
  r=s.attach
44
- r.eval("x").to_ruby==x
47
+ r.eval("x").to_ruby.should eq x
45
48
  end
46
49
  else
47
50
  it "shouldn't crash server with an incorrect expression as Windows version does"
48
- it "shouldn't raise ServerNotAvailable if started another instance on another port as Windows version does"
51
+ it "shouldn't raise ServerNotAvailableError if started another instance on another port as Windows version does"
49
52
  it "shouldn't create a different session. On Windows, every new connection closes previously open session"
50
53
  it "shouldn't eval_void_detach correctly"
51
54
  it "shouldn't detach correctly"
@@ -1,9 +1,12 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
  describe Rserve::Connection do
3
3
  describe "opening and closing" do
4
4
  before do
5
5
  @r=Rserve::Connection.new()
6
6
  end
7
+ after do
8
+ @r.close if @r.connected?
9
+ end
7
10
  it "should be open a connection and receive ID-String" do
8
11
  @r.get_server_version.should==103
9
12
  @r.protocol.should=="QAP1"
@@ -18,7 +21,7 @@ describe Rserve::Connection do
18
21
  end
19
22
  it "raise an error if eval is clased after closed" do
20
23
  @r.close
21
- lambda {@r.eval("TRUE")}.should raise_exception(Rserve::Connection::NotConnected)
24
+ lambda {@r.eval("TRUE")}.should raise_exception(Rserve::Connection::NotConnectedError)
22
25
  end
23
26
  after do
24
27
  @r.close if @r.connected?
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::REXP::Double do
4
4
  describe "initialization" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::REXP::GenericVector do
4
4
  describe "initialization" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::REXP::Integer do
4
4
  describe "initialization" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::REXP::Integer do
4
4
  describe "initialization" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::Packet do
4
4
  it "should be ok if cmd isn't an error" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::Protocol do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::REXP do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe "Rserve::REXP#to_ruby" do
4
4
  describe "method to_ruby" do
@@ -40,6 +40,9 @@ describe "Rserve::REXP#to_ruby" do
40
40
  it "should return a Ruby Matrix with R matrix" do
41
41
  @r.eval("matrix(c(1:12),6,2)").to_ruby.should==Matrix[[1,7],[2,8],[3,9],[4,10],[5,11], [6,12]]
42
42
  end
43
+ it "should return a Ruby Matrix with R matrix with NA values" do
44
+ @r.eval("matrix(c(NA,2,3,4),2,2,byrow=TRUE)").to_ruby.should==Matrix[[nil,2],[3,4]]
45
+ end
43
46
  it "should return a nested array of Ruby Matrixes with vector with more than tree dimensions" do
44
47
  @r.void_eval("a<-1:16; attr(a,'dim')<-c(2,2,2,2)")
45
48
  @r.eval("a").to_ruby.should==[[[[1.0, 3.0], [2.0, 4.0]], [[5.0, 7.0], [6.0, 8.0]]],
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
  require 'matrix'
3
3
  describe Rserve::REXP::Wrapper do
4
4
  it "should wrap single value" do
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
- require File.dirname(__FILE__)+"/spec_helper.rb"
3
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
4
4
 
5
5
  describe Rserve::Protocol::REXPFactory do
6
6
 
@@ -46,7 +46,7 @@ describe Rserve::Protocol::REXPFactory do
46
46
  la.should be_instance_of(Rserve::REXP::Double)
47
47
  la.dim.should be_nil
48
48
  la.as_doubles.map(&:to_f).each_with_index {|v,i|
49
- v.should be_close(a[i],1e-10)
49
+ v.should be_within(1e-10).of(a[i])
50
50
  }
51
51
  end
52
52
  it "should process integer" do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::RFactor do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::Rlist do
4
4
  before do
@@ -1,9 +1,13 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
  describe Rserve::Session do
3
3
  if !Rserve::ON_WINDOWS
4
4
  before do
5
5
  @r=Rserve::Connection.new
6
6
  end
7
+ after do
8
+ @r.close if @r.connected?
9
+ end
10
+
7
11
  it "should resume an detached session with void_eval_detach" do
8
12
  x2=10+rand(12)
9
13
  s=@r.void_eval_detach("x<-1:#{x2}")
data/spec/rserve_spec.rb CHANGED
@@ -1,13 +1,29 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve do
4
4
  before do
5
5
  @r=Rserve::Connection.new()
6
6
  end
7
7
  after do
8
- @r.close
8
+ @r.close if @r.connected?
9
9
  end
10
- it "should calcule a basic LR without hazzle" do
10
+ it "should calcule a basic gml(logit) without problem" do
11
+ script=<<-EOF
12
+ a<-c(1,3,2,5,3,2,6,7,8,5,9,3,10,5,2,6,8,4,3,7)
13
+ b<-c(7,5,3,7,2,7,4,3,7,5,7,8,4,3,3,6,7,4,3,10)
14
+ y<-c(0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1)
15
+ logit<-glm(y~a+b, family=binomial(link="logit"), na.action=na.pass)
16
+ EOF
17
+ @r.void_eval(script)
18
+ @r.eval('logit').should be_instance_of(Rserve::REXP::GenericVector)
19
+ @r.eval('logit$family$variance').should be_true
20
+ @r.eval('logit').should be_true
21
+ @r.eval('logit').to_ruby.should be_true
22
+ @r.eval('summary(logit)').should be_true
23
+ @r.eval('summary(logit)').to_ruby.should be_true
24
+ end
25
+
26
+ it "should calcule lr without problem" do
11
27
  script=<<-EOF
12
28
  ## Disease severity as a function of temperature
13
29
 
@@ -27,9 +43,6 @@ severity.lm <- lm(diseasesev~temperature,data=severity)
27
43
  @r.eval('severity.lm').to_ruby.should be_true
28
44
  @r.eval('summary(severity.lm)').should be_true
29
45
  @r.eval('summary(severity.lm)').to_ruby.should be_true
30
-
31
-
32
-
33
46
  end
34
47
 
35
48
  end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::Talk do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__)+"/spec_helper.rb"
1
+ require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
2
2
 
3
3
  describe Rserve::WithNames do
4
4
  before do
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  $:.unshift(File.dirname(__FILE__)+"/../lib")
2
- require 'spec'
3
- require 'spec/autorun'
2
+ require 'rspec'
4
3
  require 'rserve'
5
4
  require 'matrix'
6
5
  require 'pp'
metadata CHANGED
@@ -1,88 +1,104 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rserve-client
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 5
9
- version: 0.2.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Claudio Bustos
13
9
  autorequire:
14
10
  bindir: bin
15
- cert_chain:
16
- - |
17
- -----BEGIN CERTIFICATE-----
18
- MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhjbGJ1
19
- c3RvczEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
20
- MB4XDTEwMDMyOTIxMzg1NVoXDTExMDMyOTIxMzg1NVowPzERMA8GA1UEAwwIY2xi
21
- dXN0b3MxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
22
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf8JVMGqE7m5kYb+PNN
23
- neZv2pcXV5fQCi6xkyG8bi2/SIFy/LyxuvLzEeOxBeaz1Be93bayIUquOIqw3dyw
24
- /KXWa31FxuNuvAm6CN8fyeRYX/ou4cw3OIUUnIvB7RMNIu4wbgeM6htV/QEsNLrv
25
- at1/mh9JpqawPrcjIOVMj4BIp67vmzJCaUf+S/H2uYtSO09F+YQE3tv85TPeRmqU
26
- yjyXyTc/oJiw1cXskUL8UtMWZmrwNLHXuZWWIMzkjiz3UNdhJr/t5ROk8S2WPznl
27
- 0bMy/PMIlAbqWolRn1zl2VFJ3TaXScbqImY8Wf4g62b/1ZSUlGrtnLNsCYXrWiso
28
- UPUCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFGu9
29
- rrJ1H64qRmNNu3Jj/Qjvh0u5MA0GCSqGSIb3DQEBBQUAA4IBAQCV0Unka5isrhZk
30
- GjqSDqY/6hF+G2pbFcbWUpjmC8NWtAxeC+7NGV3ljd0e1SLfoyBj4gnFtFmY8qX4
31
- K02tgSZM0eDV8TpgFpWXzK6LzHvoanuahHLZEtk/+Z885lFene+nHadkem1n9iAB
32
- cs96JO9/JfFyuXM27wFAwmfHCmJfPF09R4VvGHRAvb8MGzSVgk2i06OJTqkBTwvv
33
- JHJdoyw3+8bw9RJ+jLaNoQ+xu+1pQdS2bb3m7xjZpufml/m8zFCtjYM/7qgkKR8z
34
- /ZZt8lCiKfFArppRrZayE2FVsps4X6WwBdrKTMZ0CKSXTRctbEj1BAZ67eoTvBBt
35
- rpP0jjs0
36
- -----END CERTIFICATE-----
37
-
38
- date: 2010-07-12 00:00:00 -04:00
39
- default_executable:
40
- dependencies:
41
- - !ruby/object:Gem::Dependency
11
+ cert_chain:
12
+ - !binary |-
13
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURNakNDQWhxZ0F3SUJB
14
+ Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREEvTVJFd0R3WURWUVFEREFoamJH
15
+ SjEKYzNSdmN6RVZNQk1HQ2dtU0pvbVQ4aXhrQVJrV0JXZHRZV2xzTVJNd0VR
16
+ WUtDWkltaVpQeUxHUUJHUllEWTI5dApNQjRYRFRFd01ETXlPVEl4TXpnMU5W
17
+ b1hEVEV4TURNeU9USXhNemcxTlZvd1B6RVJNQThHQTFVRUF3d0lZMnhpCmRY
18
+ TjBiM014RlRBVEJnb0praWFKay9Jc1pBRVpGZ1ZuYldGcGJERVRNQkVHQ2dt
19
+ U0pvbVQ4aXhrQVJrV0EyTnYKYlRDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFB
20
+ RGdnRVBBRENDQVFvQ2dnRUJBTGY4SlZNR3FFN201a1liK1BOTgpuZVp2MnBj
21
+ WFY1ZlFDaTZ4a3lHOGJpMi9TSUZ5L0x5eHV2THpFZU94QmVhejFCZTkzYmF5
22
+ SVVxdU9JcXczZHl3Ci9LWFdhMzFGeHVOdXZBbTZDTjhmeWVSWVgvb3U0Y3cz
23
+ T0lVVW5JdkI3Uk1OSXU0d2JnZU02aHRWL1FFc05McnYKYXQxL21oOUpwcWF3
24
+ UHJjaklPVk1qNEJJcDY3dm16SkNhVWYrUy9IMnVZdFNPMDlGK1lRRTN0djg1
25
+ VFBlUm1xVQp5anlYeVRjL29KaXcxY1hza1VMOFV0TVdabXJ3TkxIWHVaV1dJ
26
+ TXpraml6M1VOZGhKci90NVJPazhTMldQem5sCjBiTXkvUE1JbEFicVdvbFJu
27
+ MXpsMlZGSjNUYVhTY2JxSW1ZOFdmNGc2MmIvMVpTVWxHcnRuTE5zQ1lYcldp
28
+ c28KVVBVQ0F3RUFBYU01TURjd0NRWURWUjBUQkFJd0FEQUxCZ05WSFE4RUJB
29
+ TUNCTEF3SFFZRFZSME9CQllFRkd1OQpyckoxSDY0cVJtTk51M0pqL1Fqdmgw
30
+ dTVNQTBHQ1NxR1NJYjNEUUVCQlFVQUE0SUJBUUNWMFVua2E1aXNyaFprCkdq
31
+ cVNEcVkvNmhGK0cycGJGY2JXVXBqbUM4Tld0QXhlQys3TkdWM2xqZDBlMVNM
32
+ Zm95Qmo0Z25GdEZtWThxWDQKSzAydGdTWk0wZURWOFRwZ0ZwV1h6SzZMekh2
33
+ b2FudWFoSExaRXRrLytaODg1bEZlbmUrbkhhZGtlbTFuOWlBQgpjczk2Sk85
34
+ L0pmRnl1WE0yN3dGQXdtZkhDbUpmUEYwOVI0VnZHSFJBdmI4TUd6U1ZnazJp
35
+ MDZPSlRxa0JUd3Z2CkpISmRveXczKzhidzlSSitqTGFOb1EreHUrMXBRZFMy
36
+ YmIzbTd4alpwdWZtbC9tOHpGQ3RqWU0vN3Fna0tSOHoKL1padDhsQ2lLZkZB
37
+ cnBwUnJaYXlFMkZWc3BzNFg2V3dCZHJLVE1aMENLU1hUUmN0YkVqMUJBWjY3
38
+ ZW9UdkJCdApycFAwampzMAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
+ date: 2011-12-26 00:00:00.000000000 Z
40
+ dependencies:
41
+ - !ruby/object:Gem::Dependency
42
42
  name: rubyforge
43
- prerelease: false
44
- requirement: &id001 !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- segments:
49
- - 2
50
- - 0
51
- - 4
43
+ requirement: &18815860 !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
52
48
  version: 2.0.4
53
49
  type: :development
54
- version_requirements: *id001
55
- - !ruby/object:Gem::Dependency
50
+ prerelease: false
51
+ version_requirements: *18815860
52
+ - !ruby/object:Gem::Dependency
53
+ name: rspec
54
+ requirement: &18815440 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ version: '2.0'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: *18815440
63
+ - !ruby/object:Gem::Dependency
56
64
  name: hoe
65
+ requirement: &18814940 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ version: '2.12'
71
+ type: :development
57
72
  prerelease: false
58
- requirement: &id002 !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- segments:
63
- - 2
64
- - 6
65
- - 1
66
- version: 2.6.1
73
+ version_requirements: *18814940
74
+ - !ruby/object:Gem::Dependency
75
+ name: rdoc
76
+ requirement: &11048380 !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ~>
80
+ - !ruby/object:Gem::Version
81
+ version: '3.10'
67
82
  type: :development
68
- version_requirements: *id002
69
- description: |-
70
- Ruby client for Rserve, a Binary R server (http://www.rforge.net/Rserve/).
71
-
72
- Follows closely the new Java client API, but maintains all Ruby conventions when possible.
73
- email:
83
+ prerelease: false
84
+ version_requirements: *11048380
85
+ description: ! 'Ruby client for Rserve, a Binary R server (http://www.rforge.net/Rserve/).
86
+
87
+
88
+ Follows closely the new Java client API, but maintains all Ruby conventions when
89
+ possible.'
90
+ email:
74
91
  - clbustos_AT_gmail.com
75
92
  executables: []
76
-
77
93
  extensions: []
78
-
79
- extra_rdoc_files:
94
+ extra_rdoc_files:
80
95
  - History.txt
81
96
  - Introduction.txt
82
97
  - Manifest.txt
83
98
  - README.txt
84
- files:
99
+ files:
85
100
  - .autotest
101
+ - .rspec
86
102
  - History.txt
87
103
  - Introduction.txt
88
104
  - Manifest.txt
@@ -108,6 +124,7 @@ files:
108
124
  - lib/rserve/rexp/environment.rb
109
125
  - lib/rserve/rexp/expressionvector.rb
110
126
  - lib/rserve/rexp/factor.rb
127
+ - lib/rserve/rexp/function.rb
111
128
  - lib/rserve/rexp/genericvector.rb
112
129
  - lib/rserve/rexp/integer.rb
113
130
  - lib/rserve/rexp/language.rb
@@ -146,40 +163,35 @@ files:
146
163
  - spec/rserve_spec.rb
147
164
  - spec/rserve_talk_spec.rb
148
165
  - spec/rserve_withnames_spec.rb
149
- - spec/spec.opts
150
166
  - spec/spec_helper.rb
151
- has_rdoc: true
167
+ - .gemtest
152
168
  homepage: http://github.com/clbustos/Rserve-Ruby-client
153
169
  licenses: []
154
-
155
170
  post_install_message:
156
- rdoc_options:
171
+ rdoc_options:
157
172
  - --main
158
173
  - README.txt
159
- require_paths:
174
+ require_paths:
160
175
  - lib
161
- required_ruby_version: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- segments:
166
- - 0
167
- version: "0"
168
- required_rubygems_version: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- segments:
173
- - 0
174
- version: "0"
176
+ required_ruby_version: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ required_rubygems_version: !ruby/object:Gem::Requirement
183
+ none: false
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
175
188
  requirements: []
176
-
177
189
  rubyforge_project: ruby-statsample
178
- rubygems_version: 1.3.6
190
+ rubygems_version: 1.8.10
179
191
  signing_key:
180
192
  specification_version: 3
181
193
  summary: Ruby client for Rserve, a Binary R server (http://www.rforge.net/Rserve/)
182
- test_files:
194
+ test_files:
183
195
  - spec/rserve_rlist_spec.rb
184
196
  - spec/rserve_rexp_wrapper_spec.rb
185
197
  - spec/rserve_rfactor_spec.rb
metadata.gz.sig CHANGED
Binary file