ownet 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,9 +3,9 @@
3
3
  require 'rubygems'
4
4
  require 'rake'
5
5
  require 'date'
6
- require 'rcov/rcovtask'
6
+ #require 'rcov/rcovtask'
7
7
  require 'rake/testtask'
8
- require 'rake/rdoctask'
8
+ require 'rdoc/task'
9
9
 
10
10
  #############################################################################
11
11
  #
@@ -56,13 +56,13 @@ Rake::TestTask.new(:test) do |test|
56
56
  test.verbose = true
57
57
  end
58
58
 
59
- Rcov::RcovTask.new(:coverage) do |t|
60
- t.libs << "test"
61
- t.test_files = FileList['test/*_test.rb']
62
- t.rcov_opts << ['--exclude "^/"', '--include "lib/.*\.rb"']
63
- t.output_dir = 'coverage'
64
- t.verbose = true
65
- end
59
+ #Rcov::RcovTask.new(:coverage) do |t|
60
+ # t.libs << "test"
61
+ # t.test_files = FileList['test/*_test.rb']
62
+ # t.rcov_opts << ['--exclude "^/"', '--include "lib/.*\.rb"']
63
+ # t.output_dir = 'coverage'
64
+ # t.verbose = true
65
+ #end
66
66
 
67
67
  Rake::RDocTask.new do |rdoc|
68
68
  rdoc.rdoc_dir = 'rdoc'
@@ -217,7 +217,7 @@ module OWNet
217
217
  owwrite(socket,:path => path, :function => DIR)
218
218
 
219
219
  fields = []
220
- while true:
220
+ while true
221
221
  response = owread(socket)
222
222
  if response.data
223
223
  fields << response.data
@@ -1,5 +1,5 @@
1
1
  require File.dirname(__FILE__)+'/connection.rb'
2
2
 
3
3
  module OWNet
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.name = 'ownet'
9
- s.version = '0.2.0'
10
- s.date = '2011-07-05'
9
+ s.version = '0.2.1'
10
+ s.date = '2013-05-16'
11
11
 
12
12
  s.summary = "Client to connect to one-wire devices through owserver of the OWFS project"
13
13
  s.description = "A simple client that interfaces with owserver from the owfs project"
@@ -98,25 +98,26 @@ module MockOWServer
98
98
  @paths[canonical_path("uncached/"+canon)] = v
99
99
  end
100
100
  @mutex = Mutex.new
101
+
102
+ @socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
103
+ @socket.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true)
104
+ @socket.bind(Socket.pack_sockaddr_in(@port, @address))
105
+ @socket.listen 10
101
106
  end
102
107
 
103
108
  def run!
104
109
  @stopped = false
105
110
  @nrequests = 0
106
111
  @thread = Thread.new do
107
- socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
108
- socket.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true)
109
- socket.bind(Socket.pack_sockaddr_in(@port, @address))
110
- socket.listen 10
111
112
  while !@stopped
112
113
  begin
113
- client, client_sockaddr = socket.accept_nonblock
114
+ client, client_sockaddr = @socket.accept_nonblock
114
115
  respond(client)
115
116
  rescue Errno::EAGAIN
116
117
  sleep 0.1
117
118
  end
118
119
  end
119
- socket.close
120
+ @socket.close
120
121
  end
121
122
  end
122
123
 
metadata CHANGED
@@ -1,34 +1,24 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ownet
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
13
- - "Pedro C\xC3\xB4rte-Real"
7
+ authors:
8
+ - Pedro Côrte-Real
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-07-05 00:00:00 +01:00
19
- default_executable:
12
+ date: 2013-05-16 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
14
  description: A simple client that interfaces with owserver from the owfs project
23
15
  email: pedro@pedrocr.net
24
16
  executables: []
25
-
26
17
  extensions: []
27
-
28
- extra_rdoc_files:
18
+ extra_rdoc_files:
29
19
  - README.rdoc
30
20
  - LICENSE
31
- files:
21
+ files:
32
22
  - LICENSE
33
23
  - README.rdoc
34
24
  - Rakefile
@@ -41,44 +31,35 @@ files:
41
31
  - test/mock_connection_test.rb
42
32
  - test/mock_owserver.rb
43
33
  - test/test_helper.rb
44
- has_rdoc: true
45
34
  homepage: https://github.com/pedrocr/ownet
46
35
  licenses: []
47
-
48
36
  post_install_message:
49
- rdoc_options:
37
+ rdoc_options:
50
38
  - -S
51
39
  - -w 2
52
40
  - -N
53
41
  - -c utf8
54
- require_paths:
42
+ require_paths:
55
43
  - lib
56
- required_ruby_version: !ruby/object:Gem::Requirement
44
+ required_ruby_version: !ruby/object:Gem::Requirement
57
45
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 3
62
- segments:
63
- - 0
64
- version: "0"
65
- required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
51
  none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
- version: "0"
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
74
56
  requirements: []
75
-
76
57
  rubyforge_project:
77
- rubygems_version: 1.3.7
58
+ rubygems_version: 1.8.11
78
59
  signing_key:
79
60
  specification_version: 2
80
61
  summary: Client to connect to one-wire devices through owserver of the OWFS project
81
- test_files:
62
+ test_files:
82
63
  - test/connection_test.rb
83
64
  - test/mock_connection_test.rb
84
65
  - test/mock_owserver.rb