rails-quietly 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +79 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +2 -2
- data/Readme.md +1 -1
- data/lib/quietly.rb +5 -15
- data/lib/quietly/local.rb +22 -0
- data/rails-quietly.gemspec +4 -2
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b7f92b507e7027fc04a31577945e7e987d4f455b
|
4
|
+
data.tar.gz: 9103f77806d91177230817ead3a13a9ed5d8ea64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b12d44b933fd5ebe28a3a89e77d827b1209f01f92d5ec28aec255a05491000b97b3d248382dbc548969df2dbaec456258cf6c7db6ba428d36fe3c16a0052df4
|
7
|
+
data.tar.gz: da09505d08770eebc622de32c4a88a45950eb7ad5882976d3630eafed462d13abfa32bd56b885472882f831bc1082b0a8cfded32c737c68d1e9d41628d5d30df
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.3
|
5
|
+
Exclude:
|
6
|
+
- bin/**/*
|
7
|
+
- config/**/*
|
8
|
+
- db/**/*
|
9
|
+
- vendor/**/*
|
10
|
+
- tmp/**/*
|
11
|
+
|
12
|
+
Layout/IndentFirstHashElement:
|
13
|
+
EnforcedStyle: consistent
|
14
|
+
Layout/AccessModifierIndentation:
|
15
|
+
EnforcedStyle: outdent
|
16
|
+
Layout/EmptyLinesAroundAccessModifier:
|
17
|
+
Enabled: true
|
18
|
+
Layout/AlignArray:
|
19
|
+
Enabled: true
|
20
|
+
Layout/AlignHash:
|
21
|
+
Enabled: true
|
22
|
+
Layout/EmptyLineAfterGuardClause:
|
23
|
+
Enabled: true
|
24
|
+
Layout/SpaceInsideBlockBraces:
|
25
|
+
EnforcedStyle: space
|
26
|
+
EnforcedStyleForEmptyBraces: no_space
|
27
|
+
Layout/SpaceInsideHashLiteralBraces:
|
28
|
+
EnforcedStyle: space
|
29
|
+
EnforcedStyleForEmptyBraces: no_space
|
30
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
31
|
+
EnforcedStyle: no_space
|
32
|
+
|
33
|
+
Lint/UnusedMethodArgument:
|
34
|
+
Enabled: true
|
35
|
+
Lint/UselessAssignment:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Metrics/LineLength:
|
39
|
+
Max: 100
|
40
|
+
Metrics/MethodLength:
|
41
|
+
Enabled: true
|
42
|
+
Metrics/ClassLength:
|
43
|
+
Enabled: true
|
44
|
+
Max: 125
|
45
|
+
Metrics/ModuleLength:
|
46
|
+
Max: 125
|
47
|
+
Metrics/ParameterLists:
|
48
|
+
Enabled: true
|
49
|
+
Metrics/CyclomaticComplexity:
|
50
|
+
Enabled: true
|
51
|
+
Metrics/AbcSize:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Naming/MemoizedInstanceVariableName:
|
55
|
+
Enabled: false
|
56
|
+
Naming/UncommunicativeMethodParamName:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Style/Documentation:
|
60
|
+
Enabled: false
|
61
|
+
Style/FrozenStringLiteralComment:
|
62
|
+
Enabled: true
|
63
|
+
Style/NumericLiterals:
|
64
|
+
Enabled: true
|
65
|
+
Style/StringLiterals:
|
66
|
+
EnforcedStyle: single_quotes
|
67
|
+
Style/AndOr:
|
68
|
+
Enabled: true
|
69
|
+
Style/ClassCheck:
|
70
|
+
Enabled: true
|
71
|
+
Style/GuardClause:
|
72
|
+
Enabled: true
|
73
|
+
|
74
|
+
Security/Eval:
|
75
|
+
Enabled: true
|
76
|
+
Security/JSONLoad:
|
77
|
+
Enabled: true
|
78
|
+
Security/YAMLLoad:
|
79
|
+
Enabled: true
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.4
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
data/lib/quietly.rb
CHANGED
@@ -1,20 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
::ActiveRecord::Base.logger = nil
|
7
|
-
old_logger
|
8
|
-
end
|
9
|
-
|
10
|
-
def end_quiet(old_logger)
|
11
|
-
::ActiveRecord::Base.logger = old_logger
|
12
|
-
end
|
3
|
+
class Quietly
|
4
|
+
require 'quietly/local'
|
5
|
+
extend Quietly::Local
|
13
6
|
|
14
|
-
def
|
15
|
-
|
16
|
-
result = yield
|
17
|
-
end_quiet(old_logger)
|
18
|
-
result
|
7
|
+
def self.run
|
8
|
+
quietly { yield }
|
19
9
|
end
|
20
10
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Quietly
|
4
|
+
module Local
|
5
|
+
def go_quiet
|
6
|
+
old_logger = ::ActiveRecord::Base.logger
|
7
|
+
::ActiveRecord::Base.logger = nil
|
8
|
+
old_logger
|
9
|
+
end
|
10
|
+
|
11
|
+
def end_quiet(old_logger)
|
12
|
+
::ActiveRecord::Base.logger = old_logger
|
13
|
+
end
|
14
|
+
|
15
|
+
def quietly
|
16
|
+
old_logger = go_quiet
|
17
|
+
result = yield
|
18
|
+
end_quiet(old_logger)
|
19
|
+
result
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/rails-quietly.gemspec
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
4
|
s.name = 'rails-quietly'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '2019-
|
5
|
+
s.version = '0.0.4'
|
6
|
+
s.date = '2019-06-20'
|
5
7
|
s.summary = 'Simple wrapper for suppressing logging in Rails'
|
6
8
|
s.description = 'A simple wrapper to suppress logging in various ways in Rails apps.'
|
7
9
|
s.homepage = 'http://rubygems.org/gems/rails-quietly'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Fiander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple wrapper to suppress logging in various ways in Rails apps.
|
14
14
|
email: julian@fiander.one
|
@@ -16,10 +16,13 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".rubocop.yml"
|
20
|
+
- ".ruby-version"
|
19
21
|
- Gemfile
|
20
22
|
- Gemfile.lock
|
21
23
|
- Readme.md
|
22
24
|
- lib/quietly.rb
|
25
|
+
- lib/quietly/local.rb
|
23
26
|
- rails-quietly.gemspec
|
24
27
|
homepage: http://rubygems.org/gems/rails-quietly
|
25
28
|
licenses:
|
@@ -40,7 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
43
|
- !ruby/object:Gem::Version
|
41
44
|
version: '0'
|
42
45
|
requirements: []
|
43
|
-
|
46
|
+
rubyforge_project:
|
47
|
+
rubygems_version: 2.6.14.1
|
44
48
|
signing_key:
|
45
49
|
specification_version: 4
|
46
50
|
summary: Simple wrapper for suppressing logging in Rails
|