rmodbus 0.3.1 → 0.4.0

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.
@@ -45,4 +45,29 @@ describe TCPClient, "method 'query'" do
45
45
  @mb_client.query(request).should == response[2..-1]
46
46
  end
47
47
 
48
+ it 'should sugar connect method' do
49
+ ipaddr, port, slave = '127.0.0.1', 502, 3
50
+ TCPSocket.should_receive(:new).with(ipaddr, port).and_return(@sock)
51
+ @sock.should_receive(:closed?).and_return(false)
52
+ @sock.should_receive(:close)
53
+ TCPClient.connect(ipaddr, port, slave) do |cl|
54
+ cl.ipaddr.should == ipaddr
55
+ cl.port.should == port
56
+ cl.slave.should == slave
57
+ end
58
+ end
59
+
60
+ it 'should have closed? method' do
61
+ @sock.should_receive(:closed?).and_return(false)
62
+ @mb_client.closed?.should == false
63
+
64
+ @sock.should_receive(:closed?).and_return(false)
65
+ @sock.should_receive(:close)
66
+
67
+ @mb_client.close
68
+
69
+ @sock.should_receive(:closed?).and_return(true)
70
+ @mb_client.closed?.should == true
71
+ end
72
+
48
73
  end
@@ -5,7 +5,7 @@ describe TCPServer do
5
5
  before do
6
6
  @server = ModBus::TCPServer.new(8502,1)
7
7
  @server.coils = [1,0,1,1]
8
- @server.discret_inputs = [1,1,0,0]
8
+ @server.discrete_inputs = [1,1,0,0]
9
9
  @server.holding_registers = [1,2,3,4]
10
10
  @server.input_registers = [1,2,3,4]
11
11
  @server.start
@@ -70,7 +70,7 @@ describe TCPServer do
70
70
  end
71
71
 
72
72
  it "should supported function 'read discrete inputs'" do
73
- @client.read_discrete_inputs(1,3).should == @server.discret_inputs[1,3]
73
+ @client.read_discrete_inputs(1,3).should == @server.discrete_inputs[1,3]
74
74
  end
75
75
 
76
76
  it "should supported function 'read holding registers'" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmodbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.Timin, J. Sanders
@@ -9,7 +9,7 @@ autorequire: rmodbus
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-12 00:00:00 +05:00
12
+ date: 2010-01-23 00:00:00 +05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,10 +20,10 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.8.0
23
+ version: 1.0.1
24
24
  version:
25
25
  description:
26
- email:
26
+ email: atimin@gmail.com
27
27
  executables: []
28
28
 
29
29
  extensions: []
@@ -35,25 +35,34 @@ extra_rdoc_files:
35
35
  - ChangeLog
36
36
  files:
37
37
  - lib/rmodbus/tcp_client.rb
38
+ - lib/rmodbus/parsers.rb
38
39
  - lib/rmodbus/rtu_client.rb
39
40
  - lib/rmodbus/tcp_server.rb
41
+ - lib/rmodbus/rtu_server.rb
40
42
  - lib/rmodbus/exceptions.rb
41
43
  - lib/rmodbus/client.rb
42
44
  - lib/rmodbus/ext.rb
45
+ - lib/rmodbus/crc16.rb
43
46
  - lib/rmodbus.rb
44
47
  - examples/use_tcp_modbus.rb
48
+ - examples/perfomance_rtu.rb
49
+ - examples/perfomance_tcp.rb
45
50
  - examples/add_new_function.rb
51
+ - spec/logging_spec.rb
46
52
  - spec/ext_spec.rb
47
53
  - spec/tcp_client_spec.rb
48
54
  - spec/rtu_client_spec.rb
55
+ - spec/exception_spec.rb
49
56
  - spec/client_spec.rb
50
57
  - spec/tcp_server_spec.rb
58
+ - spec/rtu_server_spec.rb
59
+ - Rakefile
51
60
  - README
52
61
  - AUTHORS
53
62
  - LICENSE
54
63
  - ChangeLog
55
64
  has_rdoc: true
56
- homepage:
65
+ homepage: http://rmodbus.heroku.com
57
66
  licenses: []
58
67
 
59
68
  post_install_message:
@@ -79,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
88
  version:
80
89
  requirements: []
81
90
 
82
- rubyforge_project:
91
+ rubyforge_project: RModBus
83
92
  rubygems_version: 1.3.5
84
93
  signing_key:
85
94
  specification_version: 3