puts_debuggerer 0.11.0 → 0.12.0
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/CHANGELOG.md +6 -0
- data/README.md +7 -8
- data/VERSION +1 -1
- data/lib/puts_debuggerer.rb +9 -1
- metadata +7 -21
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 85cc76378a88f1e7c8019f347e69070190ca4f051619fc60dee05d2ff3e83dda
         | 
| 4 | 
            +
              data.tar.gz: fb66e2375aa5624c8910d429032e9d99367b1ed5560aa7e364bd431167f5a291
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e61dc7234af7e6392bc61a8510a63846c65a6cf305e5ba2dd2ce807d6ec72d259675cf0f32bddb45709d0d823e2123d8e3ce4ecce14c8165bb15874354128c24
         | 
| 7 | 
            +
              data.tar.gz: 5140b36a4d575b4f27e19929c70437d8e30a45d5085b682106868c2e915e49be6744a6aea772946b8e05b3ec2d1ed4d3be21ba163dec2db56a21eeaa6b991650
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,11 @@ | |
| 1 1 | 
             
            # Change Log
         | 
| 2 2 |  | 
| 3 | 
            +
            ## 0.12.0
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            - Upgrade `awesome_print` to `~> 0.9.2`
         | 
| 6 | 
            +
            - Support passing pd options as part of a printed hash instead of requiring a separate hash (e.g. `pd(path: path, header: true)` instead of `pd({path: path}, header: true)` )
         | 
| 7 | 
            +
            - Support empty use of pd statement + options (e.g. `pd` or `pd header: true`)
         | 
| 8 | 
            +
             | 
| 3 9 | 
             
            ## 0.11.0
         | 
| 4 10 |  | 
| 5 11 | 
             
            - Pry support
         | 
    
        data/README.md
    CHANGED
    
    | @@ -33,7 +33,7 @@ Output: | |
| 33 33 |  | 
| 34 34 | 
             
            ## Background
         | 
