rails-quietly 0.0.2 → 0.0.3
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 +4 -4
- data/Gemfile.lock +1 -1
- data/Readme.md +52 -0
- data/rails-quietly.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f509c2981017b96905d941f18a91a4f74fc64b33bd7c2ff88c4522d3368dac7
|
4
|
+
data.tar.gz: 0fdf9cb8a0d9055507aaa73df18bcf631afddf1938631d1173be5471436844d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af84ab294eb46dc9df87082875ad5635fa70cb8dfd1d46fdb930db35af21433a0cb5dd8a40654323d8a29e309ab1d6101d98d4c3f8a08a0a0f20836f5caca5b5
|
7
|
+
data.tar.gz: 98152a464aca9f84d7760eea57949a00f9c211729134bc9e28ead31bb7d6bc609781a8da85a3a7c9afa7d687c8bdbd9a3c31c81402741445078fd771250f20c8
|
data/Gemfile.lock
CHANGED
data/Readme.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Rails, Quietly
|
2
|
+
|
3
|
+
A simple wrapper to suppress logging in various ways in Rails apps.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this to your Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rails-quietly'
|
11
|
+
```
|
12
|
+
|
13
|
+
or install directly:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
gem install rails-quietly
|
17
|
+
```
|
18
|
+
|
19
|
+
## Inclusion
|
20
|
+
|
21
|
+
In `config/applicaiton.rb`, include the following:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'quietly'
|
25
|
+
include Quietly
|
26
|
+
```
|
27
|
+
|
28
|
+
This puts the module into global scope.
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
You can either use the `quietly` method with a block:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
result_b = quietly do
|
36
|
+
a = ModelA.query
|
37
|
+
ModelB.query(a)
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
or manually suppress and restore logging:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
old_logger = go_quiet
|
45
|
+
|
46
|
+
a = ModelA.query
|
47
|
+
result_b = ModelB.query(a)
|
48
|
+
|
49
|
+
end_quiet(old_logger)
|
50
|
+
|
51
|
+
result_b
|
52
|
+
```
|
data/rails-quietly.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'rails-quietly'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.3'
|
4
4
|
s.date = '2019-04-08'
|
5
5
|
s.summary = 'Simple wrapper for suppressing logging in Rails'
|
6
6
|
s.description = 'A simple wrapper to suppress logging in various ways in Rails apps.'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-quietly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Fiander
|
@@ -18,6 +18,7 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- Gemfile
|
20
20
|
- Gemfile.lock
|
21
|
+
- Readme.md
|
21
22
|
- lib/quietly.rb
|
22
23
|
- rails-quietly.gemspec
|
23
24
|
homepage: http://rubygems.org/gems/rails-quietly
|