rinruby 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.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,7 +1,10 @@
1
- === 2.0.0 / 2010-05-26
1
+ === 2.0.1 / 2010-05-01
2
+ * Reimplemented Rinruby.new with ordered parameters, for complete backwards compatibility
3
+
4
+ === 2.0.0 / 2010-04-26
2
5
  * Changed RinRuby initialize, with option Hash instead of ordered parameters.
3
6
 
4
- === 1.2.0 / 2010-05-23
7
+ === 1.2.0 / 2010-04-23
5
8
 
6
9
  * Fixed to works on Ruby 1.9
7
10
  * Pull and push of Matrixes
data/lib/rinruby.rb CHANGED
@@ -62,7 +62,7 @@ class RinRuby
62
62
  require 'socket'
63
63
 
64
64
 
65
- VERSION = '2.0.0'
65
+ VERSION = '2.0.1'
66
66
 
67
67
 
68
68
  attr_reader :interactive
@@ -103,7 +103,17 @@ attr_reader :executable
103
103
  attr_reader :port_number
104
104
  attr_reader :port_width
105
105
  attr_reader :hostname
106
- def initialize(opts=Hash.new())
106
+ def initialize(*args)
107
+ opts=Hash.new
108
+ if args.size==1 and args[0].is_a? Hash
109
+ opts=args[0]
110
+ else
111
+ opts[:echo]=args.shift unless args.size==0
112
+ opts[:interactive]=args.shift unless args.size==0
113
+ opts[:executable]=args.shift unless args.size==0
114
+ opts[:port_number]=args.shift unless args.size==0
115
+ opts[:port_width]=args.shift unless args.size==0
116
+ end
107
117
  default_opts= {:echo=>true, :interactive=>true, :executable=>nil, :port_number=>38442, :port_width=>1000, :hostname=>'127.0.0.1'}
108
118
 
109
119
  @opts=default_opts.merge(opts)
data/spec/rinruby_spec.rb CHANGED
@@ -3,6 +3,22 @@ puts "RinRuby #{RinRuby::VERSION} specification"
3
3
 
4
4
  describe RinRuby do
5
5
  describe "on init" do
6
+ it "should accept parameters as specified on Dahl & Crawford(2009)" do
7
+ r=RinRuby.new(false, false, "R", 38500, 1)
8
+ r.echo_enabled.should_not be_true
9
+ r.interactive.should_not be_true
10
+ r.executable.should=='R'
11
+ r.port_number.should==38500
12
+ r.port_width.should==1
13
+
14
+
15
+ end
16
+ it "should accept :echo and :interactive parameters" do
17
+ r=RinRuby.new(:echo=>false, :interactive=>false)
18
+ r.echo_enabled.should_not be_true
19
+ r.interactive.should_not be_true
20
+
21
+ end
6
22
  it "should accept :port_number" do
7
23
  port=38442+rand(3)
8
24
  r=RinRuby.new(:port_number=>port,:port_width=>1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rinruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Dahl
@@ -31,7 +31,7 @@ cert_chain:
31
31
  rpP0jjs0
32
32
  -----END CERTIFICATE-----
33
33
 
34
- date: 2010-04-26 00:00:00 -04:00
34
+ date: 2010-05-01 00:00:00 -04:00
35
35
  default_executable:
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file