blabbermouth-rails 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 398a6f6dd077c97d943bab6af24cc9d6ce5df47a
4
- data.tar.gz: c3855b0f14923dde1c0b6fc330a8fd80844d3922
3
+ metadata.gz: 28175c22e8c363cb52ed819bd708d7bff53c459d
4
+ data.tar.gz: 60c4d9c33df3caec5aeb6e18f0173df35c30abbd
5
5
  SHA512:
6
- metadata.gz: 816f67fe80c117b5b7747e60a4eb58a6d4f33eccd7e32c6e7f32bcf5773d7b8f7fcdb316dc1c4676bd08dce09476ec2274481d7c00b324e214a306c5f5011547
7
- data.tar.gz: 19739f54407f95513f7ba26e2df91fe7dfb73d4a75ff97aa163960692c9bad806082438ff6ec9f461fda9d91f7d14b1b9ce76fbe2040b2cf048b6b3152cb608d
6
+ metadata.gz: af2e6d4eddeb7046a121e4dc6f30bf0d9b7869b01095a1132af3c9383de3daebeb504259344fe8e99acd65fabc09c21644760ef31f93e4e11de43d3c6171bba0
7
+ data.tar.gz: 22bd0a4044078f9a2b6cb9fd756f214059cabcd18d7a400bb4f121fc74342beecc00cfa9043c798fc793dc09ed61e9faab1354904ec4abea9663683c81b18084
@@ -1,3 +1,8 @@
1
1
  require 'blabbermouth'
2
- require 'blabbermouth/gawkers/rails'
3
- require 'blabbermouth-rails/railtie'
2
+ module Blabbermouth
3
+ module Rails
4
+ end
5
+ end
6
+ require 'blabbermouth/rails/version'
7
+ require 'blabbermouth/rails/bystander'
8
+ require 'blabbermouth/rails/railtie'
@@ -1,5 +1,5 @@
1
1
  module Blabbermouth
2
- module Gawkers
2
+ module Bystanders
3
3
  class Rails < Base
4
4
  def error(key, e, *args)
5
5
  data, opts, args = parse_args(*args)
