caerbannog 0.2.0 → 0.2.1

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: 023d6338359111413e0f62e40ec72aa34442e002
4
- data.tar.gz: 6a54db3d5aac7ab4deced6c17e2100473a513ea4
3
+ metadata.gz: d3a849e548199b8326a84a352fcbf2295cc8129d
4
+ data.tar.gz: 2d498780d9c153a173a2fc0d053d94eff8598a04
5
5
  SHA512:
6
- metadata.gz: 7181df709957bb02a3ef3f3959ca1641382b2847c811c7a36b4266d2c609e18b33a3c1a90570a4a94e4a3c73a45ab4adb9123cf5f53877dfb52363af47286bb5
7
- data.tar.gz: 693e29df25da07ec0902af3892dde90ff7bd8621bdf5caee0c636de9f0ae3805c34e3112f37d9da88e7dadc3a5c83a4b5003785b7677bf0b43b61b41c2bbb451
6
+ metadata.gz: 64a40908a3d218a6b98ca15d99e7c872f4b461cc902be4957829010fa85559f1d494ac781853e3c935230aa26b9041259671aea9c862c3114efbc250293c8073
7
+ data.tar.gz: 6b24a1f93c590c68b3a7042af9922c91d10a584674e5e2ff7df8469e641d35c975e0015d3a8ecb285a4f1a59879289292e037dfb7236dfa09e6d9895ffbb6249
@@ -3,7 +3,7 @@ module Caerbannog
3
3
  def self.push(name, payload)
4
4
  raise ConfigurationError.new("Must configure #{self.name} with message_class") unless Caerbannog.message_class
5
5
 
6
- Caerbannog.message_class.create!(:name => name, :payload => JSON.generate(payload))
6
+ Caerbannog.message_class.create!(name: name, payload: JSON.generate(payload))
7
7
  end
8
8
 
9
9
  def self.rabbitmq(rabbit_url)
@@ -11,7 +11,7 @@ module Caerbannog
11
11
 
12
12
  Bunny.run rabbit_url do |conn|
13
13
  ch = conn.create_channel
14
- exchange = ch.direct('events', :durable => true)
14
+ exchange = ch.direct('events', durable: true)
15
15
  yield exchange, ch
16
16
  end
17
17
  end
@@ -19,15 +19,15 @@ module Caerbannog
19
19
  def self.subscribe(queue_name, *routing_keys, &block)
20
20
  rabbitmq Caerbannog.rabbit_read_url do |exchange, channel|
21
21
  queue = channel.queue(queue_name)
22
- routing_keys.each { |routing_key| queue.bind(exchange, :routing_key => routing_key) }
23
- queue.subscribe(:block => true, &block)
22
+ routing_keys.each { |routing_key| queue.bind(exchange, routing_key: routing_key) }
23
+ queue.subscribe(block: true, &block)
24
24
  end
25
25
  end
26
26
 
27
- def self.publish(messages = MessagePoller.new(@message_class))
27
+ def self.publish(messages = MessagePoller.new(Caerbannog.message_class))
28
28
  rabbitmq Caerbannog.rabbit_write_url do |exchange|
29
29
  messages.each do |message|
30
- exchange.publish(message.payload, :routing_key => message.name, :persistent => true)
30
+ exchange.publish(message.payload, routing_key: message.name, persistent: true)
31
31
  message.destroy
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module Caerbannog
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -1,8 +1,8 @@
1
1
  class AddCaerbannogMessages < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :caerbannog_messages do |t|
4
- t.string :name, :null => false
5
- t.text :payload
4
+ t.string :name, null: false
5
+ t.text :payload
6
6
  t.timestamp :created_at
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caerbannog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Rogenius
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2015-03-20 00:00:00.000000000 Z
17
+ date: 2015-03-30 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rake