blabbermouth 0.0.5 → 0.0.6

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: f98803c45f268ba1996c09ea11a80a6ef37c6a1a
4
- data.tar.gz: ccd0de0419d5e61031e407f9b836787402c79a1d
3
+ metadata.gz: ad1e79c1edd1784dd175e9055349da4b78f89724
4
+ data.tar.gz: 9524e884b0393542c4f54df3957c24684e8e97de
5
5
  SHA512:
6
- metadata.gz: 49cf015a98b558aa260538ad3caf3e9a468a99837e7ebe7e0dc7b8d286f070d3dabe6b2ee27f52067be4a00e5b31ba8b8228c43bba7426104f6470eb023171bf
7
- data.tar.gz: 631113f766998dfc7b002cd77b2baca5a39bb853eb522e4a010a7e7b73bc88627f957beeb957c3a59dba0d6b3e85e031fe2792f9dd2d6358ae4f6aa7df253cb3
6
+ metadata.gz: 42f08b0dbf4b7c8d8e1706fa8efefd6c71757596ea57358db7c7d8c5187416a4a83713e0b67d9d8a9ca2ed2b1d664adb35be64315a22e5c3fffa510451c59e2a
7
+ data.tar.gz: 2c96cbd6e40b89eaed59d4d4546481a61cfecd8c20696d62453ba4e45e2e9f8d6103262e586ce413b9735a3adc763f15f6a4861f38f0fb468b0dcb2e286fa168
@@ -5,4 +5,5 @@ end
5
5
 
6
6
  require 'blabbermouth/bystanders/base'
7
7
  require 'blabbermouth/bystanders/formatter'
8
+ require 'blabbermouth/bystanders/dynamic_events'
8
9
  require 'blabbermouth/bystanders/stdout'
@@ -0,0 +1,18 @@
1
+ module Blabbermouth
2
+ module Bystanders
3
+ module DynamicEvents
4
+
5
+ def method_missing(meth, *args)
6
+ data = args.extract_options![:data] || {}
7
+ key = args.slice!(0,1).first
8
+ value = args.slice!(0,1).first
9
+ data.merge!({args: args}) unless args.empty?
10
+ blab meth, key, value, data
11
+ end
12
+
13
+ def respond_to_missing?(meth, include_private=false)
14
+ true
15
+ end
16
+ end
17
+ end
18
+ end
@@ -2,6 +2,7 @@ module Blabbermouth
2
2
  module Bystanders
3
3
  class Stdout < Base
4
4
  include Blabbermouth::Bystanders::Formatter
5
+ include Blabbermouth::Bystanders::DynamicEvents
5
6
 
6
7
  def error(key, e, *args)
7
8
  blab :error, key, e, *args
@@ -1,3 +1,3 @@
1
1
  module Blabbermouth
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -1,6 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Blabbermouth::Bystanders::Stdout do
4
+ it 'responds to dynamic event methods' do
5
+ expect(capture_stdout { subject.custom('blabbermouth.test.custom') }).to eql(subject.send(:log_message, :custom, 'blabbermouth.test.custom', nil))
6
+ end
7
+
4
8
  describe '#error' do
5
9
  it 'outputs to STDOUT' do
6
10
  expect(capture_stdout { subject.error('key', StandardError.new) }).to eql(subject.send(:log_message, :error, 'key', StandardError.new))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blabbermouth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-07 00:00:00.000000000 Z
11
+ date: 2015-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -65,6 +65,7 @@ files:
65
65
  - lib/blabbermouth/blabber.rb
66
66
  - lib/blabbermouth/bystanders.rb
67
67
  - lib/blabbermouth/bystanders/base.rb
68
+ - lib/blabbermouth/bystanders/dynamic_events.rb
68
69
  - lib/blabbermouth/bystanders/formatter.rb
69
70
  - lib/blabbermouth/bystanders/new_relic.rb
70
71
  - lib/blabbermouth/bystanders/stdout.rb