| 35 35 |  | 
| 36 | 
            -
            It can be quite frustrating to lose puts statements in a large output or log file. One way to help find them is add an announcer (e.g. `puts "The Order Total"`) or a header (e.g. `puts ' | 
| 36 | 
            +
            It can be quite frustrating to lose puts statements in a large output or log file. One way to help find them is add an announcer (e.g. `puts "The Order Total"`) or a header (e.g. `puts '>'*80`) before every puts statement. Unfortunately, that leads to repetitive wasteful effort that adds up quickly over many work sessions and interrupts thinking flow while solving problems.
         | 
| 37 37 |  | 
| 38 38 | 
             
            puts_debuggerer automates that work via the short and simple `pd` command, automatically printing meaningful headers for output and accelerating problem solving work due to ease of typing.
         | 
| 39 39 |  | 
| @@ -288,7 +288,7 @@ There are many more options and powerful features in [puts_debuggerer](https://r | |
| 288 288 | 
             
            Add the following to bundler's `Gemfile`.
         | 
| 289 289 |  | 
| 290 290 | 
             
            ```ruby
         | 
| 291 | 
            -
            gem 'puts_debuggerer', '~> 0. | 
| 291 | 
            +
            gem 'puts_debuggerer', '~> 0.12.0'
         | 
| 292 292 | 
             
            ```
         | 
| 293 293 |  | 
| 294 294 | 
             
            This is the recommended way for [Rails](rubyonrails.org) apps. Optionally, you may create an initializer under `config/initializers` named `puts_debuggerer_options.rb` to enable further customizations as per the [Options](#options) section below.
         | 
| @@ -298,7 +298,7 @@ This is the recommended way for [Rails](rubyonrails.org) apps. Optionally, you m | |
| 298 298 | 
             
            Or manually install and require library.
         | 
| 299 299 |  | 
| 300 300 | 
             
            ```bash
         | 
| 301 | 
            -
            gem install puts_debuggerer -v0. | 
| 301 | 
            +
            gem install puts_debuggerer -v0.12.0
         | 
| 302 302 | 
             
            ```
         | 
| 303 303 |  | 
| 304 304 | 
             
            ```ruby
         | 
| @@ -311,7 +311,6 @@ Or the shorter form (often helpful to quickly troubleshoot an app): | |
| 311 311 | 
             
            require 'pd'
         | 
| 312 312 | 
             
            ```
         | 
| 313 313 |  | 
| 314 | 
            -
             | 
| 315 314 | 
             
            ### Awesome Print
         | 
| 316 315 |  | 
| 317 316 | 
             
            [puts_debuggerer](https://rubygems.org/gems/puts_debuggerer) comes with [awesome_print](https://github.com/awesome-print/awesome_print).
         | 
| @@ -471,11 +470,11 @@ Example Printout: | |
| 471 470 | 
             
            ```
         | 
| 472 471 |  | 
| 473 472 | 
             
            #### `PutsDebuggerer.header`
         | 
| 474 | 
            -
            (default = `' | 
| 473 | 
            +
            (default = `'>'*80`)
         | 
| 475 474 |  | 
| 476 475 | 
             
            Header to include at the top of every print out.
         | 
| 477 476 | 
             
            * Default value is `nil`
         | 
| 478 | 
            -
            * Value `true` enables header as `' | 
| 477 | 
            +
            * Value `true` enables header as `'>'*80`
         | 
| 479 478 | 
             
            * Value `false`, `nil`, or empty string disables header
         | 
| 480 479 | 
             
            * Any other string value gets set as a custom header
         | 
| 481 480 |  | 
| @@ -516,11 +515,11 @@ Prints out: | |
| 516 515 | 
             
            ```
         | 
| 517 516 |  | 
| 518 517 | 
             
            #### `PutsDebuggerer.footer`
         | 
| 519 | 
            -
            (default = `' | 
| 518 | 
            +
            (default = `'<'*80`)
         | 
| 520 519 |  | 
| 521 520 | 
             
            Footer to include at the bottom of every print out.
         | 
| 522 521 | 
             
            * Default value is `nil`
         | 
| 523 | 
            -
            * Value `true` enables footer as `' | 
| 522 | 
            +
            * Value `true` enables footer as `'<'*80`
         | 
| 524 523 | 
             
            * Value `false`, `nil`, or empty string disables footer
         | 
| 525 524 | 
             
            * Any other string value gets set as a custom footer
         | 
| 526 525 |  | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0. | 
| 1 | 
            +
            0.12.0
         | 
    
        data/lib/puts_debuggerer.rb
    CHANGED
    
    | @@ -63,6 +63,7 @@ module PutsDebuggerer | |
| 63 63 | 
             
              STACK_TRACE_CALL_LINE_NUMBER_REGEX = /\:(\d+)\:in /
         | 
| 64 64 | 
             
              STACK_TRACE_CALL_SOURCE_FILE_REGEX = /[ ]*([^:]+)\:\d+\:in /
         | 
| 65 65 | 
             
              STACK_TRACE_CALL_SOURCE_FILE_REGEX_OPAL = /(http[^\)]+)/
         | 
| 66 | 
            +
              OPTIONS = [:app_path, :source_line_count, :header, :wrapper, :footer, :printer, :print_engine, :announcer, :formatter, :caller, :run_at]
         | 
| 66 67 |  | 
| 67 68 | 
             
              class << self
         | 
| 68 69 | 
             
                # Application root path to exclude when printing out file path
         | 
| @@ -469,7 +470,14 @@ module PutsDebuggerer | |
| 469 470 | 
             
                end
         | 
| 470 471 |  | 
| 471 472 | 
             
                def determine_options(objects)
         | 
| 472 | 
            -
                   | 
| 473 | 
            +
                  if objects.size > 1 && objects.last.is_a?(Hash)
         | 
| 474 | 
            +
                    objects.delete_at(-1)
         | 
| 475 | 
            +
                  elsif objects.size == 1 && objects.first.is_a?(Hash)
         | 
| 476 | 
            +
                    hash = objects.first
         | 
| 477 | 
            +
                    hash.slice(*OPTIONS).tap do
         | 
| 478 | 
            +
                      hash.delete_if {|option| OPTIONS.include?(option)}
         | 
| 479 | 
            +
                    end
         | 
| 480 | 
            +
                  end
         | 
| 473 481 | 
             
                end
         | 
| 474 482 |  | 
| 475 483 | 
             
                def determine_object(objects)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: puts_debuggerer
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.12.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Andy Maleh
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2021-03-15 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: awesome_print
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: 1. | 
| 19 | 
            +
                    version: 1.9.2
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: 1. | 
| 26 | 
            +
                    version: 1.9.2
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: rspec
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -84,14 +84,14 @@ dependencies: | |
| 84 84 | 
             
              name: bundler
         | 
| 85 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 86 | 
             
                requirements:
         | 
| 87 | 
            -
                - - " | 
| 87 | 
            +
                - - ">="
         | 
| 88 88 | 
             
                  - !ruby/object:Gem::Version
         | 
| 89 89 | 
             
                    version: 2.1.4
         | 
| 90 90 | 
             
              type: :development
         | 
| 91 91 | 
             
              prerelease: false
         | 
| 92 92 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 93 | 
             
                requirements:
         | 
| 94 | 
            -
                - - " | 
| 94 | 
            +
                - - ">="
         | 
| 95 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 96 | 
             
                    version: 2.1.4
         | 
| 97 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -136,20 +136,6 @@ dependencies: | |
| 136 136 | 
             
                - - "~>"
         | 
| 137 137 | 
             
                  - !ruby/object:Gem::Version
         | 
| 138 138 | 
             
                    version: 0.7.0
         | 
| 139 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 140 | 
            -
              name: undercover
         | 
| 141 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 142 | 
            -
                requirements:
         | 
| 143 | 
            -
                - - "~>"
         | 
| 144 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 145 | 
            -
                    version: 0.3.4
         | 
| 146 | 
            -
              type: :development
         | 
| 147 | 
            -
              prerelease: false
         | 
| 148 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 149 | 
            -
                requirements:
         | 
| 150 | 
            -
                - - "~>"
         | 
| 151 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 152 | 
            -
                    version: 0.3.4
         | 
| 153 139 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 154 140 | 
             
              name: logging
         | 
| 155 141 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -220,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 220 206 | 
             
                - !ruby/object:Gem::Version
         | 
| 221 207 | 
             
                  version: '0'
         | 
| 222 208 | 
             
            requirements: []
         | 
| 223 | 
            -
            rubygems_version: 3. | 
| 209 | 
            +
            rubygems_version: 3.2.3
         | 
| 224 210 | 
             
            signing_key:
         | 
| 225 211 | 
             
            specification_version: 4
         | 
| 226 212 | 
             
            summary: Ruby library for improved puts debugging, automatically displaying bonus
         |