c3s 0.3.5 → 0.3.6

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/Manifest CHANGED
@@ -1,6 +1,5 @@
1
1
  README.rdoc
2
2
  Rakefile
3
- c3s.gemspec
4
3
  lib/c3s.rb
5
4
  lib/c3s_logger.rb
6
5
  lib/component.rb
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('c3s', '0.3.5') do |p|
5
+ Echoe.new('c3s', '0.3.6') do |p|
6
6
  p.description = "C3s library gem."
7
7
  p.url = "http://github.com/rikas/c3s"
8
8
  p.author = "Ricardo Otero"
data/c3s.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{c3s}
5
- s.version = "0.3.5"
5
+ s.version = "0.3.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ricardo Otero"]
9
- s.date = %q{2010-04-12}
9
+ s.date = %q{2010-04-19}
10
10
  s.description = %q{C3s library gem.}
11
11
  s.email = %q{oterosantos@gmail.com}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/c3s.rb", "lib/c3s_logger.rb", "lib/component.rb", "lib/component_connection.rb", "lib/configreader.rb", "lib/databaseadapter.rb", "lib/model.rb", "lib/pubsub/node.rb", "lib/pubsub/nodetracker.rb", "lib/pubsub/publisher.rb", "lib/pubsub/subscriber.rb", "lib/republisher.rb"]
13
- s.files = ["README.rdoc", "Rakefile", "lib/c3s.rb", "lib/c3s_logger.rb", "lib/component.rb", "lib/component_connection.rb", "lib/configreader.rb", "lib/databaseadapter.rb", "lib/model.rb", "lib/pubsub/node.rb", "lib/pubsub/nodetracker.rb", "lib/pubsub/publisher.rb", "lib/pubsub/subscriber.rb", "lib/republisher.rb", "Manifest", "c3s.gemspec"]
13
+ s.files = ["README.rdoc", "Rakefile", "c3s.gemspec", "lib/c3s.rb", "lib/c3s_logger.rb", "lib/component.rb", "lib/component_connection.rb", "lib/configreader.rb", "lib/databaseadapter.rb", "lib/model.rb", "lib/pubsub/node.rb", "lib/pubsub/nodetracker.rb", "lib/pubsub/publisher.rb", "lib/pubsub/subscriber.rb", "lib/republisher.rb", "Manifest"]
14
14
  s.homepage = %q{http://github.com/rikas/c3s}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "C3s", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
data/lib/component.rb CHANGED
@@ -162,9 +162,10 @@ module C3s
162
162
  end
163
163
 
164
164
  reply.type = :result
165
+
165
166
  reply.query.add(Jabber::Discovery::Identity.new(config['category'], config['description'], config['type']))
166
167
  reply.query.add(Jabber::Discovery::Feature.new(Jabber::Discovery::IqQueryDiscoInfo.new.namespace))
167
- reply.query.add(Jabber::Discovery::Feature.new(Jabber::Discovery::IqQueryDiscoItems.new.namespace))
168
+ #reply.query.add(Jabber::Discovery::Feature.new(Jabber::Discovery::IqQueryDiscoItems.new.namespace))
168
169
 
169
170
  send!(reply)
170
171
  end
@@ -63,7 +63,7 @@ module C3s
63
63
  end
64
64
 
65
65
  puts "Starting messaging loop..."
66
- @component.start
66
+ Thread.stop
67
67
  end
68
68
 
69
69
  def self.stop
data/lib/republisher.rb CHANGED
@@ -25,22 +25,27 @@ module C3s
25
25
  super
26
26
  end
27
27
 
28
+ ##
29
+ # Subscribes to all nodes
30
+ #
31
+ def subscribe_nodes
32
+ @subscribing_nodes.each do |node|
33
+ begin
34
+ @subscriber.subscribe_collection(node)
35
+ rescue Exception => e
36
+ $LOG.error "Could not subscribe to node #{node}"
37
+ next
38
+ end
39
+ end
40
+ end
41
+
28
42
  ##
29
43
  # Handles messages. This can be subscribe or unsubscribe messages
30
44
  # and pubsub events (most likely).
31
45
  def handle_msg(msg)
32
- puts "----------------- MESSAGE -------------------"
33
- puts "#{msg.inspect}"
34
- puts "----------------- MESSAGE -------------------"
35
46
  if msg.body.eql?("sub")
36
47
  $LOG.info "Subscribing nodes: #{@subscribing_nodes.join(", ")}"
37
- @subscribing_nodes.each do |node|
38
- begin
39
- @subscriber.subscribe_collection(node)
40
- rescue Exception => e
41
- $LOG.erro "Could not subscribe node #{node}!"
42
- end
43
- end
48
+ subscribe_nodes()
44
49
  elsif msg.body.eql?("unsub")
45
50
  @subscriber.unsubscribe_all
46
51
  else
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 5
9
- version: 0.3.5
8
+ - 6
9
+ version: 0.3.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ricardo Otero
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-12 00:00:00 +01:00
17
+ date: 2010-04-19 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -41,6 +41,7 @@ extra_rdoc_files:
41
41
  files:
42
42
  - README.rdoc
43
43
  - Rakefile
44
+ - c3s.gemspec
44
45
  - lib/c3s.rb
45
46
  - lib/c3s_logger.rb
46
47
  - lib/component.rb
@@ -54,7 +55,6 @@ files:
54
55
  - lib/pubsub/subscriber.rb
55
56
  - lib/republisher.rb
56
57
  - Manifest
57
- - c3s.gemspec
58
58
  has_rdoc: true
59
59
  homepage: http://github.com/rikas/c3s
60
60
  licenses: []