rabbit_feed 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.rspec +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/example/non_rails_app/.rspec +2 -0
- data/example/non_rails_app/Gemfile.lock +1 -1
- data/example/non_rails_app/bin/benchmark +1 -4
- data/example/non_rails_app/lib/non_rails_app.rb +0 -3
- data/example/non_rails_app/spec/lib/non_rails_app/event_handler_spec.rb +0 -2
- data/example/non_rails_app/spec/lib/non_rails_app/event_routing_spec.rb +0 -2
- data/example/non_rails_app/spec/spec_helper.rb +0 -19
- data/example/rails_app/.rspec +2 -0
- data/example/rails_app/Gemfile.lock +1 -1
- data/example/rails_app/config/initializers/rabbit_feed.rb +0 -3
- data/example/rails_app/spec/controllers/beavers_controller_spec.rb +0 -2
- data/example/rails_app/spec/event_routing_spec.rb +0 -2
- data/example/rails_app/spec/rails_helper.rb +2 -3
- data/lib/rabbit_feed.rb +21 -4
- data/lib/rabbit_feed/client.rb +1 -1
- data/lib/rabbit_feed/testing_support.rb +1 -0
- data/lib/rabbit_feed/version.rb +1 -1
- data/log/.keep +0 -0
- data/spec/lib/rabbit_feed/client_spec.rb +0 -2
- data/spec/lib/rabbit_feed/configuration_spec.rb +0 -2
- data/spec/lib/rabbit_feed/consumer_connection_spec.rb +0 -2
- data/spec/lib/rabbit_feed/event_definitions_spec.rb +0 -2
- data/spec/lib/rabbit_feed/event_routing_spec.rb +0 -2
- data/spec/lib/rabbit_feed/event_spec.rb +0 -2
- data/spec/lib/rabbit_feed/producer_connection_spec.rb +0 -2
- data/spec/lib/rabbit_feed/producer_spec.rb +0 -2
- data/spec/lib/rabbit_feed/testing_support/rspec_matchers/publish_event_spec.rb +0 -2
- data/spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb +0 -2
- data/spec/spec_helper.rb +1 -2
- metadata +3 -3
- data/example/rails_app/spec/spec_helper.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb3568ac0fb22611b9d73b0b1ffd3078d7a2f378
|
4
|
+
data.tar.gz: 34f7bf50b5d0c47e8aa40603cdea8a1b43cf4c42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 997d107c3db5834ad0f8d75042af9f80aeb3070ec53a455cbfda8bf7004c658c96acc81dd33a540d10a39efa9d38ebca78e0c3f9539de35357a80ed1789550c3
|
7
|
+
data.tar.gz: 6844f471ea911177451f98d4a45750406dae32de59d44d18af54301a8576f3ac77cde9d555f515f75486390ad9320666e7f8eeab65f4522ed33a4f1bcf2ac494
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -80,7 +80,7 @@ EventRouting do
|
|
80
80
|
end
|
81
81
|
```
|
82
82
|
|
83
|
-
You may also override the log location (defaults to `STDOUT`), the environment (defaults to the `RAILS_ENV`), and the path to the RabbitFeed config file (defaults to `config/rabbit_feed.yml`) in the initializer, like this:
|
83
|
+
You may also override the log location (defaults to `log/rabbit_feed.log` if a `log` directory exists, else `STDOUT`), the environment (defaults to the `RAILS_ENV` or `RACK_ENV`), and the path to the RabbitFeed config file (defaults to `config/rabbit_feed.yml`) in the initializer, like this:
|
84
84
|
|
85
85
|
```ruby
|
86
86
|
RabbitFeed.instance_eval do
|
@@ -7,10 +7,7 @@ require 'rabbit_feed'
|
|
7
7
|
# Prevent deprecation warnings
|
8
8
|
I18n.enforce_available_locales = true
|
9
9
|
|
10
|
-
RabbitFeed.
|
11
|
-
self.log = Logger.new 'log/rabbit_feed.log'
|
12
|
-
self.environment = 'development'
|
13
|
-
end
|
10
|
+
RabbitFeed.environment = 'development'
|
14
11
|
|
15
12
|
payload = 'abc'*5000
|
16
13
|
number_of_events = 5000
|
@@ -1,9 +1,6 @@
|
|
1
1
|
require 'rabbit_feed'
|
2
2
|
require_relative 'non_rails_app/event_handler'
|
3
3
|
|
4
|
-
RabbitFeed.log = Logger.new('log/rabbit_feed.log')
|
5
|
-
RabbitFeed.log.formatter = RabbitFeed::JsonLogFormatter
|
6
|
-
|
7
4
|
EventRouting do
|
8
5
|
accept_from('rails_app') do
|
9
6
|
event('user_creates_beaver') do |event|
|
@@ -1,24 +1,5 @@
|
|
1
1
|
require 'non_rails_app'
|
2
2
|
|
3
3
|
RSpec.configure do |config|
|
4
|
-
# ## Mock Framework
|
5
|
-
#
|
6
|
-
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
7
|
-
#
|
8
|
-
# config.mock_with :mocha
|
9
|
-
# config.mock_with :flexmock
|
10
|
-
# config.mock_with :rr
|
11
|
-
|
12
|
-
# Run specs in random order to surface order dependencies. If you find an
|
13
|
-
# order dependency and want to debug it, you can fix the order by providing
|
14
|
-
# the seed, which is printed after each run.
|
15
|
-
# --seed 1234
|
16
|
-
config.order = 'random'
|
17
|
-
|
18
4
|
RabbitFeed::TestingSupport.setup(config)
|
19
5
|
end
|
20
|
-
|
21
|
-
RabbitFeed.log = Logger.new('log/rabbit_feed.log')
|
22
|
-
RabbitFeed.log.formatter = RabbitFeed::JsonLogFormatter
|
23
|
-
RabbitFeed.environment = 'test'
|
24
|
-
RabbitFeed.configuration_file_path = 'config/rabbit_feed.yml'
|
data/example/rails_app/.rspec
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV[
|
3
|
-
require '
|
4
|
-
require File.expand_path("../../config/environment", __FILE__)
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
3
|
+
require File.expand_path('../../config/environment', __FILE__)
|
5
4
|
require 'rspec/rails'
|
6
5
|
# Add additional requires below this line. Rails is not loaded until this point!
|
7
6
|
|
data/lib/rabbit_feed.rb
CHANGED
@@ -29,10 +29,7 @@ module RabbitFeed
|
|
29
29
|
attr_accessor :log, :environment, :configuration_file_path, :application
|
30
30
|
|
31
31
|
def configuration
|
32
|
-
|
33
|
-
RabbitFeed.configuration_file_path ||= 'config/rabbit_feed.yml'
|
34
|
-
RabbitFeed.environment ||= ENV['RAILS_ENV'] || ENV['RACK_ENV']
|
35
|
-
@configuration ||= (Configuration.load RabbitFeed.configuration_file_path, RabbitFeed.environment, application)
|
32
|
+
@configuration ||= (Configuration.load configuration_file_path, environment, application)
|
36
33
|
end
|
37
34
|
|
38
35
|
def exception_notify exception
|
@@ -40,4 +37,24 @@ module RabbitFeed
|
|
40
37
|
(Airbrake.notify_or_ignore exception) if Airbrake.configuration.public?
|
41
38
|
end
|
42
39
|
end
|
40
|
+
|
41
|
+
def default_logger
|
42
|
+
if File.directory? 'log'
|
43
|
+
Logger.new 'log/rabbit_feed.log', 10, 100.megabytes
|
44
|
+
else
|
45
|
+
Logger.new STDOUT
|
46
|
+
end.tap do |log|
|
47
|
+
log.formatter = RabbitFeed::JsonLogFormatter
|
48
|
+
log.level = Logger::INFO
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_defaults
|
53
|
+
self.log = default_logger
|
54
|
+
self.configuration_file_path = 'config/rabbit_feed.yml'
|
55
|
+
self.environment = ENV['RAILS_ENV'] || ENV['RACK_ENV']
|
56
|
+
end
|
57
|
+
private :set_defaults
|
58
|
+
|
59
|
+
set_defaults
|
43
60
|
end
|
data/lib/rabbit_feed/client.rb
CHANGED
@@ -86,7 +86,7 @@ module RabbitFeed
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def set_logging
|
89
|
-
RabbitFeed.log = Logger.new
|
89
|
+
RabbitFeed.log = Logger.new(options[:logfile], 10, 100.megabytes)
|
90
90
|
RabbitFeed.log.level = verbose? ? Logger::DEBUG : Logger::INFO
|
91
91
|
RabbitFeed.log.formatter = RabbitFeed::JsonLogFormatter
|
92
92
|
end
|
data/lib/rabbit_feed/version.rb
CHANGED
data/log/.keep
ADDED
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -38,8 +38,7 @@ RSpec.configure do |config|
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def reset_environment
|
41
|
-
RabbitFeed.log =
|
42
|
-
RabbitFeed.log.formatter = RabbitFeed::JsonLogFormatter
|
41
|
+
RabbitFeed.log = RabbitFeed.default_logger
|
43
42
|
RabbitFeed.environment = 'test'
|
44
43
|
RabbitFeed.configuration_file_path = 'spec/fixtures/configuration.yml'
|
45
44
|
RabbitFeed::Consumer.event_routing = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simply Business
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -225,7 +225,6 @@ files:
|
|
225
225
|
- example/rails_app/spec/controllers/beavers_controller_spec.rb
|
226
226
|
- example/rails_app/spec/event_routing_spec.rb
|
227
227
|
- example/rails_app/spec/rails_helper.rb
|
228
|
-
- example/rails_app/spec/spec_helper.rb
|
229
228
|
- example/rails_app/test/controllers/.keep
|
230
229
|
- example/rails_app/test/controllers/beavers_controller_test.rb
|
231
230
|
- example/rails_app/test/fixtures/.keep
|
@@ -258,6 +257,7 @@ files:
|
|
258
257
|
- lib/rabbit_feed/testing_support/test_rabbit_feed_consumer.rb
|
259
258
|
- lib/rabbit_feed/testing_support/testing_helpers.rb
|
260
259
|
- lib/rabbit_feed/version.rb
|
260
|
+
- log/.keep
|
261
261
|
- logo.png
|
262
262
|
- rabbit_feed.gemspec
|
263
263
|
- run_benchmark
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'rabbit_feed'
|
2
|
-
require 'logger'
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
|
6
|
-
# Run specs in random order to surface order dependencies. If you find an
|
7
|
-
# order dependency and want to debug it, you can fix the order by providing
|
8
|
-
# the seed, which is printed after each run.
|
9
|
-
# --seed 1234
|
10
|
-
config.order = 'random'
|
11
|
-
end
|
12
|
-
|
13
|
-
RabbitFeed.log = Logger.new('log/rabbit_feed.log')
|
14
|
-
RabbitFeed.log.formatter = RabbitFeed::JsonLogFormatter
|