rails-quietly 0.0.1 → 0.0.2
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 +2 -0
- data/Gemfile.lock +17 -0
- data/lib/quietly.rb +20 -0
- data/rails-quietly.gemspec +13 -0
- metadata +6 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: '0901cb57bf4a969bf26c50c04c9ab556bc417d001ab7c794f57bc6bd24d9092a'
         | 
| 4 | 
            +
              data.tar.gz: fd3164c23d88f14393649fcec4c1629e983090f681400358b18218a7fc06890a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 61f548f5607c209a74a1b19e6bb366402a2d2c565646b21d63548963117ca27fe84bd6b3f2df3ba3aae35b6149764ce9c2c71bf7d73f69982fae776c579e7c8c
         | 
| 7 | 
            +
              data.tar.gz: 9873cf813444c887e3cba7268466efb5d3291556e448f95cdfa4bb7178c4998b971ed290284587a27fb9a06de7fcec70e376dbe8aa3287b3843e16dff55b7067
         | 
    
        data/Gemfile
    ADDED
    
    
    
        data/Gemfile.lock
    ADDED
    
    
    
        data/lib/quietly.rb
    ADDED
    
    | @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 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
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              def quietly
         | 
| 15 | 
            +
                old_logger = go_quiet
         | 
| 16 | 
            +
                result = yield
         | 
| 17 | 
            +
                end_quiet(old_logger)
         | 
| 18 | 
            +
                result
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
            end
         | 
| @@ -0,0 +1,13 @@ | |
| 1 | 
            +
            Gem::Specification.new do |s|
         | 
| 2 | 
            +
              s.name          = 'rails-quietly'
         | 
| 3 | 
            +
              s.version       = '0.0.2'
         | 
| 4 | 
            +
              s.date          = '2019-04-08'
         | 
| 5 | 
            +
              s.summary       = 'Simple wrapper for suppressing logging in Rails'
         | 
| 6 | 
            +
              s.description   = 'A simple wrapper to suppress logging in various ways in Rails apps.'
         | 
| 7 | 
            +
              s.homepage      = 'http://rubygems.org/gems/rails-quietly'
         | 
| 8 | 
            +
              s.license       = 'GPL-3.0'
         | 
| 9 | 
            +
              s.authors       = ['Julian Fiander']
         | 
| 10 | 
            +
              s.email         = 'julian@fiander.one'
         | 
| 11 | 
            +
              s.require_paths = %w[lib]
         | 
| 12 | 
            +
              s.files         = `git ls-files`.split("\n")
         | 
| 13 | 
            +
            end
         | 
    
        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.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Julian Fiander
         | 
| @@ -15,7 +15,11 @@ email: julian@fiander.one | |
| 15 15 | 
             
            executables: []
         | 
| 16 16 | 
             
            extensions: []
         | 
| 17 17 | 
             
            extra_rdoc_files: []
         | 
| 18 | 
            -
            files: | 
| 18 | 
            +
            files:
         | 
| 19 | 
            +
            - Gemfile
         | 
| 20 | 
            +
            - Gemfile.lock
         | 
| 21 | 
            +
            - lib/quietly.rb
         | 
| 22 | 
            +
            - rails-quietly.gemspec
         | 
| 19 23 | 
             
            homepage: http://rubygems.org/gems/rails-quietly
         | 
| 20 24 | 
             
            licenses:
         | 
| 21 25 | 
             
            - GPL-3.0
         |