@@ -0,0 +1,9 @@
1
+ module Blabbermouth
2
+ class Railtie < ::Rails::Railtie
3
+ initializer 'blabbermouth.configure_rails_bystander' do
4
+ Blabbermouth.configure do |config|
5
+ config.bystanders = [:rails]
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module Blabbermouth
2
+ module Rails
3
+ VERSION = '0.0.4'
4
+ end
5
+ end
@@ -0,0 +1,39 @@
1
+ require 'blabbermouth-rails'
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe Blabbermouth::Bystanders::Rails do
5
+ describe '#error' do
6
+ it 'uses the rails logger' do
7
+ subject.error('key', StandardError.new)
8
+ expect(Rails.logger.errors).to include(subject.send(:log_message, :error, 'key', StandardError.new))
9
+ end
10
+ end
11
+
12
+ describe '#info' do
13
+ it 'uses the rails logger' do
14
+ subject.info('key', 'test')
15
+ expect(Rails.logger.infos).to include(subject.send(:log_message, :info, 'key', 'test'))
16
+ end
17
+ end
18
+
19
+ describe '#increment' do
20
+ it 'uses the rails logger' do
21
+ subject.increment('key', 1)
22
+ expect(Rails.logger.infos).to include(subject.send(:log_message, :increment, 'key', 1))
23
+ end
24
+ end
25
+
26
+ describe '#count' do
27
+ it 'uses the rails logger' do
28
+ subject.count('key', 1)
29
+ expect(Rails.logger.infos).to include(subject.send(:log_message, :count, 'key', 1))
30
+ end
31
+ end
32
+
33
+ describe '#time' do
34
+ it 'uses the rails logger' do
35
+ subject.time('key', 1)
36
+ expect(Rails.logger.infos).to include(subject.send(:log_message, :time, 'key', 1))
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,101 @@
1
+ require 'blabbermouth'
2
+ require 'rspec'
3
+
4
+ Dir[File.join(File.dirname(__FILE__), '..', "spec/support/**/*.rb")].each { |f| require f }
5
+
6
+ Blabbermouth.configure do |config|
7
+ config.bystanders = []
8
+ end
9
+
10
+ RSpec.configure do |config|
11
+ #config.before(:suite) do
12
+ # ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
13
+ # capture_stdout { load "db/schema.rb" }
14
+ # load 'support/models.rb'
15
+ #end
16
+
17
+ # rspec-expectations config goes here. You can use an alternate
18
+ # assertion/expectation library such as wrong or the stdlib/minitest
19
+ # assertions if you prefer.
20
+ config.expect_with :rspec do |expectations|
21
+ # This option will default to `true` in RSpec 4. It makes the `description`
22
+ # and `failure_message` of custom matchers include text for helper methods
23
+ # defined using `chain`, e.g.:
24
+ # be_bigger_than(2).and_smaller_than(4).description
25
+ # # => "be bigger than 2 and smaller than 4"
26
+ # ...rather than:
27
+ # # => "be bigger than 2"
28
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
29
+ end
30
+
31
+ # rspec-mocks config goes here. You can use an alternate test double
32
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
33
+ config.mock_with :rspec do |mocks|
34
+ # Prevents you from mocking or stubbing a method that does not exist on
35
+ # a real object. This is generally recommended, and will default to
36
+ # `true` in RSpec 4.
37
+ mocks.verify_partial_doubles = true
38
+ end
39
+
40
+ # Many RSpec users commonly either run the entire suite or an individual
41
+ # file, and it's useful to allow more verbose output when running an
42
+ # individual spec file.
43
+ if config.files_to_run.one?
44
+ # Use the documentation formatter for detailed output,
45
+ # unless a formatter has already been configured
46
+ # (e.g. via a command-line flag).
47
+ config.default_formatter = 'doc'
48
+ end
49
+
50
+ # Limits the available syntax to the non-monkey patched syntax that is recommended.
51
+ # For more details, see:
52
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
53
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
54
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
55
+ config.disable_monkey_patching!
56
+
57
+ # Run specs in random order to surface order dependencies. If you find an
58
+ # order dependency and want to debug it, you can fix the order by providing
59
+ # the seed, which is printed after each run.
60
+ # --seed 1234
61
+ config.order = :random
62
+
63
+ # Seed global randomization in this process using the `--seed` CLI option.
64
+ # Setting this allows you to use `--seed` to deterministically reproduce
65
+ # test failures related to randomization by passing the same `--seed` value
66
+ # as the one that triggered the failure.
67
+ Kernel.srand config.seed
68
+
69
+ # Print the 10 slowest examples and example groups at the
70
+ # end of the spec run, to help surface which specs are running
71
+ # particularly slow.
72
+ #config.profile_examples = 10
73
+
74
+ # These two settings work together to allow you to limit a spec run
75
+ # to individual examples or groups you care about by tagging them with
76
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
77
+ # get run.
78
+ #config.filter_run :focus
79
+ #config.run_all_when_everything_filtered = true
80
+ end
81
+
82
+ # TODO look into why I need to patch these to work with default behavior?
83
+ class FalseClass
84
+ def false?
85
+ true
86
+ end
87
+
88
+ def true?
89
+ false
90
+ end
91
+ end
92
+
93
+ class TrueClass
94
+ def false?
95
+ false
96
+ end
97
+
98
+ def true?
99
+ true
100
+ end
101
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blabbermouth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Gawker for Blabbermouth that writes to the Rails Logger
69
+ description: Bystander for Blabbermouth that writes to the Rails Logger
70
70
  email:
71
71
  - mark@markrebec.com
72
72
  executables: []
@@ -74,9 +74,11 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - lib/blabbermouth-rails.rb
77
- - lib/blabbermouth-rails/railtie.rb
78
- - lib/blabbermouth-rails/version.rb
79
- - lib/blabbermouth/gawkers/rails.rb
77
+ - lib/blabbermouth/rails/bystander.rb
78
+ - lib/blabbermouth/rails/railtie.rb
79
+ - lib/blabbermouth/rails/version.rb
80
+ - spec/blabbermouth/rails/bystander_spec.rb
81
+ - spec/spec_helper.rb
80
82
  homepage: http://github.com/markrebec/blabbermouth
81
83
  licenses: []
82
84
  metadata: {}
@@ -99,5 +101,7 @@ rubyforge_project:
99
101
  rubygems_version: 2.2.2
100
102
  signing_key:
101
103
  specification_version: 4
102
- summary: Rails gawker for Blabbermouth
103
- test_files: []
104
+ summary: Rails bystander for Blabbermouth
105
+ test_files:
106
+ - spec/spec_helper.rb
107
+ - spec/blabbermouth/rails/bystander_spec.rb
@@ -1,9 +0,0 @@
1
- module Blabbermouth
2
- class Railtie < Rails::Railtie
3
- initializer 'blabbermouth.configure_rails_gawker' do
4
- Blabbermouth.configure do |config|
5
- config.gawkers = [:rails]
6
- end
7
- end
8
- end
9
- end
@@ -1,3 +0,0 @@
1
- module Blabbermouth
2
- RAILS_VERSION = '0.0.3'
3
- end