celluloid_pubsub 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f553146c4281cefdba37767bc0c34aa7cac8fcb5
4
- data.tar.gz: e847a478522bdca68ae7e700f816224a49564814
3
+ metadata.gz: e59fc206ccb8f5eb1a0420099429130b92944c17
4
+ data.tar.gz: ccb987b8132c80967805995ea6b96e61c3b864f7
5
5
  SHA512:
6
- metadata.gz: e4a6abb2fa27acb9086e2f482b2fb78fdb197b14ffdc9037796e8b7b917e41963957b50565887072d8931a6dca0da5e791546e5c679ce2829433b48d1842db97
7
- data.tar.gz: fc1c12cb83b08d4a82052f79624fd72c9492e0d446a5693bdb54a3de5fd246657c843757554d76a9869285f75ee77c6268ba8427747b307c1d9577c573656fe2
6
+ metadata.gz: 3570bd394410645d5ab706922d3e07c079d0cbd2f969db70c2cbc81fa6cda0c695daed1eba31212d4885927735706976e1a6d912979eca2afb3485d856a6dd74
7
+ data.tar.gz: 54b8958031e1bd0db10c3aabe06785a6e5e025a3c9d7700a3170ddaa6bc703ddb045aec1b6f18ac290a0c0f9d371cc33b15a579573df2c7e4d3cd9dc2981ba57
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.add_runtime_dependency 'celluloid-io', '~> 0.16.2', '>= 0.16.2'
21
21
  s.add_runtime_dependency 'reel', '~> 0.5.0', '>= 0.5.0'
22
22
  s.add_runtime_dependency 'celluloid-websocket-client', '0.0.1'
23
- s.add_runtime_dependency 'activesupport', '~> 4.2.0', '>= 4.2.0'
23
+ s.add_runtime_dependency 'activesupport', '~> 4.1', '>= 4.1.0'
24
24
 
25
25
  s.add_development_dependency 'rspec-rails', '~> 2.0', '>= 2.0'
26
26
  s.add_development_dependency 'guard', '~> 2.6.1', '>= 2.6'
@@ -1,6 +1,7 @@
1
1
  require 'bundler/setup'
2
2
  require 'celluloid_pubsub'
3
3
 
4
+ ENV['DEBUG_CELLULOID'] = ARGV.map(&:downcase).include?('debug') ? 'true' : 'false'
4
5
  # actor that subscribes to a channel
5
6
  class Subscriber
6
7
  include Celluloid
@@ -13,8 +14,13 @@ class Subscriber
13
14
  end
14
15
 
15
16
  def on_message(message)
16
- puts "subscriber got #{message.inspect}"
17
- @client.publish('test_channel2', 'data' => 'my_message') # the message needs to be a Hash
17
+ if @client.succesfull_subscription?(message)
18
+ puts "subscriber got successful subscription #{message.inspect}"
19
+ @client.publish('test_channel2', 'data' => ' subscriber got successfull subscription') # the message needs to be a Hash
20
+ else
21
+ puts "subscriber got message #{message.inspect}"
22
+ @client.publish('test_channel2', 'data' => "subscriber got #{message}") # the message needs to be a Hash
23
+ end
18
24
  end
19
25
 
20
26
  def on_close(code, reason)
@@ -17,7 +17,7 @@ module CelluloidPubsub
17
17
  # minor release version
18
18
  MINOR = 0
19
19
  # tiny release version
20
- TINY = 11
20
+ TINY = 12
21
21
  # prelease version ( set this only if it is a prelease)
22
22
  PRE = nil
23
23
 
@@ -76,11 +76,12 @@ module CelluloidPubsub
76
76
  def parse_options(options)
77
77
  raise 'Options is not a hash ' unless options.is_a?(Hash)
78
78
  @options = options.stringify_keys
79
- @backlog = @options.fetch(:backlog, 1024)
80
- @hostname = @options.fetch(:hostname, CelluloidPubsub::WebServer::HOST)
81
- @port = @options.fetch(:port, CelluloidPubsub::WebServer::PORT)
82
- @path = @options.fetch(:path, CelluloidPubsub::WebServer::PATH)
83
- @spy = @options.fetch(:spy, false)
79
+ debug @options if debug_enabled?
80
+ @backlog = @options.fetch('backlog', 1024)
81
+ @hostname = @options.fetch('hostname', CelluloidPubsub::WebServer::HOST)
82
+ @port = @options.fetch('port', CelluloidPubsub::WebServer::PORT)
83
+ @path = @options.fetch('path', CelluloidPubsub::WebServer::PATH)
84
+ @spy = @options.fetch('spy', false)
84
85
  end
85
86
 
86
87
  # checks if debug is enabled
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: celluloid_pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-01 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid
@@ -90,20 +90,20 @@ dependencies:
90
90
  requirements:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
- version: 4.2.0
93
+ version: '4.1'
94
94
  - - '>='
95
95
  - !ruby/object:Gem::Version
96
- version: 4.2.0
96
+ version: 4.1.0
97
97
  type: :runtime
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 4.2.0
103
+ version: '4.1'
104
104
  - - '>='
105
105
  - !ruby/object:Gem::Version
106
- version: 4.2.0
106
+ version: 4.1.0
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: rspec-rails
109
109
  requirement: !ruby/object:Gem::Requirement