pebblebed 0.0.27 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  require 'active_support/inflector'
2
2
 
3
- module Pebblebed
4
- class Connector
3
+ module Pebblebed
4
+ class Connector
5
5
  attr_accessor :key
6
6
  def initialize(key = nil, url_opts = {})
7
7
  @key = key
@@ -14,15 +14,15 @@ module Pebblebed
14
14
  (@clients[service.to_sym] ||= client_class.new(@key, Pebblebed.root_url_for(service.to_s, @url_opts)))
15
15
  end
16
16
 
17
- # Returns a quorum client that talks to the provided list of
17
+ # Returns a quorum client that talks to the provided list of
18
18
  # pebbles all at once. The result is a hash of services and their
19
19
  # responses. If any service returned an error, their entry
20
20
  # in the hash will be an HttpError object.
21
21
  def quorum(services = nil, session_key = nil)
22
22
  QuorumClient.new(services || Pebblebed.services, session_key)
23
23
  end
24
-
25
-
24
+
25
+
26
26
  def parts
27
27
  @@parts ||= Pebblebed::Parts.new(self)
28
28
  end
@@ -78,16 +78,20 @@ module Pebblebed
78
78
 
79
79
  # Determines the correct event handler for the message and calls it
80
80
  def handle(event, klass, attributes)
81
+ # TODO: Remove the following line after grove has been deployed. This skips old messages
82
+ # with no processing.
83
+ return unless ['access_group', 'access_group_membership', 'access_group_subtree'].include?(klass)
84
+
81
85
  event_handler = @handlers[klass.to_sym][event.to_sym]
82
86
  return unless event_handler
83
87
  case klass
84
88
  when 'access_group'
85
89
  event_handler.call(:id => attributes['id'], :label => attributes['label'])
86
90
  when 'access_group_membership'
87
- event_handler.call(:group_id => attributes['group_id'],
91
+ event_handler.call(:access_group_id => attributes['access_group_id'],
88
92
  :identity_id => attributes['identity_id'])
89
93
  when 'access_group_subtree'
90
- event_handler.call(:group_id => attributes['group_id'],
94
+ event_handler.call(:access_group_id => attributes['access_group_id'],
91
95
  :location => attributes['location'])
92
96
  end
93
97
  end
@@ -37,7 +37,7 @@ module Sinatra
37
37
  return @identity if @identity_checked
38
38
  @identity_checked = true
39
39
  if cache_current_identity?
40
- @identity = ::Pebblebed.memcached.fetch("identity-for-session-#{current_session}", ttl = 60) do
40
+ @identity = ::Pebblebed.memcached.fetch("identity-for-session-#{current_session}", :ttl => 60) do
41
41
  pebbles.checkpoint.get("/identities/me")[:identity]
42
42
  end
43
43
  else
@@ -1,3 +1,3 @@
1
1
  module Pebblebed
2
- VERSION = "0.0.27"
2
+ VERSION = "0.0.28"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebblebed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-19 00:00:00.000000000 Z
13
+ date: 2012-11-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -312,7 +312,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
312
312
  version: '0'
313
313
  segments:
314
314
  - 0
315
- hash: 1631620775838906147
315
+ hash: -3393010342533935209
316
316
  required_rubygems_version: !ruby/object:Gem::Requirement
317
317
  none: false
318
318
  requirements:
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  version: '0'
322
322
  segments:
323
323
  - 0
324
- hash: 1631620775838906147
324
+ hash: -3393010342533935209
325
325
  requirements: []
326
326
  rubyforge_project: pebblebed
327
327
  rubygems_version: 1.8.24