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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 8f509c2981017b96905d941f18a91a4f74fc64b33bd7c2ff88c4522d3368dac7
4
- data.tar.gz: 0fdf9cb8a0d9055507aaa73df18bcf631afddf1938631d1173be5471436844d3
2
+ SHA1:
3
+ metadata.gz: b7f92b507e7027fc04a31577945e7e987d4f455b
4
+ data.tar.gz: 9103f77806d91177230817ead3a13a9ed5d8ea64
5
5
  SHA512:
6
- metadata.gz: af84ab294eb46dc9df87082875ad5635fa70cb8dfd1d46fdb930db35af21433a0cb5dd8a40654323d8a29e309ab1d6101d98d4c3f8a08a0a0f20836f5caca5b5
7
- data.tar.gz: 98152a464aca9f84d7760eea57949a00f9c211729134bc9e28ead31bb7d6bc609781a8da85a3a7c9afa7d687c8bdbd9a3c31c81402741445078fd771250f20c8
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
@@ -1,2 +1,4 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-quietly (0.0.3)
4
+ rails-quietly (0.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -14,4 +14,4 @@ DEPENDENCIES
14
14
  rails-quietly!
15
15
 
16
16
  BUNDLED WITH
17
- 2.0.0
17
+ 1.17.3
data/Readme.md CHANGED
@@ -22,7 +22,7 @@ In `config/applicaiton.rb`, include the following:
22
22
 
23
23
  ```ruby
24
24
  require 'quietly'
25
- include Quietly
25
+ include Quietly::Local
26
26
  ```
27
27
 
28
28
  This puts the module into global scope.
data/lib/quietly.rb CHANGED
@@ -1,20 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Quietly
4
- def go_quiet
5
- old_logger = ::ActiveRecord::Base.logger
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 quietly
15
- old_logger = go_quiet
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
@@ -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.3'
4
- s.date = '2019-04-08'
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.3
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-04-08 00:00:00.000000000 Z
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
- rubygems_version: 3.0.2
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