legs 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/legs.gemspec +2 -2
  2. data/lib/legs.rb +6 -5
  3. metadata +7 -9
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "legs"
3
- s.version = "0.6.2"
4
- s.date = "2008-07-17"
3
+ s.version = "0.6.3"
4
+ s.date = "2011-06-10"
5
5
  s.summary = "Simple fun open networking for newbies and quick hacks"
6
6
  s.email = "a@creativepony.com"
7
7
  s.homepage = "http://github.com/Bluebie/legs"
@@ -77,7 +77,8 @@ class Legs
77
77
  self.class.outgoing_mutex.synchronize { self.class.outgoing.delete(self) }
78
78
  end
79
79
 
80
- Thread.new { sleep(1); @socket.close rescue nil }
80
+ #Thread.new { sleep(1); @socket.close rescue nil }
81
+ @socket.close
81
82
  end
82
83
 
83
84
  # send a notification to this user
@@ -88,7 +89,7 @@ class Legs
88
89
 
89
90
  # sends a normal RPC request that has a response
90
91
  def send!(method, *args, &blk)
91
- puts "Call #{inspect}: #{method}(#{args.map(&:inspect).join(', ')})" if self.class.log?
92
+ puts "Call #{self.inspect}: #{method}(#{args.map(&:inspect).join(', ')})" if self.class.log?
92
93
  id = get_unique_number
93
94
  send_data! 'method' => method.to_s, 'params' => args, 'id' => id
94
95
 
@@ -192,9 +193,9 @@ class Legs
192
193
  end
193
194
 
194
195
  # undef's the superclass's methods so they won't get in the way
195
- removal_list = Legs.instance_methods(true)
196
+ removal_list = Legs.instance_methods(true).map { |i| i.to_s }
196
197
  removal_list -= %w{JSON new class object_id send __send__ __id__ < <= <=> => > == === yield raise}
197
- removal_list -= Legs.instance_methods(false)
198
+ removal_list -= Legs.instance_methods(false).map { |i| i.to_s }
198
199
  Legs.class_eval { removal_list.each { |m| undef_method m } }
199
200
 
200
201
 
@@ -271,7 +272,7 @@ class << Legs
271
272
  sleep 0.01 while @messages.empty?
272
273
  data, from = @messages.deq
273
274
  method = data['method']; params = data['params']
274
- methods = @server_object.public_methods(false)
275
+ methods = @server_object.public_methods(false).map { |i| i.to_s }
275
276
 
276
277
  # close dead connections
277
278
  if data['method'] == '**remote__disconnecting**'
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 6
9
- - 2
10
- version: 0.6.2
8
+ - 3
9
+ version: 0.6.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Jenna Fox
@@ -15,7 +14,8 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2008-07-17 00:00:00 Z
17
+ date: 2011-06-10 00:00:00 +10:00
18
+ default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json_pure
@@ -25,7 +25,6 @@ dependencies:
25
25
  requirements:
26
26
  - - ">"
27
27
  - !ruby/object:Gem::Version
28
- hash: 19
29
28
  segments:
30
29
  - 1
31
30
  - 1
@@ -49,6 +48,7 @@ files:
49
48
  - examples/chat-server.rb
50
49
  - examples/shoes-chat-client.rb
51
50
  - test/test_legs.rb
51
+ has_rdoc: true
52
52
  homepage: http://github.com/Bluebie/legs
53
53
  licenses: []
54
54
 
@@ -62,7 +62,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- hash: 3
66
65
  segments:
67
66
  - 0
68
67
  version: "0"
@@ -71,14 +70,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
70
  requirements:
72
71
  - - ">="
73
72
  - !ruby/object:Gem::Version
74
- hash: 3
75
73
  segments:
76
74
  - 0
77
75
  version: "0"
78
76
  requirements: []
79
77
 
80
78
  rubyforge_project:
81
- rubygems_version: 1.8.5
79
+ rubygems_version: 1.3.7
82
80
  signing_key:
83
81
  specification_version: 3
84
82
  summary: Simple fun open networking for newbies and quick hacks