blabbermouth-rails 0.0.4 → 0.0.5

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: 28175c22e8c363cb52ed819bd708d7bff53c459d
4
- data.tar.gz: 60c4d9c33df3caec5aeb6e18f0173df35c30abbd
3
+ metadata.gz: aa15487be8aed03653a0f84579c5f1275d606c1a
4
+ data.tar.gz: eced4d83a94cdb928e7641aa21f5e08e63831965
5
5
  SHA512:
6
- metadata.gz: af2e6d4eddeb7046a121e4dc6f30bf0d9b7869b01095a1132af3c9383de3daebeb504259344fe8e99acd65fabc09c21644760ef31f93e4e11de43d3c6171bba0
7
- data.tar.gz: 22bd0a4044078f9a2b6cb9fd756f214059cabcd18d7a400bb4f121fc74342beecc00cfa9043c798fc793dc09ed61e9faab1354904ec4abea9663683c81b18084
6
+ metadata.gz: 70e6ce81d29762d0701a2a04e25de368a211c97e09ab2f917ba1bd73c7008facb80b9c1ebfa2e780ad18d3f329dae7eb5a2bbea663fd7ece66fdb909e8ab2ccf
7
+ data.tar.gz: 4429a8a5103673364c1bcccd2f7ab6691829e3176cd179200b1bf75f42040d84544f64eda36fa42c0680a435922514b72382963a1e6de8996f74c60390fd0682
@@ -1,29 +1,31 @@
1
1
  module Blabbermouth
2
2
  module Bystanders
3
3
  class Rails < Base
4
+ include Blabbermouth::Bystanders::Formatter
5
+
4
6
  def error(key, e, *args)
5
- data, opts, args = parse_args(*args)
6
- log :error, key, e.message, data
7
+ blab :error, key, e, *args
7
8
  end
8
9
 
9
10
  def info(key, msg=nil, *args)
10
- data, opts, args = parse_args(*args)
11
- log :info, key, msg, data
11
+ blab :info, key, msg, *args
12
12
  end
13
13
 
14
14
  def increment(key, by=1, *args)
15
- data, opts, args = parse_args(*args)
16
- log :increment, key, by, data
15
+ blab :increment, key, by, *args
17
16
  end
18
17
 
19
18
  def count(key, total, *args)
20
- data, opts, args = parse_args(*args)
21
- log :count, key, total, data
19
+ blab :count, key, total, *args
22
20
  end
23
21
 
24
- def time(key, value=nil, *args)
22
+ def time(key, duration, *args)
23
+ blab :time, key, duration, *args
24
+ end
25
+
26
+ def blab(meth, key, value, *args)
25
27
  data, opts, args = parse_args(*args)
26
- log :time, key, value, data
28
+ log meth, key, value, data
27
29
  end
28
30
 
29
31
  protected
@@ -40,13 +42,6 @@ module Blabbermouth
40
42
  rails? ? ::Rails.logger.info(message) : puts(message)
41
43
  end
42
44
  end
43
-
44
- def log_message(event, key, msg, data={})
45
- message = "[#{::Time.now.strftime('%Y/%m/%d %H:%M:%S %Z')}] Blabbermouth.#{event.to_s}: #{key.to_s}"
46
- message += ": #{msg.to_s}" unless msg.to_s.blank?
47
- message += " #{data.to_s}"
48
- message
49
- end
50
45
  end
51
46
  end
52
47
  end
@@ -1,5 +1,6 @@
1
+ require 'blabbermouth/version'
1
2
  module Blabbermouth
2
3
  module Rails
3
- VERSION = '0.0.4'
4
+ VERSION = Blabbermouth::VERSION
4
5
  end
5
6
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'blabbermouth'
2
2
  require 'rspec'
3
+ require 'coveralls'
4
+ Coveralls.wear!
3
5
 
4
6
  Dir[File.join(File.dirname(__FILE__), '..', "spec/support/**/*.rb")].each { |f| require f }
5
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blabbermouth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-06 00:00:00.000000000 Z
11
+ date: 2015-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blabbermouth