From 57538fa09fffea38e4c09071ae8255b5369ec8ca Mon Sep 17 00:00:00 2001 From: Eric <812048774@qq.com> Date: Wed, 23 Dec 2015 18:44:29 +0800 Subject: [PATCH 1/6] bug fixed: custom_fields is empty When one request insert mutil logs (e.g. render_template.action_view logs), custom fields will be empty --- lib/logstasher/action_view/log_subscriber.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/logstasher/action_view/log_subscriber.rb b/lib/logstasher/action_view/log_subscriber.rb index dc8d215..4e73c7a 100644 --- a/lib/logstasher/action_view/log_subscriber.rb +++ b/lib/logstasher/action_view/log_subscriber.rb @@ -62,7 +62,6 @@ def runtimes(event) def extract_custom_fields(data) custom_fields = (!LogStasher.custom_fields.empty? && data.extract!(*LogStasher.custom_fields)) || {} - LogStasher.custom_fields.clear custom_fields end end From f2d551957db100e54dd251acd99d0c0aacafb35a Mon Sep 17 00:00:00 2001 From: Shadab Ahmed Date: Thu, 11 Feb 2016 19:54:50 -0800 Subject: [PATCH 2/6] Updated ruby and rails versions Deprecated older versions for build environment --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e08d03c..ff9560c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: ruby rvm: - - 1.9.3 - 2.0.0 - 2.1.4 + - 2.2.2 env: + - "RAILS_VERSION=4.2" + - "RAILS_VERSION=4.1" - "RAILS_VERSION=4.0" - "RAILS_VERSION=3.2" - - "RAILS_VERSION=3.1" - - "RAILS_VERSION=3.0" - + script: bundle exec rspec From af12db4ceac78a4dae05c39a3d304da8ae53d279 Mon Sep 17 00:00:00 2001 From: Shadab Ahmed Date: Fri, 12 Feb 2016 10:15:01 -0800 Subject: [PATCH 3/6] Update to travis yml --- .travis.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff9560c..37da8ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,16 @@ language: ruby +sudo: false +cache: bundler +bundler_args: --without guard +script: "bundle exec rspec" rvm: - - 2.0.0 - - 2.1.4 - - 2.2.2 - + - 1.9.3 + - 2.0 + - 2.1 + - 2.2 + - ruby-head env: - "RAILS_VERSION=4.2" - "RAILS_VERSION=4.1" - "RAILS_VERSION=4.0" - "RAILS_VERSION=3.2" - -script: bundle exec rspec From 10d92b85680cc4b61fe4164b5b3d0efc802e9e80 Mon Sep 17 00:00:00 2001 From: Shadab Ahmed Date: Fri, 12 Feb 2016 10:17:26 -0800 Subject: [PATCH 4/6] Moved out guard in a new gem group --- Gemfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 2ca61bf..646b09b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,12 +4,15 @@ source "https://rubygems.org" gemspec group :test do - gem 'growl' - gem 'guard' - gem 'guard-rspec' gem 'rails', "~> #{ENV["RAILS_VERSION"] || "3.2.0"}" gem 'rb-fsevent', '~> 0.9' gem 'rcov', :platforms => :mri_18 gem 'redis', :require => false gem 'simplecov', :platforms => :mri_19, :require => false end + +group :guard do + gem 'growl' + gem 'guard' + gem 'guard-rspec' +end From 576d24f4fdd50abef4f01565912e2e5329c38954 Mon Sep 17 00:00:00 2001 From: Shadab Ahmed Date: Fri, 12 Feb 2016 11:37:55 -0800 Subject: [PATCH 5/6] Fixed specs and warning --- .../active_support/mailer_log_subscriber_spec.rb | 12 +----------- spec/lib/logstasher/device/redis_spec.rb | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/spec/lib/logstasher/active_support/mailer_log_subscriber_spec.rb b/spec/lib/logstasher/active_support/mailer_log_subscriber_spec.rb index cdbad9e..1695376 100644 --- a/spec/lib/logstasher/active_support/mailer_log_subscriber_spec.rb +++ b/spec/lib/logstasher/active_support/mailer_log_subscriber_spec.rb @@ -18,7 +18,7 @@ def log_output.json LogStasher::ActiveSupport::MailerLogSubscriber.attach_to(:action_mailer) end - before do + before :each do LogStasher.logger = logger expect(LogStasher.request_context).to receive(:merge).at_most(2).times.and_call_original end @@ -52,16 +52,6 @@ def log_output.json it 'deliver an outgoing e-mail' do email = SampleMailer.welcome - - if version = ENV['RAILS_VERSION'] and version >= '4.1' - log_output.json.tap do |json| - expect(json['source']).to eq(LogStasher.source) - expect(json['tags']).to eq(['mailer', 'process']) - expect(json['mailer']).to eq('SampleMailer') - expect(json['action']).to eq('welcome') - end - end - email.deliver log_output.json.tap do |json| expect(json['source']).to eq(LogStasher.source) diff --git a/spec/lib/logstasher/device/redis_spec.rb b/spec/lib/logstasher/device/redis_spec.rb index 05f0ae3..769145d 100644 --- a/spec/lib/logstasher/device/redis_spec.rb +++ b/spec/lib/logstasher/device/redis_spec.rb @@ -40,7 +40,7 @@ it 'does not allow unsupported data types' do expect { device = LogStasher::Device::Redis.new(data_type: 'blargh') - }.to raise_error() + }.to raise_error(RuntimeError) end it 'quits the redis connection on #close' do From 4d08bcb041ad0c31f7d6435ff354f3e28bdc1392 Mon Sep 17 00:00:00 2001 From: Shadab Ahmed Date: Fri, 12 Feb 2016 11:40:12 -0800 Subject: [PATCH 6/6] Updated .ruby-version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 7d2ed7c..5859406 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.4 +2.2.3